New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PICT images with missing rows and columns #419
Comments
Hi José, Thank you for reporting and providing a sample file! I can reproduce the problem here. I will look into it in more detail later. Seems like some kind of rounding error or so. About the ".pic" file extension, it could mean many formats. But the only TwelveMonkeys plugin that claims to read it, is the -- |
PS: For reference, can you please open the above PICT file in Photoshop, convert it to PNG and attach it here? -- |
No, I am the one who should thank you! Great work you're doing here. I am all excited waiting for version 3.4, can't wait to include it in my viewer Meew.
Great, I made a wild guess in Meew and I associated the PIC with the HDR. Glad I was right. However, the way it is coded, the extension is ignored when getting an ImageReader, so an Apple PICT ending with .PIC will be correctly read as well, even though it will display this in the info window as the type:
The later part is incorrect (the later part is the SO file description) because during setup I associate the PIC with HDR. I also group PIC with HDR for file filters when showing the opening dialog. Though I've always wonder if it was the right choice, at least I'm more at ease now.
Sure, here goes: |
Thanks! I think I have it fixed now, by rounding the x/y coordinates, instead of truncating by casting. I think it should make it to 3.4. Re. PIC: Determining file format by file extension is never safe, so you should probably do it by data inspection instead. Also, it really is Radiance RGBE (not RGBA) HDR format, see Wikipeida. There are many other formats capable of HDR, although the Radiance format was one of the first, and thus has wide support. PS: The Mime type for the Radiance RGBE format isn't "image/x-pict", that is an unofficial extension mime-type (as is always for "image/x-something") for PICT. The correct mime is "image/vnd.radiance". -- |
Beautiful!!! It would be very sweet to see this fixed in 3.4 : ) Many thanks. Oh, yes, that was the example of a .PIC that wrongly held a PICT image instead of HDR, but thank you for caring. For true HDR pictures I get this:
The first part and mime-type should always be shown correctly (I hope), the description is retrieved from the SO, so it will be incorrect if the extension is wrong. But I want it there so I can easily see that the extension is incorrect for the file (when there is a mime and description mismatch). For the mime-type, I had problems getting it right (all Java methods seem to only care about the extension and the one that truly probed the file contents only supported 3 or 4 formats, ugh) and the way I got to solve this was "cheating a bit". Since the proper image reader is always loaded for the input stream, I do something like this (not exactly, since I also do a check to strip the point before the extension, that it shouldn't be there, but just in case):
And as you can see, I associated the pic with hdr : ) For the "Bitmap\Grayscale\Indexed\RGB\RGBA\RGBE" info, if the image is colored I check the number of bits and it should be something like this: 24=RGB, 32=RGBA, over 32=RGBE, otherwise Index with n bits. |
I see. 😀 You probably know already, but just in case, an alternative way of finding the mime type is:
-- |
In any case, the fix is in. Will be part of 3.4 -- |
This is a barely noticed issue. I have come across a PICT issue where a single row and column is missing from the generated image. It is better seen in non-photo images (like the drawing in the following example).
The PICT images I have were created by me with Photoshop and are displayed properly in Photoshop (I have no other app for handling PICT images).
Here is an example where a row (at +/- 352px) and a column (at +/- 354px) are missing (the column is harder to spot because there are only 2 points where it affects the girl and 1 of these matches the row issue):
The overall size of the image is correct, so the problem results in the last column and row to be transparent.
Either two things are happening while reading the image: or the row and column are skipped or they overwrite a previously read row and column. After a quick glance, it seems the first scenario (though I can't understand what's really going on).
Not related to this issue, but I have been wanting to ask, is the ".PIC" format that Twelve Monkeys can read referring to the "PICT - Apple Picture" format or to the "HDR - High Dynamic Range" format?
PS: I'll attach the original PCT file.
pict-example.zip
The text was updated successfully, but these errors were encountered: