Discussion:
How to get Image size
(too old to reply)
catchme_dileep
2009-02-19 06:27:12 UTC
Permalink
Hi All,

I would like to know how we find an image size(in bytes) using coldfusion.
is this possible with cfimage?

I have a folder with images and i have to get the size(in bytes) of each image
and in insert the size into table.

Please help
PaulH **AdobeCommunityExpert**
2009-02-19 06:53:02 UTC
Permalink
Post by catchme_dileep
I would like to know how we find an image size(in bytes) using coldfusion.
is this possible with cfimage?
are you looking for the file size? use cfDirectory.
catchme_dileep
2009-02-19 08:48:14 UTC
Permalink
No, i have to get image size using cfimage
Prashantgenial
2009-02-19 09:45:08 UTC
Permalink
Hi Dileep,

you can use the following code to get the size of your images.

is this what u are looking for ??

<cfdirectory action="list" directory="#ExpandPath('.')#" name="lstfiles"
filter="*.jpg">
<cfdump var="#lstfiles#">

TO get the size of image
<cfoutput query="lstFiles">
#lstFiles.size#<br>
</cfoutput>
PaulH **AdobeCommunityExpert**
2009-02-19 10:04:49 UTC
Permalink
Post by catchme_dileep
No, i have to get image size using cfimage
you mean the height & width? if so after you read in the image, use
imageGetHeight() & imageGetWidth() or imageInfo() or cfimage w/the "info" action
option.

if not, then explain what *you* think "image size" means.

Loading...