Alvaro Quintana

Greenhorn
+ Follow
since Dec 03, 2010
Alvaro likes ...
Netbeans IDE Fedora Java
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Alvaro Quintana

Problem Solved!

-¿What was wrong?-
I was scaling the image (RenderedImage) Object.

-Solution-
Keep the original image (without scale) and scale the Graphics2D object before draw image on it. After that the image is automatically adjusted to Graphics2D object and correctly printed (using best DPI configuration). Below i add the correct code to properly print an RenderedImage Object.





Hope this help!!
12 years ago
Well, after a lot of work i've discover that the printout image has poor quality because PrintJob Object by default set page dimension for 72 DPI. Now my problem is to properly change that value. Below i show the code i'm using to do it, but is not working.

Now the real problem for me is to properly change DPI attribute ..

Thanks in advance,
12 years ago
Hi all,

-Problem Context-
I've build an applet to properly manipulate and visualize TIFF images in browsers (manipulate means to rotate, zoom, an multitiff support). The applet receive base64 string representation of the TIFF image and show it to the user properly using JAI API. The applet keep the image without any transformation (as a RenderedImage), and all operations (rotate, zoom) are kept in another Object (RenderedOp).

-Problem-
I want to implement a print function that allows the user to print the TIFF image kept in the applet, but when i print the image, only a portion of the image is printed because the image is to big. I tried to scale the image to fit the page size, but when printed, the image is not showed properly (image lost quality). After that, i tried to save the image into a file, to check if the image, when coded and decoded to a Base64 string representation, was losing quality. After save the image, i printed it using an image viewer (Ubuntu Image Viewer is the one i am using), but when printed from the image viewer, the printout was correct (the image was fitted in the paper without lose quality).

-Question-
¿How can i print an image bigger than paper size without lose quality?
¿Am i doing the wrong operation to the image to fit the page? (scale operation in this case).

Below i put the code of the print method (implemented in a Printable Object) that is used to print the image. In this code the image is scale to fit the page.

-Code-


Any comments or suggestions are welcome. Thanks in advance for your help.
12 years ago

Campbell Ritchie wrote:[campbell@campbell1110 ~]$ uname -a
Linux campbell1110 2.6.35.12-90.fc14.i686 #1 SMP Fri Apr 22 16:14:44 UTC 2011 i686 i686 i386 GNU/Linux



Well i see we have the same Fedora with the last kernel version, but it seems yours is a 32bits fedora and mine is 64bits. The problem is rising with a 64 bits JRE, i haven't test with 32 bits JRE because all software installed is 64 bits (eclipse, netbeans, glassfish, tomcat).

Below i show the result of execute on my machine:

12 years ago

Campbell Ritchie wrote:I am running F14 and jdk1.6.0_25 and have never had that problem.



Hi Campbell, could you please post the result of this command "uname -a". I would like to compare kernel versions.

Thanks,
12 years ago

Jesper de Jong wrote:Errors like that, where the JVM really crashes, are most likely bugs in the JVM, or in a library that the JVM uses. Your particular error message seems to point directly to some function in libjvm.so - that really looks like a bug in the JVM itself. Unfortunately there's not much you can do about this. You could try running a different update version. I see that you're now using Java 1.6.0 update 25 (the latest version). You could try getting an earlier version (update 20, 21, ...).

I'm using Java 1.6.0 update 25 (64-bit, like you) on Ubuntu 10.10 and haven't seen this problem yet.

It points you to a log file that could have more information on where it crashed exactly:

Alvaro Quintana wrote:# An error report file with more information is saved as:
# /opt/apache-tomcat/bin/hs_err_pid4054.log



Well, i've installed JDK update 24, but i still get the same error, could be this something associated to SELinux?
12 years ago
Hi, everyone, i would really appreciate if someone can give me an advice about this problem that is driving me crazy.

I’ve installed Fedora 14 (Laughlin), and successfully installed JDK, but sometimes (not always) when i execute Eclipse or Netbeans or Glassfish (or anything that uses JRE), a kill signal is send to the process because java runtime had an error (see error below).

Thanks in advance for the help,

#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f602dca3761, pid=4054, tid=140051033437952
#
# JRE version: 6.0_25-b06
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.0-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x656761] PhaseLive::compute(unsigned)+0×241
#
# An error report file with more information is saved as:
# /opt/apache-tomcat/bin/hs_err_pid4054.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
12 years ago
Well, after a lot of search, i found a way:



See ya later and hope this helps
13 years ago
Hi all, i would like to know how to Zip a directory using Java, i've found that i could use the java.util.zip package but i need to zip the directory and put a password to the file created.... this is the only way i've found until now so i am open to new ideas... so the main idea is to compress a directory in such a way that only my application knows how to extract the compressed file.... Thanks to all
13 years ago
Hi all, I'm new in this forum, but i've been using Java for a few years. Right now i'm developing an application that use an embebed Derby Database (if you see there is another database that fix better to the problem i describe below, i will be glad to check your sugestions), i need to insert in a table 15 million of rows, but these rows are inserted using an statement like this (INSERT (SELECT))... so right now i have threads fetching the database (1000 rows each) and inserting the data, but when database grows this process gets slower. I must tell, that the table does not have any index or constraints. Is there any validation the database is performing that i'm leaving out and is making heavier this process??

Thanks for the help,

Alvaro