• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Image compression

Contributor ,
Nov 08, 2007 Nov 08, 2007

Copy link to clipboard

Copied


Dear all,

In CF 8, is there any function to compress an uploaded image so the size is smaller to display on browser? If I use cfzip, I cannot display it as jpg / gif, right?

Looking forward for your reply.

Thanks in advance
Keiko
TOPICS
Advanced techniques

Views

574

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 08, 2007 Nov 08, 2007

Copy link to clipboard

Copied

No. Images are already compressed. If you zip them, you run the risk of actually making them larger because of the zip overhead on an already compressed file. You don't zip a zip, in other words.

That said, there are some exceptions. Uncompressed jpegs or raw files as they come directly off your camera, for example. TIFs and BMPs can also be compressed. But you would be unlikely to be able to compress any file that's already been optimized for the web.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 08, 2007 Nov 08, 2007

Copy link to clipboard

Copied

do you mean 'compress' as in 'use a file compression utility on an image
file to reduce the amount of space it occupies on a disk',
or 'compress' as in 'resize an image file to smaller WxH pixel size',
or 'compress' as in 'resample an image file to lower dpi settings to
reduce its size in KB',
or 'compress' as in 'lower the quality of an image file to reduce its
size in KB'?

--

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Nov 08, 2007 Nov 08, 2007

Copy link to clipboard

Copied


Thanks ToBeNamedLater and Azadi for your replies.

Yes, 'compress' as in 'use a file compression utility (cf tag or cf function is preferred) on an image file to reduce the amount of space it occupies on a disk' so I can load faster on browser.

If the above tag/function does not exist, how about
1. 'compress' as in 'resample an image file to lower dpi settings to reduce its size in KB'
2. 'compress' as in 'lower the quality of an image file to reduce its size in KB'

The objective is to load the images faster on browser. If you google, there are quite number of products that offer compression. But can we do it from the coldfusion 8 itself?

Thanks in advance
Keiko

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 08, 2007 Nov 08, 2007

Copy link to clipboard

Copied

LATEST
Keiko wrote:
> The objective is to load the images faster on browser. If you google, there
> are quite number of products that offer compression. But can we do it from the
> coldfusion 8 itself?

cf 8's image handling bits can:
- thumbnail your images (reduce the image size)
- lower the quality of JPEG images

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation