Posts

Post not yet marked as solved
1 Replies
569 Views
We have a process that takes high resolution source PNG/JPG images and creates renditions of these images in various lower resolution formats / cropped versions. This process works well and gets the results we want. We can re-run these functions on hundreds of images and get the same output every time. We then commit these files in git repos. HOWEVER, every time we update macOS to a new version (such as updating to High Sierra, Monterey, etc.) when we run these functions ALL of the images result in an output that is different and has different hashes so git treats these images as being changed even though the source images are identical. FURTHER, JPG images seem to have a different output when run on an Intel mac vs. an Apple M1 mac. We have checked the head of the output images using a command like: od -bc banner.png | head This results in the same head data in all cases even though the actual image data doesn't match after version changes. We've also checked CGImageSourceCopyPropertiesAtIndex such as: Source Code { ColorModel = RGB; Depth = 8; HasAlpha = 1; PixelHeight = 1080; PixelWidth = 1920; ProfileName = "Generic RGB Profile"; "{Exif}" = { PixelXDimension = 1920; PixelYDimension = 1080; }; "{PNG}" = { InterlaceType = 0; }; } Which do not show any differences between versions of macOS or Intel vs. M1. We don't want the hash to keep changing on us and resulting in extra churn in git and hoping for feedback that may help in us getting consistent output in all cases. Any tips are greatly appreciated. Source code is attached because it was too long to be inline.
Posted
by dmi1011.
Last updated
.