Hi all! I’ve been having this issue where when I load an image from a web request and then save it using the FileManager’s writeImage function, the image that is written has a file size that is much larger than it should be, would someone mind taking a look at my code and seeing if I’m doing something incorrect or if they have similar issues? I noticed that this issue only occurs while using the FileManager’s writeImage function (as opposed to, for example, the Photos.save() function). Any help would be greatly appreciated, as the file sizes are a huge memory suck! I also attached a screenshot showing the size of the file in the directory (I’m using a file bookmark leading to a folder in my iCloud directory). Also, the link to the original file is https://commons.wikimedia.org/wiki/File:Helianthus_decapetalus_‘Plenus’.jpg Please let me know if any other info is needed!
const imLink = 'https://upload.wikimedia.org/wikipedia/commons/c/c1/Helianthus_decapetalus_%27Plenus%27.jpg'
var req = new Request(imLink);
var exImage = await req.loadImage();
var fm = FileManager.iCloud();
var path = fm.bookmarkedPath('example');
var path = `${path}/sunflower.jpeg`;
console.log(`Save Directory = ${path}`);
fm.writeImage(path, exImage);
Script.complete();
(Screenshot of file in iCloud Directory)