I received a new set of files.
The original file is :
4000 x 6000 pixels, 72 DPIs,
file size reported by Preview: 3,203,298 bytes,
file size reported by Finder: 3,203,298 bytes,
no resource fork.
your treated file:
53 x 80pixels, 72 DPIs,
file size reported by Preview : 2535 bytes
file size reported by Finder : 745,102 bytes
resource fork : $B54A7 bytes (the icons data)
my treated file:
53 x 80pixels, 72 DPIs,
file size reported by Preview : 2535 bytes
file size reported by Finder : 2535 bytes
no resource fork.
With these infos, things become more clear.
(1) When the inspector of Preview display a “file size”, it’s the size of the data fork component, not the size of the complete file.
(2) The data fork is the same in your treated file and in mine.
So, now, I know that the Image Events resizing task is correctly achieved on both machines.
It would be fine to know what is the size reported by the Finder if you apply this edited version:
on open draggeditems
tell application "Image Events" to launch
repeat with currentFile in draggeditems
tell application "Image Events"
set openedFile to open file (currentFile as string)
scale openedFile to size 80 --<<<< here we define the wanted greater dimension
save openedFile -- with icon -- <<<< don't ask for an icon
close openedFile
end tell
end repeat
end open
In theory you would get:
53 x 80pixels, 72 DPIs,
file size reported by Preview : 2535 bytes
file size reported by Finder : 2535 bytes
no resource fork.
Now, the question is : why am’I not getting the resource fork describing the icons on my side ?
I will try to find what explain this behavior.
Maybe it’s due to the fact that, on my machine, the Finder is set to display icons built on the fly according to the data fork content.
In the pane allowing us to rule the display of windows, the lower checkbox entitled :
“Show icon preview” is checked.
I will search if there is, somewhere, a preference preventing the system to create the resource fork supposed to store the icon.
At least, I’m reassured, the script actually works properly.
Of course, if somebody has an idea explaining why it doesn’t create the resource fork on my machine, I’m all ears.
I’m a little bored to discover that the “surprising” behavior was not on your machine but on mine.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) jeudi 28 mai 2020 11:09:26