Hi there!
 
I have some script that creates a new image with ImageNew and performs a 
few tasks. I'd like to output it without having to save it to disk.  On 
another application on another server I was able to use <cfcontent 
type="image/jpeg"> to output an image read in as either a binary file 
with <cffile action="readbinary"> or blob data retrieved from a database.  
I am trying to output similarly in this case, but I can't seem to turn my 
ImageNew img into binary.
 
Here is exactly how I'm creating the image right now...
 

> <cffile action="READBINARY" file="#ExpandPath( 'originals/img1of2.jpg')#" 
> variable="binImg1" />
> <cfset img1 = ImageNew(binImg1)>
>
> <cffile action="READBINARY" file="#ExpandPath( 'originals/img1of2.jpg')#" 
> variable="binImg2" />
> <cfset img2 = ImageNew(binImg2)>
>
> <cfset w = MAX(img1.width, img2.width)>
> <cfset h = img1.height + img2.height>
> <cfscript>
>  imgFinal = ImageNew();
>  ImageResize(imgFinal, w, h);
> </cfscript>
>
> <cfset ImagePaste(imgFinal, img1, 0, 0)>
> <cfset ImagePaste(imgFinal, img2, 0, img1.height)>
>
 
A Google search recommended <cfcontent type="image/jpeg" 
variable="#ToBinary(ToBase64(imgFinal))#">, but this gives me a "data not 
supported" error.  I have of course also tried "#ToBinary(imgFinal)#" and 
just "#imgFinal#".
 
I'm not sure if this is related or not, but on our other server I 
mentioned, when I simply read in an img with <cffile action="readbinary"> 
and then use <cfcontent type="image/jpeg">, I see the image when I call the 
page.  But the same code on THIS server displays a bunch of garbled 
characters and boxes.
 
I should also mention that my ultimate end-goal is just to have a function 
that can take two image file paths and return a virtual combined image, and 
I know the normal way to handle this would be with a CFC that just returns 
the image, but I have yet to solve my other issue on this board regarding 
remote CFCs not being accessible.
 
- Matt C
 
 

-- 
-- 
online documentation: http://openbd.org/manual/
 http://groups.google.com/group/openbd?hl=en

--- 
You received this message because you are subscribed to the Google Groups "Open 
BlueDragon" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to