Corrupted PNG file from ImageSave
joerg.kunze
a problem description:
Igor 6.2.2.2
Win7
Firefox 10.0
Internet Explorer 9
I create a PNG file e.g. as follows:
•Make/O/U/B/N=(256,256,3) Img = mod(x+y,256)
•ImageSave/O/T="PNGf" Img as "C:Temp:Img1.png"
The resulting PNG file seems to be corrupted. If I try to open it with Firefox or Internet Explorer I get a message "the image cannot be opened, because it contains errors." And that is a problem, because it means, that the resulting graphs cannot be published online.
The resulting PNG file can be correctly viewed with other programs like e.g. GIMP. It is correctly displayed in the Windows file preview. A Quicktime upgrade does not help nor does a Quicktime downgrade. Both used browsers are pretty up to date.
In contrast a PNG file created with the following command can be displayed without problem in Firefox and IE:
•SavePICT/O/T="PNGf"/B=72 as "C:Temp:Img2.png"
So the problem seems to be related to the ImageSave command. Interestingly both browsers are affected, so it could also be connected to the operating system.
Does anyone of you know how to resolve this problem?
Best regards,
Joerg.
P.S.: Despite from this error Igor 6 works pretty fine!
PNG is a compressed format. ImageSave/O/T="PNGf" does not perform a compression.
February 8, 2012 at 04:08 pm - Permalink
Try using /T="rpng"
or
/T="png"
A.G.
WaveMetrics, Inc.
February 8, 2012 at 05:17 pm - Permalink
"PNG" works.
The funny thing is, that I while ago I had to change the program code from "PNG" to "PNGf", because "PNG" did not work any longer after a Quicktime update. So now it is "PNG" again.
Many thanks,
Joerg.
February 8, 2012 at 10:41 pm - Permalink
"PNGf" was the original designation when we first added png support. This was changed for IP6 to "png" (for both platforms). I do not recall a change to "PNGf".
A.G.
WaveMetrics, Inc.
February 9, 2012 at 09:35 am - Permalink