Exporting document from Preview.app can fail when filetype doesn't match extension

Number:rdar://39445043 Date Originated:April 15, 2018
Status:Open Resolved:
Product:macOS Product Version:10.13.4 (17E199)
Classification: Reproducible:Always

When viewing an image whose file extension doesn't match its actual type, Preview can fail to export that file when the file is exported after saving the file (to correct its extension).

Steps to Reproduce:

1. Find a PNG whose file extension is .jpeg or used the one attached.
2. Open the file in Preview.app and hit Command-S. Preview will correct the file extension back to .png.
3. Without closing the Preview window, export the file as JPEG.

Expected Results:

Preview exports a JPEG encoding of the original image.

Actual Results:

Preview exports a blank or improperly encoded image instead. Please see the "exported.jpeg" file attached for an example.


10.13.4 (17E199)



Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!