PNGEncoder on zOS-system fails
PNGEncoder on zOS-system fails
Hello
I am using JFreeChart with IBM WebSphere Application Server 4.0 on Windows and on zOS-platform. JDK 1.3
On Windows everything is allright, JPEG and PNG are correct encoded.
When I save the chart as PNG on zOS-system, the file is not valid and cannot be read, but there is no exception. When saving as JPEG, everything is okay.
I see, the PNGEncoder works with byte-arrays. Is it possible a convertion-problem from ASCII to EBCDIC ?
Have anyone experience of PNG encoding on zOS or OS390 ?
Thanks for any help
I am using JFreeChart with IBM WebSphere Application Server 4.0 on Windows and on zOS-platform. JDK 1.3
On Windows everything is allright, JPEG and PNG are correct encoded.
When I save the chart as PNG on zOS-system, the file is not valid and cannot be read, but there is no exception. When saving as JPEG, everything is okay.
I see, the PNGEncoder works with byte-arrays. Is it possible a convertion-problem from ASCII to EBCDIC ?
Have anyone experience of PNG encoding on zOS or OS390 ?
Thanks for any help
PNGEncoder on zOS-system fails
Hi Paulo!
Thanks for your help! Now the PNG-file is generated wonderful!
Manfred
Thanks for your help! Now the PNG-file is generated wonderful!
Manfred
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Hi Manfred,
Does the patched encoder work on all platforms? If it does, and the performance hasn't been affected too much, I'd be interested in updating it in the distribution...
Does the patched encoder work on all platforms? If it does, and the performance hasn't been affected too much, I'd be interested in updating it in the distribution...
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
I'm not so sure it needs to be configurable. Looking at the PngEncoder source code, plus the PNG spec, it looks like the Strings ('IHDR', 'IDAT' and 'IEND') ought to be converted to bytes using the ISO-8859-1 encoding, not any other encoding:
http://www.w3.org/TR/PNG#Chunk-layout
Someone correct me if I'm wrong (I haven't studied the PNG spec before).
http://www.w3.org/TR/PNG#Chunk-layout
Someone correct me if I'm wrong (I haven't studied the PNG spec before).
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Hi Paulo,
Thanks for helping to sort this one out! I have committed your changes to CVS ready for the 0.9.13 release next week.
Thanks for helping to sort this one out! I have committed your changes to CVS ready for the 0.9.13 release next week.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Hello,
Btw, I had submitted some time ago an RFE to be able to save chart in high resolution and was in the need to modify the PNGEncoder to specify the dpi resolution of the image.
The changed file can be found at this RFE : [ 777515 ] High resolution images saving.
Btw, I forwarded the changes to the author of PNGEncoder, J. David Eisenberg, who answered me :
Best regards,
Arnaud
Btw, I had submitted some time ago an RFE to be able to save chart in high resolution and was in the need to modify the PNGEncoder to specify the dpi resolution of the image.
The changed file can be found at this RFE : [ 777515 ] High resolution images saving.
Btw, I forwarded the changes to the author of PNGEncoder, J. David Eisenberg, who answered me :
So wel'll perhaps need to consider to change the package for the future...Thanks; glad you liked the package. I'm not doing much work with it,
since Sun is now shipping a library that does similar things.
Best regards,
Arnaud
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Hi Arnaud,
Thanks. I think I finally understand what that RFE is about. Do other image file formats allow you to specify the DPI or is that specific to PNG?
I'm going to retain the PngEncoder class for a while, since I want JFreeChart to remain JDK 1.2.2 compatible for a while longer yet.
Thanks. I think I finally understand what that RFE is about. Do other image file formats allow you to specify the DPI or is that specific to PNG?
I'm going to retain the PngEncoder class for a while, since I want JFreeChart to remain JDK 1.2.2 compatible for a while longer yet.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Hi David!
The PNG-Encoder with encoding "ISO-8859-1" are working correct on the windows and zOS platform. Performance is okay.
The next problem on zOS is the font. The SansSerif-font doesn't exist on zOS. So I must use the Lucida Sans Regular. Could you implement a method to set the default font for all Charts?
Example: In class ChartUtilities a static variable defaultFontName, a static setter and a getter-method. By default the default font is SansSerif and I can use ChartUtilities.setDefaultFontName("Lucida Sans Regular");
Look at these older postings:
http://www.jfree.org/phpBB2/viewtopic.p ... =sansserif
http://www.jfree.org/phpBB2/viewtopic.p ... =sansserif
Thanks, Manfred
The PNG-Encoder with encoding "ISO-8859-1" are working correct on the windows and zOS platform. Performance is okay.
The next problem on zOS is the font. The SansSerif-font doesn't exist on zOS. So I must use the Lucida Sans Regular. Could you implement a method to set the default font for all Charts?
Example: In class ChartUtilities a static variable defaultFontName, a static setter and a getter-method. By default the default font is SansSerif and I can use ChartUtilities.setDefaultFontName("Lucida Sans Regular");
Look at these older postings:
http://www.jfree.org/phpBB2/viewtopic.p ... =sansserif
http://www.jfree.org/phpBB2/viewtopic.p ... =sansserif
Thanks, Manfred
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Hi Manfred,
Paulo Soares has provided a patch for the PngEncoder that does away with the need for the encoding - it simply writes the correct byte values to the PNG file. This will be incorporated in the upcoming 0.9.13 release.
Regarding the default font, I will implement this when I get a chance...it's been added to the Feature Request Database (id=812410) so I don't forget about it.
Paulo Soares has provided a patch for the PngEncoder that does away with the need for the encoding - it simply writes the correct byte values to the PNG file. This will be incorporated in the upcoming 0.9.13 release.
Regarding the default font, I will implement this when I get a chance...it's been added to the Feature Request Database (id=812410) so I don't forget about it.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

