PAM loading not working #2
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello, using the recently updated 1.9.1 version in Gentoo, I tried to view a PAM image (freshly created via
magick convert my.png my.pam
) with the following header:with imlib2_view but I got
No loadable image
and no further error. Same if I convert the image so that itsTUPLTYPE
becomes justRGB
.Reading the source code for it, I don't really understand that line:
https://git.enlightenment.org/old/legacy-imlib2/src/branch/master/src/modules/loaders/loader_pnm.c#L157
that seems to expect width to be 332.
Yes, imlib2 has never supported PAM ("P7\n" signature) images.
The code you are referring to is for loading a somewhat obscure image type ("P7 332\n" signature) used by xv for thumbnails.
I see. I might try my hand at it, would it be acceptable? If I were to do it, I'd probably dispatch to pbm/pgm/ppm on non-alpha cases and write a new loop for each alpha variant.
Might be worth to use inline functions (i.e. load_rgb, load_bw, etc...) with a boolean alpha argument to get all the speed advantages without having to duplicate each loop.
By the way, what is P8? Can't find anything about it on the web, and it seems similar to RGB_ALPHA PAM.
You are most welcome to contribute :)
I have now and then considered to add pam support but never got around to it.
I don't know where the P8 type comes from. I cannot find anything about it anywhere either. It looks like an imlib2 special used for images with alpha.
I've finished and tested the feature, but before I make a PR, I want to know: is the code base C89 or C99? Since I see <stdbool.h> includes here and there but ANSI style variable declarations, I don't really know.
Interesting :)
C99 is required as there are a few elements that are used here and there, such as stdbool, stdint, designated initializers, C++ style comments, and probably some more.
However, I'd like the codebase to be somewhat homogeneous, so please keep new code reasonably similar to what's already there.
I'm afraid I don't unsterstand what you mean by "ANSI style variable declarations".
When you run configure, please add --enable-werror to weed out the most trivial issues, in case there are any.
As for formatting, you can simply run like "$ indent src/modules/loaders/*.?" (or not and I will :) ).
Meant "variables declared at the top of the scope" with "ANSI style variable declarations".
Ah, yeah, I'm no fan of variables being declared all over the place, old habits.. :)
Patch puched, issue fixed, I think.
Thanks :)