Copy link to clipboard
Copied
Hello, everyone.
I've got the CFIMAGE action="writeToBrowser" working, now I just have one more question in regards to this particular project.
How do I resize the image?
Here is what I have, so far:
<cfinvoke component="components.announce" method="getFile" returnvariable="getFile">
<cfinvokeargument name="docID" value="#qry.DocumentID#">
</cfinvoke>
<p><div style="float:left;"><cfimage action="writeToBrowser" source="#getFile#"></div>#some text#</p>
The image is 290x160, and I'd like to scale it down, a bit. How could I do that?
Thank you,
^_^
Have you tried the ImageResize function?
Copy link to clipboard
Copied
Doesn't cfimage allow you to resize as well?
Copy link to clipboard
Copied
I've been looking at the documentation for CFIMAGE and I'm not seeing it for files created via BLOB. I think you can use ImageNew() for files that exist on the web server, but I tried that with a BLOB file, and it isn't working.
Thank you,
^_^
Copy link to clipboard
Copied
Have you tried the ImageResize function?
Copy link to clipboard
Copied
I had to toy with it, and I didn't really understand it, at first. But, here is what worked:
<cfset tmp = ImageNew("#getFile#")>
<cfset ImageResize(tmp,"100","")>
<cfimage action="writeToBrowser" source="#tmp#">
Thanks, again, Miguel.
^_^