You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Exporting certain photos as JPEG results in way-too-large disk files

I have just noticed that certain images, when exported from Photos as JPEGs, are way too large on disk. This happens reliably with certain images, but does not happen with other roughly similar images taken at the same time with the same camera (in this case an iPhone 11 Pro). I am using Photos v 6.0 (321.0.110) on macOS Big Sur 11.1 on a 2019 16-inch MacBook Pro.


For example, I start with four images of a dog taken in the same session. I import them into Photos from the phone. Then I export them as (let's say) Medium quality JPEG, maximum dimension 600px. Three of the exported files will be between 100K and 150K on disk. The fourth one will be 2.4MB to 3.5MB. (!!!)


This is fully repeatable in that the same original photos will always cause the super-ginormous JPEG files to be created. Fiddling with the quality of the exported JPEG has minimal effect -- the super-ginormous JPEG files will be a teeny bit larger with higher quality, and a teeny bit smaller with lower quality, but still super-ginormous.


If I export one of these same problematic photos as a PNG, the PNG file will be a sensible size (350-450K). So the problem only happens when exporting as JPEG.


If I import the original photo into Pixelmator and export as JPEG, the resulting file will be a sensible size. So the problem only happens in Photos.


I'm not sure how long this has been going on. Maybe it's a Big Sur problem, or a macOS 11.1 problem, or maybe it's been happening for longer and I just didn't notice until now. (That last possibility seems unlikely though.)


Has anyone else seen anything like this, or know any way to avoid it?



MacBook Pro with Touch Bar

Posted on Jan 30, 2021 4:47 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 31, 2021 11:58 AM

exiftool seems to show this 3.39 MB embedded metadata:


exiftool -a -G1 -s Music011321bg5.jpg

[MPImage2]      MPImage2                        : (Binary data 3392509 bytes, use -b option to extract)


Just rebuilding metadata in GraphicConverter or exiftool clears that and sets file size to 75 kB:


exiftool -all= -tagsfromfile @ -all:all -unsafe -icc_profile Music011321bg5.jpg


This command extracts the attached 3392509 bytes image:


exiftool Music011321bg5.jpg -b -MPImage2 > a_depth.jpg



Similar questions

15 replies
Question marked as Top-ranking reply

Jan 31, 2021 11:58 AM in response to JRibbit

exiftool seems to show this 3.39 MB embedded metadata:


exiftool -a -G1 -s Music011321bg5.jpg

[MPImage2]      MPImage2                        : (Binary data 3392509 bytes, use -b option to extract)


Just rebuilding metadata in GraphicConverter or exiftool clears that and sets file size to 75 kB:


exiftool -all= -tagsfromfile @ -all:all -unsafe -icc_profile Music011321bg5.jpg


This command extracts the attached 3392509 bytes image:


exiftool Music011321bg5.jpg -b -MPImage2 > a_depth.jpg



Jan 31, 2021 10:17 AM in response to Matti Haveri

I think I'm missing your point. Exporting the unmodified original does what it's supposed to do, but if I then re-import the exported original, and then export that as a JPEG, the problem is still there.


The workflow is:

  1. Take photos with built-in camera app on iPhone 11 Pro (most or maybe all of the problematic ones are using Portrait mode, as are most of the unproblematic ones).
  2. Import from iPhone 11 Pro directly into Photos
  3. Export from Photos as 600px max dimension medium quality JPEG. (Other dimensions and qualities behave the same though.)


Here's an example.


This photo is 600x450px but 3.5MB on disk:

https://www.peaceofminddogrescue.org/images/dogs/Music011321bg5.jpg


This very similar photo taken a few minutes earlier is 600x450px but 145KB on disk:

https://www.peaceofminddogrescue.org/images/dogs/Music011321bg4.jpg


My best current guess is that there is some huge block of metadata -- perhaps an extra copy of the original full-sized image? -- that is preserved when importing/exporting as JPEG with Photos, but is not preserved when importing/exporting as PNG with Photos, and is not preserved when importing/exporting as JPEG with Pixemator. This could be a bug in Photos, or it could be a bug in the iPhone 11 Pro camera software. But I have no direct evidence of this guess.

Jan 31, 2021 6:58 AM in response to TonyCollinet

Yes, I should have made this clearer. The super-ginormous files are in fact the requested size of 600x450px.


One more clue -- we've been using the same workflow for many years, and have a large set of images generated in the same way. Looking at the dates & sizes of those, this problem seems like it started recently, probably in early January 2021. So it's looking suspiciously like a Big Sur (or maybe post-Big Sur) regression.

Jan 31, 2021 7:58 AM in response to Matti Haveri

Thanks Matti. Exporting the original photos doesn't change anything -- re-importing and exporting again at the desired dimensions continues to show the problem. In fact, re-importing the scaled-down ginomormous-on-disk image and exporting it again at any dimensions continues to show the problem. It's like there's some gigantic metadata, way bigger than the actual image, embedded in the image in a way that survives importing and exporting from Photos (but only when exported as JPEG).


I do have sample images taken moments apart of the same subject with different backgrounds for which one of them shows the problem and the other one doesn't. But I haven't been able to figure out any interesting difference between them.

Jan 31, 2021 10:33 AM in response to léonie

Thanks léonie! I checked that just now, and the exported JPEGs do not appear to be Portrait Mode photos anymore -- when I reimport them, they don't show the "PORTRAIT" badge, and they don't appear in Albums > Media Types > Portrait.


However, I did find a clue just now that seems related. I used exifinfo.org to examine and compare the metadata in the two images I linked above. A very suspicious difference is this:


In the section called MPF ("Multi-Picture Format"), the value of MP Image Length for the normal-sized file is 41455, whereas the value of MP Image Length for the giant-sized file is 3392509.


I'm guessing this has to do with Portrait mode storing multiple photos from the different lenses. Then there is a bug in Photos where scaling down the output JPEG sometimes fails to scale down this multiple-photo-metadata to match. (Maybe the metadata should have been discarded entirely, but it is present in the non-troublesome case as well as in the troublesome case.)

Jan 31, 2021 11:15 AM in response to Matti Haveri

Thanks Matti. I'll do some more investigating as to where the two images start to differ in metadata size (original HEIC photos? full-size JPEGs? scaled JPEGs?), but it does seem clear now that the problem is caused by very large Portrait-mode-related metadata.


I'll probably end up working around it by stripping the metadata post-hoc somehow, but maybe I can narrow down the problem enough to report something useful to Apple.

Jan 31, 2021 2:15 PM in response to Matti Haveri

Thanks for the additional sleuthing Matti! I have now verified that the MPF metadata is the same size in the exported JPEG for a given photo regardless of the dimensions of the JPEG. So the difference between the images that end up as giant JPEGs and the images that don't seems to be inherent to the original MPF metadata that's part of Portrait mode pictures -- for some reason, some images have metadata that is just way larger than others, even though the images look superficially similar. Perhaps this should be considered a bug in the image generation on the iPhone, or perhaps this is "working as expected" in some mysterious image-processing-innards way.


It seems clear that I need to add a step to this organization's workflow that clears the image metadata before we upload to the server, to avoid way-excessive website bandwidth troubles.


Thanks to everyone who chimed in!

Exporting certain photos as JPEG results in way-too-large disk files

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.