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

[Enhancement] Metadata Exif description field #1548

Closed
crusty49 opened this issue Oct 4, 2022 · 11 comments · Fixed by LycheeOrg/php-exif#55 or #1571
Closed

[Enhancement] Metadata Exif description field #1548

crusty49 opened this issue Oct 4, 2022 · 11 comments · Fixed by LycheeOrg/php-exif#55 or #1571
Labels
bug Something isn't working php-exif PHP-Exif related see https://github.com/LycheeOrg/php-exif/

Comments

@crusty49
Copy link

crusty49 commented Oct 4, 2022

Explain in a few words which functionality or improvements you would like to see in Lychee.
I'm just trialling Lychee at the moment. I notice that when uploading images the "description" field doesn't get imported even though it exists in the original file. Neither does it seem to get exported when downloading the file.

Is this intentional, or a bug? Any chance of a fix?

Or am I doing something wrong?

@ildyria
Copy link
Member

ildyria commented Oct 4, 2022

Neither does it seem to get exported when downloading the file.

Lychee does not modify the uploaded files (which thus count as including adding metadata).
Any description added stays in Lychee.

As for the import, Can you double check where it exists in the exif data. This should help us see where to find it for https://github.com/LycheeOrg/php-exif

@kamil4
Copy link
Contributor

kamil4 commented Oct 4, 2022

Yes, reading the description from the image file is definitely supposed to work. We've had a bug in the code that handles it, but it was fixed nearly a year ago: #1117. If you are using an old version of Lychee though (such as 4.4.0), you would likely be affected.

If you are using a more recent version, please provide us with Lychee diagnostics output as well as a sample image file that exhibits the problem and we'll see what the issue might be...

@kamil4 kamil4 added the More info required Issue which will be closed under 14 days if not replied by the author label Oct 4, 2022
@crusty49
Copy link
Author

crusty49 commented Oct 4, 2022

Thanks for the fast response. I'm using 4.6.0 Attached diagnostics dump.
I notice the warning in the dump about time zone not set. Can't see anywhere to specify time zone in Lychee.
I'm using Exif Pilot to add exif to old B/W scans.
Attached a sample pic.
Hope I have done this right.
Thanks, Bruce

exif
1945c1

Link to Google drive copy of image https://drive.google.com/file/d/1vMwxxD6SKPiI50WPj5Xq68Q8SxTWlBt3/view?usp=sharing

@crusty49
Copy link
Author

crusty49 commented Oct 4, 2022

Whoops... forgot the diagnostic.

diagnostics.txt

@kamil4 kamil4 added bug Something isn't working php-exif PHP-Exif related see https://github.com/LycheeOrg/php-exif/ and removed More info required Issue which will be closed under 14 days if not replied by the author labels Oct 5, 2022
@kamil4
Copy link
Contributor

kamil4 commented Oct 5, 2022

This is a bug in php-exif, our metadata extractor.

Our preferred metadata extracting backend is Exiftool, and your image works fine with it. However, because according to your diagnostics you have exec disabled on the server, you can't use Exiftool.

The metadata extractor then falls back to the Imagick backend, which happens to have a small typo. Until we get it fixed in a future release (probably 4.6.2), you can fix it yourself by editing the file Lychee/vendor/lychee-org/php-exif/lib/PHPExif/Mapper/ImageMagick.php. Line 36 looks as follows:

    const DESCRIPTION              = 'exif:ImageDescription ';

Can you see a space between ImageDescription and '? It needs to be removed, so that the line looks like this:

    const DESCRIPTION              = 'exif:ImageDescription';

This will fix it for you.

Regarding the time zone, you can set it by editing the file Lychee/.env.

@kamil4
Copy link
Contributor

kamil4 commented Oct 5, 2022

Are you OK with us adding your image to our testsuite?

@crusty49
Copy link
Author

crusty49 commented Oct 6, 2022

Yes file to use the image

@crusty49
Copy link
Author

crusty49 commented Oct 6, 2022

Thanks for your fast response. I applied the fix as you suggested, but got an error when uploading.
I reversed the fix, same problem. Removed the Lychee install (inc. folder files and database), reinstalled and still fails.
Installed to a different folder , and even a different domain but still no good.
Tried different images for the upload.
It doesn't seem to generate a server error, cpanel error log doesn't show a problem.
Unfortunately I didn't try an upload before the fix.
Maybe I should just wait for 4.6.2. I'm not sure it is your problem. Will have to do some more work on it.
Thanks, Bruce
upload failed

@crusty49
Copy link
Author

Hi there, just an update. Lychee install came good, not sure what the problem was.
Anyhow, have applied the fix above to exif:ImageDescription, but description is not showing, and in fact not being written to the database.
Cheers, Bruce

@kamil4
Copy link
Contributor

kamil4 commented Oct 11, 2022

Strange; it works here.

I'll try to get the fix included in the next release (4.6.2, probably) so hopefully that will fix it for you without any additional effort on your side!

@crusty49
Copy link
Author

Thanks very much. Will keep an eye out for the new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working php-exif PHP-Exif related see https://github.com/LycheeOrg/php-exif/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants