WebChemistry / images

Image storage for Nette Framework
36 stars 20 forks source link

fixOrientation modifier on FileResource #42

Closed martenb closed 5 years ago

martenb commented 5 years ago

Hello, I need fixOrientation modifier on FileResource, but it is only for ITransferResource.

I tried to create custom ModifiersLoader, but i don't know, how to get IImageStorage to get path to file for exif_read_data... I tried to inject it, but it fails with

Circular reference detected for services: images.template.facade, images.storage, images.resourceMetaFactory, images.modifiers.

Thx for help...

MartkCz commented 5 years ago

You should call fixOrientation only if new image is uploaded. When image is saved, exif data are destroyed (gd library doesn't store exif data), so modifier fixOrientation on FileResource has no effect.

martenb commented 5 years ago

I store original photos from upload, so I have exif on saved images.

MartkCz commented 5 years ago

try dev-master, please

martenb commented 5 years ago

I cannot test it, because dev-master requires nette/http:^3.0, I am on 2.4...

MartkCz commented 5 years ago

So try 4.1.5, please

martenb commented 5 years ago

Not working, function exits on

https://github.com/WebChemistry/images/blob/4.1.5/src/Modifiers/BaseModifiers.php#L43

MartkCz commented 5 years ago

4.1.6

martenb commented 5 years ago

Works well, thank you. I prepared merge request with more complex fixOrientation. #43