Liipimaginebundle: Exception: PHP exif extension is required to use the ExifMetadataReader

Created on 19 Sep 2014  路  13Comments  路  Source: liip/LiipImagineBundle

When upgrading to the lastest dev-master, I receive the following when simply trying to read an image:

Uncaught PHP Exception Imagine\Exception\NotSupportedException: "PHP exif extension is required to use the ExifMetadataReader" at /home/rumie/test-content/vendor/imagine/imagine/lib/Imagine/Image/Metadata/ExifMetadataReader.php line 25 {"exception":"[object] (Imagine\Exception\NotSupportedException: PHP exif extension is required to use the ExifMetadataReader

Probably better to simply not read the exif data rather than blowing up.

I suspect this used to either be optional or go through a different path.

Bug 馃悶

Most helpful comment

I added this to my parameters: (config.yml)
liip_imagine.meta_data.reader.class: "Imagine\Image\MetadataDefaultMetadataReader"

All 13 comments

Looks like we have a bug, I'd expect it to be optional functionality.

Downgrading to 1.0.4 solved it for me, so it was introduced sometime between then and now.

might be an issue with the imagine lib

Same error for me. Looks like the breaking change was introduced in 1.0.5.
1.0.4 works. 1.0.5 does not.

I believe it has to be fixed in the Imagine library. So I opened an issue there: https://github.com/avalanche123/Imagine/issues/403

Still not fixed.

I fixed that problem change the value of the parameter liip_imagine.meta_data.reader.class in imagine.xml by default the value is Imagine\Image\MetadataExifMetadataReader and I change to Imagine\Image\MetadataDefaultMetadataReader, if that parameter can change in the bundle config to that way not modified the bundle.

@x3r0z editing imagine.xml solved the problem for me thank you.
If it can help, the absolute path of this file is :
vendor\liipimagine-bundle\Liip\ImagineBundle\Resources\configimagine.xml

I added this to my parameters: (config.yml)
liip_imagine.meta_data.reader.class: "Imagine\Image\MetadataDefaultMetadataReader"

@Miliooo Thanks for your solution, works great!

@lsmith77 this is not an issue with imagine lib, the bundle configures it with ExifMetadataReader which requires ext-exif. I think we need to change it to DefaultMetadataReader or configure it dynamically depending on ext-exif availability.

@Miliooo @WebDevCodr I have an unrecognized option error here with that fix

@stickyhands I just opened #841 which should fix the issue with a compiler pass, so you don't have to fiddle around with parameters here.

btw: @Miliooo surely meant setting it through a parameter and not directly in config.yml.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

robfrawley picture robfrawley  路  4Comments

tobias-r picture tobias-r  路  4Comments

ghost picture ghost  路  5Comments

pamil picture pamil  路  6Comments

dariuszp picture dariuszp  路  4Comments