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: I don't use the intermediate pictures anymore.  (Read 5343 times)

0 Members and 1 Guest are viewing this topic.

Getintothegame

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
I don't use the intermediate pictures anymore.
« on: January 12, 2005, 06:57:10 am »

I don't use the intermediate pictures anymore. How can I delete them to gain disk space?

This is missing from the FAQ. I would like to know, since I need more space and the smaller pics do fine.
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: I don't use the intermediate pictures anymore.
« Reply #1 on: January 12, 2005, 07:37:16 am »

Are you sure that you don't use intermediate pics? The picture displayed when you click on thumbnail is the intermediate picture, so if you delete it, there will be problems. Intermediate pics are the ones which are shown on displayimage.php file.

However if you are sure about it then the intermediate pics are stored in albums/userpics/ directory. All the files that start with normal_ prefix are the intermediate pics. But before deleting them think twice and be sure. DO NOT delete files which DONT start with normal_ prefix
Logged
Chief Geek at Ranium Systems

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: I don't use the intermediate pictures anymore.
« Reply #2 on: January 12, 2005, 12:48:56 pm »

In your config settings, turn off Create intermediate pictures and increase Max width or height of an intermediate picture/video to a value higher than your largest dimension picture.  Then use the admin tools: Update thumbs and/or resized photos (1), both thumbnails and resized pictures and do each album you have.

After you do that, use your FTP program to see if the normal_ pictures are gone.  If not, it will be safe to delete them via FTP.
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

Getintothegame

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: I don't use the intermediate pictures anymore.
« Reply #3 on: January 13, 2005, 06:09:34 am »

You're right, I didn't mean intermediate pictures. I meant the ones that are first uploaded to the server. I like the smaller pictures that coppermine makes, since a lot of the pictures are huge and never viewed.

How do I make it so when I click on an image that it will not go to the hugest one originally uploaded?
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: I don't use the intermediate pictures anymore.
« Reply #4 on: January 13, 2005, 06:48:55 am »

I don't know whether the solution which i am proposing here is good or not. If anyone else has a better solution then they are most welcome to post it.

For disabling the users to go to the original full size picture you will need to change displayimage.php file. First make a backup of displayimage.php
In displayimage.php replace this code (somewhere around line 185)

Code: [Select]
        if (isset($image_size['reduced'])) {
            $winsizeX = $CURRENT_PIC_DATA['pwidth'] + 16;
            $winsizeY = $CURRENT_PIC_DATA['pheight'] + 16;
            $pic_html = "<a href=\"javascript:;\" onClick=\"MM_openBrWindow('displayimage.php?pid=$pid&fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
            $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            $pic_html .= "</a>\n";
        } else {
            $pic_html = "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" /><br />\n";
        }

with
Code: [Select]
$pic_html = "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" /><br />\n";

By doing this the link on the intermediate picture to show full size image will go away.

For not uploading the original full size image and only uploading the thumbnails and intermediate pics you will have to make a lot of changes in the code. Easy way would be to manually delete the full size images after uploading them. For this delete the files which DON'T start with thumb_ or normal_ prefixes in albums/userpics directory. Be carefull in doing so.
Logged
Chief Geek at Ranium Systems

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: I don't use the intermediate pictures anymore.
« Reply #5 on: January 13, 2005, 01:21:04 pm »

The devel code has an auto resize function built in - you set the max width/height and turn on the function.  During the upload process, the original image is uploaded, checked for size, then resized is necessary.  You still have thumb_, normal_, and original images though.

I always recommend resizing your images before uploading them.  There are a number of free utilities you can use.  I resize all my images to 640x480, then upload them.  Keeps file sizes under about 80k, and my users don't have to wait while huge pictures load.

If you resize first, then turn off intermediate pictures, you'll have two images: thumb_ and the original.  Click on the thumbnail, and the original image is displayed - no popup.  Not much you can do about the pictures already uploaded, other than upload resized versions, then use the admin utils to create new thumbs and intermediate pictures.
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

benanna

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 2
    • The Ben and Leanna Webspace
further information
« Reply #6 on: January 20, 2005, 06:10:48 pm »

I am trying to do something similar.  I would like to use the intermediate "normalized" images and delete the original, larger images.  That way my users can upload any image without worring about resizing it, and I can delete the original files so it won't eat up disk space.

I tried Abbas Ali's hack above, and it does eliminate the link to the original file for those that have an intermediate image.  However, you can't simply go through the directory and delete all files that do not start with "thumb_" and "normal_".  The reason is that if your original files is smaller than the standard size for intermediate images, an intermediate image is not created, and Coppermine simply displays the original image instead of an intermediate image.

It's even more complicated than that, because I have an original image that is right on the borderline for size, and Coppermine actually created a "normal_" file for that image, but it does not display it.

A suggestion for a future version of Coppermine would be to create an intermediate or "normalized" image file for every image that is uploaded, and then automatically delete the original image.  That way all my image files will be the same size (the purpose of the intermediate image) and my users do not need to worry about resizing the images ahead of time to save disk space.  Does anyone have any ideas on how to do this with the current version (1.3.2)?


By the way, I don't know if anyone is interested or not, but if anyone wants to look into the intermediate image anomally that I described above, here are the details so you can reproduce it.
Image:   http://www.benandleanna.com/eagle/eagle_takeoff.jpg
Settings:   Method for resizing:   Image Magick
               Quality of JPEG files:    75
               Use dimension:   Height
               Max [height] of an intermediate picture:  400
When I upload this picture with these settings, an intermediate file is created (normal_eagle_takeoff.jpg), but when the picture is displayed in "displayimage.php" the original file (eagle_takeoff.jpg) is shown.  Please let me know if you need any more information.  Thank you.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: I don't use the intermediate pictures anymore.
« Reply #7 on: January 20, 2005, 10:04:57 pm »

1.3.2 comes with Admin Tools, which allows you to replace the original image with the resized image.

1.4 has a config switch that automatically resizes pictures over the max dimensions to 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

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: I don't use the intermediate pictures anymore.
« Reply #8 on: January 21, 2005, 07:04:30 am »

Does anyone have any ideas on how to do this with the current version (1.3.2)?

This will require a hack and can be done (Dont know if somebody has already done it).
Logged
Chief Geek at Ranium Systems

Nibbler

  • Guest
Re: I don't use the intermediate pictures anymore.
« Reply #9 on: January 21, 2005, 11:22:33 am »

You can backport the admin tools page from dev branch. All that needs doing is replacing cpg_db_query() with db_query(), removing the help icon, and adding the extra language vars.
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 21 queries.