some image files won't insert into keynote

This simple script works for some image files and not for others and I can’t figure out why:

tell application "Keynote"
	tell document 1
		tell current slide
			make new image with properties {file:"Macintosh HD:Users:karstenkamps:GESCHÄFT:IT:Automatisierung:Bilder:Google Slides:2 Makrolage.png"}
		end tell
	end tell
end tell

I’ve tried .jpg files, other .png files. I have one png file that works. The error message I get is (translated from German):

“not supported object/file” in English I suppose.

The files are simple screenshots or sometimes larger image files. They all work manually with cut and paste. If an image is larger than the size of the slide, it works manually. If the image is smaller than the siez of the slide, it works with that one file but not with the others.

My keynote version is the newest, 9.2.

Anyone any idea?

Are you sure that the file is really a png one?

Run the script :

set thefile to "Macintosh HD:Users:karstenkamps:GESCHÄFT:IT:Automatisierung:Bilder:Google Slides:2 Makrolage.png" as «class furl»
set signature to read thefile from 2 for 3

display dialog "the file is flagged as : " & signature & " one."

If it’s a png you will read : “the file is flagged as : PNG one.”

I encountered some files whose extension was png but which were a sit version of the image.

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) lundi 14 octobre 2019 11:07:48