Sannyasin Sorry i should have been more explanatory there..something like this(this all assumes the picture does load in the record)
$Path:=System folder(Documents folder) $Path:=$Path+"Pictures" If (Test path name($Path)#Is a folder) CREATE FOLDER($Path) End if $OutPath:=$path+Folder separator+"Converted_Pictures" If (Test path name($OutPath)#Is a folder) CREATE FOLDER($OutPath) End if $OutPath:=$OutPath+Folder separator ALL RECORDS([TABLE]) PICTURE CODEC LIST($Codecs;$Names) For ($i;1;Records in selection([TABLE])) If (Picture size([TABLE]Picture_pic)>0) $_t_DocName:=[TABLE]RECORDIDSTRING PICTURE TO BLOB([TABLE]Picture_pic;$_aPicBlob;".jpg”)<-if this does not work try something else $doc:=Create document($Path+Folder separator+$_t_DocName+".jpg") CLOSE DOCUMENT($doc) BLOB TO DOCUMENT($Path+Folder separator+$_t_DocName+".jpg";$_aPicBlob) $PosixPath:=Convert path system to POSIX($Path+Folder separator+$_t_DocName+".jpg") $OutPosixPath:=Convert path system to POSIX($OutPath+$_t_DocName+".png") $_t_Script:="sips -s format png "+$PosixPath+" --out "+$OutPosixPath LAUNCH EXTERNAL PROCESS($_t_Script) end if //here you would get the image from the new document back into the record if that is what you are planning to do NEXT RECORD([TABLE]) End for I cant say if that will be any better-but if this will convert the picture(or even just export it in JPEG format) then you can open the image in preview and if it is loading there can then bring the JPEG back into the record. > On 7 Feb 2017, at 09:36, Nigel Greenlee <[email protected]> wrote: > > Sannyasin > > Hi-if you having trouble with 4D crashing it you might consider exporting the > picture in the what ever format it currently is and then using LEP to call > the command line to convert it to a JPG, then you can re-import the new > picture. > > https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/sips.1.html > > <https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/sips.1.html> > > Nigel Greenlee > > > >> On 6 Feb 2017, at 22:02, Sannyasin Siddhanathaswami <[email protected]> wrote: >> >> Aloha, >> >> We are starting the preparations for v16, and dealing with the picture >> issues. Let’s just say we have tons of ancient photos in our database! We >> are currently using v15.3 on a Mac (server - client). >> >> Basically, we are trying to convert all pictures to jpg. Unfortunately, >> doing this crashed 4D: >> CONVERT PICTURE([Members]Picture;".jpg";0.8) >> >> Even putting the picture field into a variable before converting crashes >> during the “Convert Picture.” It’s not all picture, just many of them. By >> crash, the 4D.app just quits to the desktop with a crash report. >> >> I can view these pictures just fine in an input form. If I copy the picture >> out of the input form, into another app, then back in, the conversion works >> fine. >> >> Anyone have any tips on how to approach this? If I run the method to execute >> on server, the whole server crashes… >> >> Thanks, >> >> >> Sannyasin Siddhanathaswami >> ********************************************************************** >> 4D Internet Users Group (4D iNUG) >> FAQ: http://lists.4d.com/faqnug.html >> Archive: http://lists.4d.com/archives.html >> Options: http://lists.4d.com/mailman/options/4d_tech >> Unsub: mailto:[email protected] >> ********************************************************************** > > ********************************************************************** > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:[email protected] > ********************************************************************** ********************************************************************** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

