Copy link to clipboard
Copied
Is there a way in ColdFusion to resize images to a specific size and show them in browser, without a need to store the resized images in folder. So the concept is only storing the original image file and show the other (resized) images without storing any where in the server.
Any help!!
Have a look at the cfimage documentation - ColdFusion Help | cfimage
If gives an exact example of what you need.
writeToBrowser action Use the writeToBrowseraction to display one or more ColdFusion images directly to the browser without writing them to files. Images are displayed in PNG format. The following example shows how to reduce the size of an image and display it in the browser:
...
<!--- This example shows how to create a ColdFusion image from a JPEG file, resize it, and
then display it in the
Copy link to clipboard
Copied
Have a look at the cfimage documentation - ColdFusion Help | cfimage
If gives an exact example of what you need.
writeToBrowser action Use the writeToBrowseraction to display one or more ColdFusion images directly to the browser without writing them to files. Images are displayed in PNG format. The following example shows how to reduce the size of an image and display it in the browser:
<!--- This example shows how to create a ColdFusion image from a JPEG file, resize it, and
then display it in the browser as a PNG image. --->
<
cfimage
source=
"../cfdocs/images/artgallery/jeff05.jpg"
action=
"resize"
width=
"50%"
height=
"50%"
name=
"smLogo"
>
<
cfimage
source=
"#smLogo#"
action=
"writeToBrowser"
>
Copy link to clipboard
Copied
That worked for me !!
Resize and show in browser without a need to save in folder, but it will get stored in a temp folder like this CFFileServlet/_cf_image if so it will consume more space?
Copy link to clipboard
Copied
It wont consume much space as its only a temporary place. The image will be there for a short time (around 5 mins) then disappear.
Copy link to clipboard
Copied
Many thanks