Memory Leak on export png????

Dave dave at looktowindward.com
Fri Mar 16 13:25:19 EDT 2007


Hi All,

Please take a look at the handler copied below. This is an adaptation  
of Ian Wood's "export snapshot.rev" stack that can be downloaded from  
Rev Online.

I have changed in to use .png files instead of JPEG file, changed the  
counter rectangle graphic object to have an all green background (RGB  
= 0,255,0), I then select 500 iterations and press the "export from  
snapshot from object" button, this writes 288 files and then gives an  
execution error:

"export can't write to file, mask file or container  289.png"

  export snapshot from grp "counter" to file tDest as PNG

I also tried this without setting the background color and this does  
write all 500 files, but RunRev crashes  (unexpectedly quits) doing  
something unrelated a short while later. Also when this is running,  
the first 50 to 100 files go quite quickly but after that it starts  
to slow down.

Has anyone else seen this? I'm running on a Mac Pro, Mac OS 10.4.9  
RunRev 2.8.0.350.

I really need to get this to work correctly as I have do another demo  
next week and this is 90% of it!

Thanks a lot
All the Best
Dave


on doExport tType
   local tNum
   local twID
   local tFol
   local tDest

   put text of fld "number" into tNum
   put the windowID of this stack into twID
   put text of fld "export folder" into tFol
   if there is not a folder tFol then
     answer "Export folder not found!"
     exit to top
   end if
   set the defaultfolder to tFol

   repeat with x = 1 to tNum
     if the mouse is down then
       exit to top
     end if
     put x & ".png" into tDest

     --> do all your animation etc. here
     put x into fld "counter" of grp "counter"

     --> now export the file
     --> if using rev 2.7 and above you can use the 'object' syntax  
where the image will not be affected by other objects or windows on  
top of the object
     if tType is "object" then
       export snapshot from grp "counter" to file tDest as PNG
     end if

     --> If using Rev 2.6 or below, you will have to do use the older  
syntax and makes sure this is the frontmost window!
     if tType is "area" then
       export snapshot from rect (rect of grp "counter") of window  
twID to file tDest as PNG
     end if
   end repeat
   answer "Done!"
end doExport




More information about the use-livecode mailing list