Hi, this is what I want to accomplish running on iOS:
1- rotate an image
2- save it to the camera roll
Please help me identify what´s wrong with the code below . I would expect a left pointed arrow (the rotated image) to be saved to the camera roll but I'm getting the original picture...
on mouseUp
set the angle of image "Img1" to the angle of image "Img1" + 90
put the long ID of image "Img1" into tImageID
mobileExportImageToAlbum tImageID
answer the result
end mouseUp
One could also take a quick look into the dictionary, which often gives the missing informations!
From the entry about "angle":
...
Unlike the rotate command, the angle property affects only the screen display of the image, not the actual picture data in it.
Changing an image's angle does not change the imageData of the image.
...
Changing an image's angle does not change the imageData of the image
Err, imageData is actually changed. ImageData is what is rendered on screen. That is why you can make changes to an image like changing the dimensions of an image or angle make permanent by doing
set the imageData of image "myImage" to the imageData of image "myImage"
Which sounds a bit nonsensical but it is the way to make those temporary changes to an image stick.
I am not quite sure but it seems by doing that (setting imageData to imageData) the image looses some specific format information necessare for PNG or JPG. The way to restore that information to make it a fullblown PNG or JPG is to use export image --- as PNG or JPEG, or just do a snapshot in the format you want.
Simon could you please use more descriptive headlines for your postings. Otherwise the whole discussion is unlikely to be of use to someone searching the forum.
"What's wrong with this" is not very specific. Although I ask exactly that same question myself all day when coding...