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

Better EXIF extraction #518

Merged
merged 10 commits into from
Apr 18, 2016
Merged

Better EXIF extraction #518

merged 10 commits into from
Apr 18, 2016

Conversation

qligier
Copy link
Contributor

@qligier qligier commented Apr 17, 2016

Small rewrite of EXIF extraction and a few improvements.

  • No need to create temp variable to check if array element exists
  • No error suppression #515
  • Import photo tags (works with Lightroom, maybe also with others softwares) #514
  • Converting GPS coordinates to float number of degrees #494

Tested with a few photos, without bugs.

@electerious electerious merged commit b9a7bd1 into electerious:develop Apr 18, 2016
electerious added a commit that referenced this pull request Apr 18, 2016
@electerious
Copy link
Owner

electerious commented Apr 18, 2016

Looks great, but I'm getting a few warnings when trying to upload photos:

[18-Apr-2016 07:39:05 UTC] PHP Warning:  mysqli_real_escape_string() expects parameter 2 to be string, array given in /Users/tobiasreich/Sites/lychee/php/Modules/Database.php on line 336
[18-Apr-2016 07:39:16 UTC] PHP Warning:  mysqli_real_escape_string() expects parameter 2 to be string, array given in /Users/tobiasreich/Sites/lychee/php/Modules/Database.php on line 336
[18-Apr-2016 07:39:16 UTC] PHP Warning:  exif_read_data(578c31ef8360e74356ff0d7a3cb0753f.jpg): Incorrect APP1 Exif Identifier Code in /Users/tobiasreich/Sites/lychee/php/Modules/Photo.php on line 786
[18-Apr-2016 07:39:16 UTC] PHP Warning:  mysqli_real_escape_string() expects parameter 2 to be string, array given in /Users/tobiasreich/Sites/lychee/php/Modules/Database.php on line 336
[18-Apr-2016 07:39:17 UTC] PHP Warning:  mysqli_real_escape_string() expects parameter 2 to be string, array given in /Users/tobiasreich/Sites/lychee/php/Modules/Database.php on line 336
[18-Apr-2016 07:39:18 UTC] PHP Warning:  mysqli_real_escape_string() expects parameter 2 to be string, array given in /Users/tobiasreich/Sites/lychee/php/Modules/Database.php on line 336
[18-Apr-2016 07:39:20 UTC] PHP Warning:  mysqli_real_escape_string() expects parameter 2 to be string, array given in /Users/tobiasreich/Sites/lychee/php/Modules/Database.php on line 336
[18-Apr-2016 07:39:20 UTC] PHP Warning:  mysqli_real_escape_string() expects parameter 2 to be string, array given in /Users/tobiasreich/Sites/lychee/php/Modules/Database.php on line 336
[18-Apr-2016 07:39:22 UTC] PHP Warning:  mysqli_real_escape_string() expects parameter 2 to be string, array given in /Users/tobiasreich/Sites/lychee/php/Modules/Database.php on line 336
[18-Apr-2016 07:39:24 UTC] PHP Warning:  mysqli_real_escape_string() expects parameter 2 to be string, array given in /Users/tobiasreich/Sites/lychee/php/Modules/Database.php on line 336
[18-Apr-2016 07:39:26 UTC] PHP Warning:  mysqli_real_escape_string() expects parameter 2 to be string, array given in /Users/tobiasreich/Sites/lychee/php/Modules/Database.php on line 336

@qligier
Copy link
Contributor Author

qligier commented Apr 18, 2016

It seems to be caused by the photo, can I get it? I'll do some adjustment on the code.

@electerious
Copy link
Owner

Seems to happen with several test-images. Here're two of them (The second one is transparent):
iptc
transparent

@qligier qligier deleted the pr-exif2 branch April 18, 2016 08:20
@qligier qligier mentioned this pull request Apr 18, 2016
@qligier
Copy link
Contributor Author

qligier commented Apr 18, 2016

exif_read_data throws uncatchable warnings when EXIF data don't exists or are malformed, so we have to suppress the errors for this.
I also have errors shown when I add a photo. The photo is correctly added and the AJAX returns the new ID but it shows "Server returned an unknown response. Please take a look at the console of your browser for further details."
Not sure if caused by my PR.

@electerious
Copy link
Owner

Any way to reproduce it? My test-photos are uploading without errors.

@qligier
Copy link
Contributor Author

qligier commented Apr 18, 2016

I'll do a clean reinstallation of the dev branch to retry. My current installation has maybe seen too much photo duplicates and different versions of the script. But if you've got no error it should be good.

@electerious electerious mentioned this pull request Apr 30, 2016
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

Successfully merging this pull request may close these issues.

2 participants