[wp-trac] [WordPress Trac] #55057: WebP EXIF data missing and images are not rotated in the same way JPEG images are rotated.

WordPress Trac noreply at wordpress.org
Mon Mar 28 16:12:10 UTC 2022


#55057: WebP EXIF data missing and images are not rotated in the same way JPEG
images are rotated.
--------------------------+------------------------------
 Reporter:  mitogh        |       Owner:  adamsilverstein
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  Future Release
Component:  Media         |     Version:  5.8
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:  performance
--------------------------+------------------------------

Comment (by codekraft):

 Replying to [comment:3 mitogh]:
 > Thanks for taking a look into this @adamsilverstein I tried to find some
 alternatives for `exif_read_data` that can be used for WebP but I was not
 lucky enough to find information.
 >
 > Let me know in case I can help with anything else on this one.

 @mitogh I found a way to get the exif metadata without any php module and
 I can retrieve some information such as the orientation of the images...
 The issue with webp is that the exif data are stored inside the image in
 RIFF format while the different php modules (which @adamsilverstein has
 listed) are not able to grab them (and this makes me think that in the
 various servers this will come in a very long time)

 This is a poc of how exif icc xmp and animations could be extracted using
 php:
 https://gist.github.com/erikyo/c9365b0bc49d599f1be14b2f7feeed91

 You will get (for the images that store the exif meta) an array with the
 information of the image and a field "orientation" like this:

 [orientation] => 0008


 {{{
 1        2       3      4         5            6           7          8

 888888  888888      88  88      8888888888  88                  88
 8888888888
 88          88      88  88      88  88      88  88          88  88      88
 88
 8888      8888    8888  8888    88          8888888888  8888888888
 88
 88          88      88  88
 88          88  888888  888888
 }}}


 This is the way to get the orientation but I was wondering if it would be
 interesting to write a library that allows avoid the dependency of the
 EXIF php module. What do you think? it's worth of it?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55057#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list