php-vips: writeToBuffer doesn't output edited/removed EXIF data
Testcase: https://gist.github.com/kleisauke/5a9272198172fc95a47b9add54b0189d
Test image: https://raw.githubusercontent.com/recurser/exif-orientation-examples/master/Landscape_6.jpg
php test.php Landscape_6.jpg
Should output:
Rotate 90 degrees
No EXIF Orientation
No EXIF Orientation
Instead the original orientation is outputted:
Rotate 90 degrees
No EXIF Orientation
Rotate 90 degrees
By the way,
Maybe it’s better to also include the vips_image_get_typeof in this PHP binding (for example $image->get_typeof($fieldName);). I’m now catching exceptions instead.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 31 (31 by maintainers)
Commits related to this issue
- add Image::typeof now that get() throws an exception on field does not exist, we need Image::typeof see https://github.com/jcupitt/php-vips/issues/13 — committed to libvips/php-vips by jcupitt 8 years ago
- add vips_image_remove() see https://github.com/jcupitt/php-vips/issues/13 — committed to libvips/php-vips-ext by jcupitt 8 years ago
- add Image::remove() see https://github.com/jcupitt/php-vips/issues/13 — committed to libvips/php-vips by jcupitt 8 years ago
- Contrast manipulator, catch exceptions, sass + more - Use Sass to generate our css. - Revert the alternative for SVG shape masking commit (9e9184fba0e42d0b0fb4004c222a29682faba375). Because loading w... — committed to weserv/images by kleisauke 8 years ago
- Use php-vips enumerations - Use php-vips enumerations instead of our own / hard-coded. - Move some logic from `index.php` to `Server.php`. - phpcs indenting fixes. TODO: - We should check the cache ... — committed to weserv/images by kleisauke 8 years ago
- Update php-vips to version 1.0.0 - Update php-vips to the latest version. - Use *magick centre sampling convention instead of corner sampling. - Implement contrast manipulator (contrast reduction doe... — committed to weserv/images by kleisauke 8 years ago
Here it is in PHP:
Run
nip2 x*.vto see the two curves.That’s a very direct translation. You can make it a bit quicker: there are several sequences like:
That’s a simple linear transform of
$x, so you can swap those three calls for a single->linear(). Of course this is just making a LUT and won’t be run for every pixel, so perhaps speed doesn’t matter.OK, I’ve updated everything with the fixed equation, it works much better now, though you can no longer decrease contrast.
I’ll have a look at the IM sources and see how they do contrast reduction.