Repeated use of Crop Image causes crash to desktop
Posted: Fri Jul 10, 2015 3:00 pm
Windows 7 & Livecode 7.0.6
I'm working on a project which takes a large image (7mb jpg), and chops it up into 9 smaller images.
To replicate the problem that I am experiencing I created a stack with one card. One the one card is the 7mb image, named "OrigImage". Also on the card is a button containing the following code -
Local muImageRef, gsNewImageName, gsDataImg
on mouseUp
Repeat with muImageRef = 1 to 9
Copy image "OrigImage" to this card
Set the name of the last image to "ImageCopy"
Crop image "ImageCopy" to 1000, 1000, 2500, 2500
Put "ImageV" & muImageRef & ".jpg" into gsNewImageName
put the text of image "ImageCopy" into gsDataImg
put gsDataImg into url("binfile:" & gsNewImageName)
Delete image "ImageCopy"
end Repeat
end mouseUp
When I click on the button, livecode carries out between 1 and 3 iterations of the repeat loop (it varies each time) then crashes to desktop with no error message.
If I comment out the crop command - then Livecode finishes all 9 iterations.
I've tried running this with Windows Task Manager on. Livecode fills up progressively more and more memory, and crashes after it has consumed about 1Gb.
Is this known, and is there a work around? I suspect that what I'm looking for is a way to get Livecode to release whatever memory it has used on a Crop operation, before starting the next Crop operation.
Thanks in advance
I'm working on a project which takes a large image (7mb jpg), and chops it up into 9 smaller images.
To replicate the problem that I am experiencing I created a stack with one card. One the one card is the 7mb image, named "OrigImage". Also on the card is a button containing the following code -
Local muImageRef, gsNewImageName, gsDataImg
on mouseUp
Repeat with muImageRef = 1 to 9
Copy image "OrigImage" to this card
Set the name of the last image to "ImageCopy"
Crop image "ImageCopy" to 1000, 1000, 2500, 2500
Put "ImageV" & muImageRef & ".jpg" into gsNewImageName
put the text of image "ImageCopy" into gsDataImg
put gsDataImg into url("binfile:" & gsNewImageName)
Delete image "ImageCopy"
end Repeat
end mouseUp
When I click on the button, livecode carries out between 1 and 3 iterations of the repeat loop (it varies each time) then crashes to desktop with no error message.
If I comment out the crop command - then Livecode finishes all 9 iterations.
I've tried running this with Windows Task Manager on. Livecode fills up progressively more and more memory, and crashes after it has consumed about 1Gb.
Is this known, and is there a work around? I suspect that what I'm looking for is a way to get Livecode to release whatever memory it has used on a Crop operation, before starting the next Crop operation.
Thanks in advance