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

Support HEIC files #190

Open
edent opened this issue Mar 11, 2019 · 6 comments
Open

Support HEIC files #190

edent opened this issue Mar 11, 2019 · 6 comments

Comments

@edent
Copy link
Collaborator

edent commented Mar 11, 2019

As an Apple user, I want to be able to upload in this new format.

https://twitter.com/rafal_design/status/1105171620568723457?s=20

@edent
Copy link
Collaborator Author

edent commented Mar 13, 2019

From the ImageMagick changelogs, you need 7.0.8-25 for ImageMagick 7 or 6.9.10-25 for Imagemagick 6.

https://stackoverflow.com/questions/55131609/read-exif-data-from-heic-photo-using-php?noredirect=1#comment97005467_55131609

@natesilva
Copy link

When uploading a HEIC photo from an iPhone, it’s automatically converted to JPEG—but the GPS data is stripped, so it won’t work with OpenBenches.

To support HEIC we’ll need to know how to prevent Safari from converting the file to JPEG.

And for any other iPhone users wondering how to upload such a thing:

  • On a Mac:
    • Select the photos in the Photos app.
    • Choose File > Export > Export Unmodified Original.
      • This saved a .HEIC file with an .XMP sidecar file.
    • I used a free app from the Mac App Store—HEIC Converter by @sindresorhus—to convert the file to a .jpg.

By doing this, it converted the photo to JPEG while preserving its GPS data.

@edent
Copy link
Collaborator Author

edent commented Nov 20, 2020

Getting back to this.

  • cloudimg.io supports converting from HEIC to JPG/WebP. So we can serve up the images once they're uploaded. Some of the images display upside down though. I've raised a support ticket with them.
  • Next is reading the EXIF server side.
  • Display the HEIC in the browser (https://caniuse.com/?search=heic)
  • Then detecting the geolocation of the file in the browser.
  • Finally, better instructions for iOS users!

@edent
Copy link
Collaborator Author

edent commented Nov 20, 2020

Reading EXIF server side

$imagick = new Imagick();
$imagick->readImage('test1.heic');
$exifArray = $imagick->getImageProperties("exif:*");
var_dump($exifArray);

@edent
Copy link
Collaborator Author

edent commented Nov 20, 2020

There are libraries for rendering HEIC in the canvas

1.3MB though!

Demo at https://strukturag.github.io/libheif/

@edent
Copy link
Collaborator Author

edent commented Nov 20, 2020

Reading Geolocation EXIF from HEIC

https://github.com/exif-heic-js/exif-heic-js

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