Skip to content
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

IFF - Can't parse file #27

Open
warpdesign opened this issue Jun 23, 2024 · 9 comments
Open

IFF - Can't parse file #27

warpdesign opened this issue Jun 23, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@warpdesign
Copy link
Contributor

I found a sample iff file that from what I read can be opened with Photoshop, but DPaint-js produces random pixels instead.

I don't have PhotoShop so I could not see the expected output.

@steffest
Copy link
Owner

image

Deluxe Paint can't open that file as well. (I guess software from the early 90's also isn't supposed to open 3840x5760 24 bit images :-) )
PhotoShops IFF implementation is - I assume - mostly targeted towards Maya.
it certainly is not compatible with anything Deluxe Paint related. (Photoshop can't read Deluxe Paint IFF files and vica versa)

I'll take a quick look what causing it, but as IFF is by design a container format where every program can define it own chunks, it's probably Photoshop specific, and probable a bit out of scope.

But still ... could be easy to implement.

@warpdesign
Copy link
Contributor Author

Oh Interesting! I didn't know Maya supported IFF.

Btw I was unable to find grayscale IFF files (these don't have a CMAP chunk and are usually 8 bpp or less from what I could read). Any idea where I could find or how to generate one?

Couldn't Deluxe Paint V open IFF-24 pictures? I thought so. I'll dig up my original CD to find out.

@steffest steffest changed the title Can't parse file IFF - Can't parse file Jun 24, 2024
@steffest
Copy link
Owner

Yes Deluxe Paint V can open IFF-24 bit pictures (and so can dpaint.js)
But this is not a standard one.

image

Interestingly, some Amiga 24-bit image editors open it with the exact same garbled pixels as dpaint.js, so at least there's some consistency. :-)

image

And double interestingly: if the latest IFF datatypes are installed, multiview on Amiga CAN open it ... (and surprisingly fast)
image

OK, I'm intrigued.
Time is limited this week, but I'll figure it out next week.

@warpdesign
Copy link
Contributor Author

warpdesign commented Jun 24, 2024 via email

@warpdesign
Copy link
Contributor Author

warpdesign commented Jun 24, 2024 via email

@steffest steffest added the bug Something isn't working label Aug 9, 2024
@warpdesign
Copy link
Contributor Author

@steffest hey, did you have time to have a look at this special files? By any chance would the sources to the DataTypes you're using be available? (Yeah, I know Amiga developers like to keep everything to themselves and reinvent the wheel constantly :))

@steffest
Copy link
Owner

@warpdesign
Yes, I "left" it a the presumption that it's a file with "out of spec" headers.

Luckily, times have changed and the Amiga community have embraced open source and is sharing knowledge these days.
Sources of these DataTypes are at https://aminet.net/package/util/dtype/ILBMdt

That packages includes an Amiga tool called "fixiff" that tries to fix some "commonly encountered problems with IFF ILBM files"

-> The fixiff tool will correct incorrect IFF FORM header sizes,
convert out-of-spec run-length encoding to valid encoding,
trim extra data and fill up incomplete BODY data with zeros.

The datatype uses those fixes on the fly. (You got to love that datatype system on the Amiga, it's utterly BRILLIANT)

After running that lady.iff image through that tool, dpaint.js can open the image. (still, VERY slowly though ... javascript :-) )
I haven't yet investigated what exactly is causing the problem in the original file, nor have I looked into the source code yet.
If you're interested, I've attached the "fixed" IFF file.

Github won't let me upload IFF or ZIP, you can download the lady_fixed IFF file at https://www.stef.be/dpaint/testfiles/lady_fixed.zip

@warpdesign
Copy link
Contributor Author

Oh now that's interesting! I'll have a look and see if a fix can be implemented :)
I'll also have a look at the slow decoding in js: I'm sure it can be made faster.

@warpdesign
Copy link
Contributor Author

And yes: datatypes were an interesting concept which made old apps support formats that did not even exist when the OS was written. Too bad it did not support streaming. Also, I remember using software with their own decoders because datatypes were too slow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants