-
-
Notifications
You must be signed in to change notification settings - Fork 707
add magickload_source #4592
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
add magickload_source #4592
Conversation
test with eg.: ``` $ cat MARBLES.BMP | vips magickload_source "[descriptor=0]" x.v $ cat MARBLES.BMP | vipsthumbnail stdin -o x.jpg ``` ImageMagick doesn't support generic IO, so it just maps the source into memory and uses the buffer interface. magick6 and magick7.
It looks like IM7 provides |
Haha so just the same as us then :) At some point in the future I suppose we can update this thing to use a proper stream interface, if they add one. |
I guess we could also check this and fall back to the filename interface. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! I assume the C declaration (i.e. vips_magickload_source()
) was intentionally omitted?
Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>
Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>
ie. if the source has an associated filename
…o add-magicload_source
Ahem, I added the decl, good catch. I made it use the filename interface if the source has an associated filename, it'll broaden compatibility a little. |
Ah, I think we also need to add the C implementation of this to
Great! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These suggestions were caught by CodeQL:
https://github.com/libvips/libvips/actions/runs/15945176481/job/44978306353?pr=4592
I'm rushing and missing stuff :( I've now actually tested against im6 and it seems fine, phew. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! This also allows me to remove the buffer-based fallback in the weserv/images
project, which was only necessary for BMP and ICO images.
I've updated #2051 too.
Great! Thank you for the help! |
test with eg.:
ImageMagick doesn't support generic IO, so it just maps the source into memory and uses the buffer interface.
magick6 and magick7.
See #4530