LiveCode - Import Tiff

Terry Judd tsj at unimelb.edu.au
Thu Apr 7 00:52:38 EDT 2011


If you're on a Mac you can script Image Events to convert the file from TIFF
to PNG (or whatever) for you first.

Here's a script I used to convert .icn files to .png files that would
probably work just as well (with only minor modification) for TIFFs

FUNCTION createFileFromIcon pSourceIconPath, pDestFilePath, pIconSize,
pReturnImageData
   IF not (there is a file pDestFilePath) THEN
      put empty into url ("file:"&pDestFilePath)
      IF not (there is a file pDestFilePath) THEN
         return "Error: couldn't create output file"
      END IF
   END IF
   put revMacFromUnixPath(pSourceIconPath) into pSourceIconPath
   put revMacFromUnixPath(pDestFilePath) into pDestFilePath
   put "tell application 'Image Events'" &cr&\
   "launch" &cr&\
   "set theIcon to open file '[[pSourceIconPath]]'" &cr&\
   "scale theIcon to size [[pIconSize]]" &cr&\
   "save theIcon as PNG in file '[[pDestFilePath]]' without icon" &cr&\
   "close theIcon" &cr&\
   "end tell" into tScript
   put merge(tScript) into tScript
   replace "'" WITH quote in tScript
   do tScript as AppleScript
   put revUnixFromMacPath(pDestFilePath) into pDestFilePath
   IF pReturnImageData THEN
      IF there is a file pDestFilePath THEN
         put url ("binfile:"&pDestFilePath) into tImageData
         return tImageData
      ELSE
         return "Error: couldn't create output file"
      END IF
   ELSE
      return the result
   END IF
END createFileFromIcon

Regards,

Terry...


On 7/04/11 11:50 AM, "Sivakatirswami" <katir at hindu.org> wrote:

> 
>   I suppose this is very old ground and it's "just not going to happen."
> 
> but I hit a wall today because LiveCode cannot import TIFF files.
> 
> (big project of scans... most scanners default to .tiff format)
> 
> I could not even find a feature request in the QA center.
> 
> Did anyone do an external for tiff import?
> 
> Sivakatirswami
> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 

--
Dr Terry Judd | Senior Lecturer in Medical Education
Medical Education Unit
Melbourne Medical School
The University of Melbourne







More information about the Use-livecode mailing list