Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Conserve disk space option.  (Read 4588 times)

0 Members and 1 Guest are viewing this topic.

boii

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 65
Conserve disk space option.
« on: January 20, 2005, 05:49:14 pm »

it'd be great if coppermine had a feature to conserve disk space.
essentially right now coppermine takes an image, keeps the original size, and on top of it creates two more fiels (thumb+mid).
once you get a gallery with a lot of pictures, it starts to add up in disk space.

i use this gd resize on the fly script:

thumbnail.php
Code: [Select]
<?php
   define
(thumbnailWidth"158");
   
header("Content-type: image/jpeg");
   
$filename $HTTP_GET_VARS["filename"];     
   
$source imagecreatefromjpeg($filename); 
   
$thumbX thumbnailWidth;   
   
$imageX imagesx($source);
   
$imageY imagesy($source);   
   
$thumbY = (int)(($thumbX*$imageY) / $imageX );       
   
$dest  imagecreatetruecolor($thumbX$thumbY);
   
imagecopyresampled ($dest$source0000$thumbX$thumbY$imageX$imageY);       
   
imagejpeg($dest);
   
imagedestroy($dest);
   
imagedestroy($source);
?>

and then call images by thumbnail.php?filename=blah.jpg

essentially it only need the original. and on the fly resizes (creates, displays, destroys) and preserves ratio using the defined width (which you could pull from config).

anyone think it'd be a nice option in coppermine?


Logged

Nibbler

  • Guest
Re: Conserve disk space option.
« Reply #1 on: January 20, 2005, 06:28:26 pm »

Ouch, poor server.
Logged

boii

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 65
Re: Conserve disk space option.
« Reply #2 on: January 20, 2005, 07:40:59 pm »

Ouch, poor server.

yeah, it is a bit of a performance hit.
but it saves a buckload of disk space.

depends on yoru layout etc, its still feasible.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Conserve disk space option.
« Reply #3 on: January 20, 2005, 10:06:33 pm »

1.4 has a config switch that automatically resizes images that are larger than the max allowed.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Conserve disk space option.
« Reply #4 on: January 21, 2005, 09:10:55 am »

hehe i think the owner of the server where i host my gallery would not be pleased if i used this. But then again unlimited space does not need such a script. Could be usefull for people with small amounts of webspace but it does create higher stresslevels for any server.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Conserve disk space option.
« Reply #5 on: January 21, 2005, 03:33:45 pm »

thumbnails don't eat that much space - it's the full sized pics that are hardly ever viewed on most setups that eat up most webspace, so the "on the fly" resize kegobeer was refering to will be a big plus.
Webhosts would hate us if we applied your hack to the core code, and would even ban coppermine from their servers, so I suggest you post your mod (with more details how to apply it for newbies) here and we'll move it to the mods section, along with a warning that this script can have a severe impact on the server performance.

Joachim
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.