Using loadImage(), the downloaded image size is enormous

Hello, everyone :grin:
When I use Scriptable to download images, a picture that was originally 4 MB in size, the size of the downloaded image is 30 MB.
I wonder what the problem is?
If I use Shortcuts GET URL Content to download, the downloaded image is 4MB, which is the normal size.

Here is my code:

let arr = [

for (value of arr) {
  let imageName = value.split("/").at(-1);
  let req = new Request(value);
  let img = await req.loadImage();
  let fm = FileManager.iCloud();
  let path = fm.bookmarkedPath("Shortcuts") + "/images/" + imageName;
  fm.writeImage(path, img);

Thanx in Advance

I think there might me some conversion happening with loadImage. Try using req.load() and fm.write() instead.

1 Like

I had the same issue, so I made a shortcut to rescale first my images

1 Like