|
From: creedon <icr...@us...> - 2006-01-17 23:17:02
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7945 Modified Files: getJpegHeightWidth Log Message: do file delete in a try, on Mac OS X I've been getting some file busy errors when doing more than one f of type address in rapid succession, downside is that there will be files left over but that could be cleaned up by a maintenance script Index: getJpegHeightWidth =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/html/getJpegHeightWidth,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** getJpegHeightWidth 26 Mar 2005 19:42:58 -0000 1.1.1.1 --- getJpegHeightWidth 17 Jan 2006 23:16:53 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.verbs.builtins.html.getJpegHeightWidth ! on getJpegHeightWidth (f) { ÇGet the height and width in pixels of a JPEG. ÇChanges: Ç10/20/99; at 2:57:07 PM by PBS ÇLike html.getGifHeightWidth, it now supports addresses. It does still write the file out to disk, but in a temporary location, in Guest Databases/ops/Temporary Items/. After writing out the file, it deletes it. on kernelcall (f) { kernel (string.getJpegHeightWidth)}; if typeOf (f) == addressType { //write the file to disk in a temporary location local (tempFolder = Frontier.getSubFolder ("ops/Temporary Items/")); if not (file.exists (tempFolder)) { file.newFolder (tempFolder)}; local (tempFilePath = file.uniqueName ("tempJpeg", tempFolder, 7)); file.writeWholeFile (tempFilePath, f^, 'JPEG', user.html.prefs.imgFileCreator, clock.now ()); local (hwList); hwList = kernelcall (tempFilePath); file.delete (tempFilePath); return (hwList)}; return (kernelcall (f))}; Çbundle //test code Çdialog.alert (getJpegHeightWidth (@websites.samples.["#images"].wozJobs)) //test addresses Çdialog.alert (getJpegHeightWidth ("C:\\Frontier\\Websites\\samples\\images\\wozjobs.jpg")) //test files on Windows Çdialog.alert (getJpegHeightWidth ("Power HD:Frontier:Websites:samples:images:wozJobs.jpg")) //test files on Mac \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.verbs.builtins.html.getJpegHeightWidth ! on getJpegHeightWidth (f) { ÇChanges Ç1/15/06; 10:45:59 AM by TAC Çdo file delete in a try, on Mac OS X I've been getting some file busy errors when doing more than one f of type address in rapid succession, downside is that there will be files left over but that could be cleaned up by a maintenance script Ç10/20/99; at 2:57:07 PM by PBS ÇLike html.getGifHeightWidth, it now supports addresses. It does still write the file out to disk, but in a temporary location, in Guest Databases/ops/Temporary Items/. After writing out the file, it deletes it. ÇGet the height and width in pixels of a JPEG. on kernelcall (f) { kernel (string.getJpegHeightWidth)}; if typeOf (f) == addressType { //write the file to disk in a temporary location local (tempFolder = Frontier.getSubFolder ("ops/Temporary Items/")); if not (file.exists (tempFolder)) { file.newFolder (tempFolder)}; local (tempFilePath = file.uniqueName ("tempJpeg", tempFolder, 7)); file.writeWholeFile (tempFilePath, f^, 'JPEG', user.html.prefs.imgFileCreator, clock.now ()); local (hwList = kernelcall (tempFilePath)); try { file.delete (tempFilePath)}; return (hwList)}; return (kernelcall (f))}; Çbundle // testing Çdialog.alert (getJpegHeightWidth (@websites.samples.["#images"].wozJobs)) // testing addresses Çdialog.alert (getJpegHeightWidth ("C:\\Frontier\\Websites\\samples\\images\\wozjobs.jpg")) //test files on Windows Çdialog.alert (getJpegHeightWidth ("Power HD:Frontier:Websites:samples:images:wozJobs.jpg")) //test files on Mac \ No newline at end of file |