-
Notifications
You must be signed in to change notification settings - Fork 27
vips_foreign_find_load missing #37
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
Comments
I agree, I think it'd be a useful improvement. We should add the one for buffers as well, I guess. In the meantime, you could just open the file and look at the
So open once, get loader name, open a second time with whatever arguments you want. |
OK, in git master. Thanks! |
git master php-vips has a wrapper as well, with a fallback to the property method: https://github.com/jcupitt/php-vips/blob/master/src/Image.php#L716 and a version for buffers. |
Nice! Travis is currently failing because the newest version of php-vips-ext isn't on PECL yet, I think we can ignore it for now. |
OK, fixed travis. It turns out you can't |
In order to pass the correct options before the
Image::newFromFile
operation, thevips_foreign_find_load
will come in handy to determine the image format.Example:
The page property works only for PDFs, TIFFs, and multi-size ICOs (or any other image that has more than one page). But doesn't work for a JPEG (it will fail with the error:
Message: jpegload: no property named 'page'
). In order to pass the page property to the correct loader we can check first withvips_foreign_find_load
if the operation permits a page property.The text was updated successfully, but these errors were encountered: