Skip to content
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

Preserve Metadata #154

Open
animaux opened this issue Jan 26, 2017 · 7 comments
Open

Preserve Metadata #154

animaux opened this issue Jan 26, 2017 · 7 comments

Comments

@animaux
Copy link
Contributor

animaux commented Jan 26, 2017

GD does not retain any EXIF/XMP- or other Metadata while creating scaled images.

This may seem unimportant, but there are plenty of usecases where at least a copyright entry would be important to have, since it’s obviously easy to download the images JIT creates. Even Facebook is facing legal action here:

https://petapixel.com/2016/11/22/german-photographer-sued-facebook-removing-exif-data-won/

Here’s some info and actual code supposed to work with GD:
http://metadatamanifesto.blogspot.de/2008/05/free-php-scripts-preserve-metadata-for.html

This link is quite old though.

Sorry, the link on the above page is not leading to this info anymore.

@michael-e
Copy link
Member

I am currently doing some research on that matter. It seems that GD is not the right tool if you want to preserve EXIF data. Imagick is more powerful, but unfortunately it may not be available on cheap hosting environments. So I don't see a solution that could be built into JIT.

It would be interesting to create something like a "JIT Pro" extension for Symphony which uses Imagick exclusively. But I won't find the time to do this. Instead I will implement some ugly hacks in JIT, probably.

There are three interesting issues nowadays with JIT and images:

@animaux
Copy link
Contributor Author

animaux commented Feb 15, 2017

At least with providers I normally use Imagick is supported. JIT 2 is generally quite a hack currently. With @nitriques as a fresh parent I don’t see the current issues getting fixed soon.

http://www.whoishostingthis.com/compare/imagemagick/ (probably not an exaustive list)

@michael-e
Copy link
Member

I hacked together something for my needs, and I have one more information to share:

Imagick is terribly slow. To be precise: Creating Imagick image objects is slow (compared to GD). Also some calculations (e.g. color profile conversion) are slow. :-(

It's OK for me, because I have a very fast server with a lot of processors (working in parallel when many images have to be created). But I don't think it would be funny on shared hosting.

@animaux
Copy link
Contributor Author

animaux commented Feb 15, 2017

Ok, thanks Michael. Sounds like performance really is the showstopper.

There are some threads on the web mentioning using exiftool to copy metadata and inject it back again after GD has done its magic. I think there might have been some built-in exif functionality in PHP.

One thing I always wished for was some kind of plugin-interface for JIT that allows to use all kinds of GD filters and commands via some scripts or extensions. Maybe even a kind of command-line field for recipes could be a good enough interface?

@michael-e
Copy link
Member

michael-e commented Feb 15, 2017

The problem is: JIT 1.x is a chaos, and JIT 2 is messed up. :-)

If I had the time…

@animaux
Copy link
Contributor Author

animaux commented Feb 15, 2017

If I had the skill and the time …

@michael-e
Copy link
Member

Skills? Not here. :-) 15 lines of code took me 2 days, then I realized that it doesn't work. Tomorrow is another day…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants