<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>210021</bug_id>
          
          <creation_ts>2020-04-05 02:37:45 -0700</creation_ts>
          <short_desc>EXIF orientation info in PNGs isn&apos;t used for image-orientation: from-image</short_desc>
          <delta_ts>2022-06-20 00:14:34 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Images</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.15</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Eric Portis">e</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>jonlee</cc>
    
    <cc>karlcow</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1637850</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Portis">e</who>
    <bug_when>2020-04-05 02:37:45 -0700</bug_when>
    <thetext>`image-orientation: from-image` correctly reads and applies EXIF orientation from JPEGs; however it does not read or apply EXIF orientation info from PNGs.

See a test page/resources here: https://ericportis.com/etc/PNG-EXIF-orientation/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1637998</commentid>
    <comment_count>1</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2020-04-05 17:27:33 -0700</bug_when>
    <thetext>&lt;rdar://problem/61323993&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1637999</commentid>
    <comment_count>2</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2020-04-05 17:28:30 -0700</bug_when>
    <thetext>Either there is a bug in exiftool or in one of the macOS underlying framework.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1638158</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2020-04-06 10:26:19 -0700</bug_when>
    <thetext>This seems to be a quirk of the image.

The image has these chunks:
	IHDR
	PLTE
	IDAT
	eXIf
	IEND
libpng does not recognize the ‘eXIf’ chunk if it’s after the image data (IDAT).
The spec states: “The eXIf chunk may appear anywhere between the IHDR and IEND chunks except between IDAT chunks.”
So in theory it’s allowed, but libpng does not support this.
If the PNG is modified (moved eXIf before IDAT) it displays as expected (90º rotated).
FireFox, Chrome, GraphicConverter don’t handle this either.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1638321</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Portis">e</who>
    <bug_when>2020-04-06 14:31:51 -0700</bug_when>
    <thetext>@smfr Interesting!

Here&apos;s a new test page: https://ericportis.com/etc/PNG-EXIF-orientation/shuffling-chunks/

Looks like (on MacOS 10.15):

Finder, Preview, and Safari respect eXIf-before-IDAT.

Chrome and Firefox do not respect eXIf-before-IDAT.

I&apos;m not sure how any browser can support both eXIF-*after*-IDAT and also progressively render partially-downloaded, progressively-encoded PNGs. In some initial testing both Firefox and Chrome will paint partially-downloaded PNGs, but Safari does not.

Does a note about PNG chunk order and/or progressive rendering belong in the spec?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1876744</commentid>
    <comment_count>5</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2022-06-20 00:14:34 -0700</bug_when>
    <thetext>A similar case has been reported on webcompat.com
https://github.com/webcompat/web-bugs/issues/94467</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>