coppermine-gallery.com/forum

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: 13th-angel on February 24, 2004, 10:32:17 PM

Title: [fixed]: problem with resize tool.
Post by: 13th-angel on February 24, 2004, 10:32:17 PM
Hi there, this is my first post here.

Anywho, I am using Coppermine Photo Gallery 1.2.0 - RC2

and my problem is with the resize tool,

I recently uploaded a bunch of folder full of pics to the userpics directory, and then did a batch upload.  After all the files were uploaded I used the Resize picture utility and clicked on "Delete original sized pictures"

Now by this I thought it would delete the bigger versions and replace it with the resized ones, however when I go to check out the pictures, I can get the thumb nail but I can't see the actual resized medium picture.

I checked out the folders and the resizes are in there but it's like it's not redirecting the link to the pictures properly.  

anyway, heres a link to show you the problem

http://www.neo240sx.ca/coppermine/index.php

Im very new to this stuff!  Any help would be appriciated, thanks!

- Chris
Title: [fixed]: problem with resize tool.
Post by: Casper on February 24, 2004, 10:59:58 PM
I think the main reason for this is you have put your folders inside the userpics directory.  This is a no-no.  The userpics folder is for the use of coppermine only.  You should create your folders inside the albums folder, not in the albums/userpics.

You need to use coppermine to delete all the pics you put in the userpics folder (by ftp), then re-upload them into new directories.

also

Coppermine only creates intermediate size pics, if the full size is bigger than the intermediate setting.

On the pics I looked at, you have the thumb and the original still there, but no normal, ie, I could browse to;
albums/userpics/gallery/summer_2001/neomeet2k1-6.JPG
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.neo240sx.ca%2Fcoppermine%2Falbums%2Fuserpics%2Fgallery%2Fsummer_2001%2Fneomeet2k1-6.JPG&hash=590420401ddf59141c3ec851fcac22cab3188464)

and
albums/userpics/gallery/summer_2001/thumb_neomeet2k1-6.JPG
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.neo240sx.ca%2Fcoppermine%2Falbums%2Fuserpics%2Fgallery%2Fsummer_2001%2Fthumb_neomeet2k1-6.JPG&hash=d1f4a776146b8e5043860e1e977b6e43bd3b9e6f)

But not
albums/userpics/gallery/summer_2001/normal_neomeet2k1-6.JPG
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.neo240sx.ca%2Fcoppermine%2Falbums%2Fuserpics%2Fgallery%2Fsummer_2001%2Fnormal_neomeet2k1-6.JPG&hash=eca2cc5923e240e2236fbb207e129436eef1d128)
Title: [fixed]: problem with resize tool.
Post by: 13th-angel on February 24, 2004, 11:16:20 PM
is coppermine suppose to make a "normal_" prefix for the actual pictures it uses?

I was going to say that coppermine probably deleted those files by accident when I used the resize picture utility.

Also, when I do a batch add pictures the only directory I have to access my pictures from that I uploaded is the 'userpics' folder which lead me to believe that I had to upload my pics to the userpics directory in the first place.  

So if I upload pics via FTP and want to do a batch add pics then how do I change the directory it accesses to add pictures?
Title: [fixed]: problem with resize tool.
Post by: Casper on February 24, 2004, 11:30:04 PM
One thing that needs to be added to the instructions is clear instructions for uploading by ftp, as this often occurs.

You should create new directories in the cpg_directory/albums/ folder, and chmod them to 755 or 777 (whichever works on your server).

You can even just upload the images directly in the folders they are in on your pc, keeping your structure.  Remember to chmod.

Now, when you open batch add, you will see your folders there, as it shows all folders inside the albums folder.

The userpics folder is used by cpg to put the pics uploaded by members, and should not be touched by anyone.  The program takes care of it.


@GauGau, I have just spent some time looking through the current docs, faq and readme, and was unable to find instructions for uploading by ftp.  If they are there, they are not easy to find, and it is no surprise that several users, which includes me when I first started, ftp into the userpics folder.

I think we need to get an ammendment into the instructions in the download package asap.
Title: [fixed]: problem with resize tool.
Post by: 13th-angel on February 25, 2004, 12:30:15 AM
ok cool, thanks for your help.

Oh and one last question... how do you "reset" coppermine, like wipe it clean, I think a screwed up big time....  :(
Title: [fixed]: problem with resize tool.
Post by: Casper on February 25, 2004, 12:41:02 AM
Probably no need to do that.

Using the delete/edit pics facility, delete the albums that you have already put pics in, or delete all the pics within those albums.  You can leave any pics that were uploaded using the cpg upload, if you know which are which.

This should clear your database of all pic info, and remove the thumbs etc from the server.

Now ftp your pics as described before, into the albums/your_new_folders.

Now batch add.  should be done.
Title: [fixed]: problem with resize tool.
Post by: 13th-angel on February 25, 2004, 12:52:39 AM
I know thats the process I should have done to delete the pictures however.. I went in and did a recursive delete on all the folders I added in the 'userpics' folder and didn't delete them from the datebase so now I can't remove them from coppermine because it says:

CRITICAL ERROR

Directory 'albums/userpics/MCO 2k3 Winter Solo/' is not writable, pictures can't be deleted

since I cleared out the FTP files without removing them from the DB first..  

Im such an idiot...  :cry:
Title: [fixed]: problem with resize tool.
Post by: Casper on February 25, 2004, 01:10:56 AM
Oops.

oh well, I hope you have access to your database tool, such as phpMyAdmin.

You will have to use this to remove all the info from the pictures table.  If any of the pics had comments etc, you will also have to delete these entries.

then you should be able to carry on.

if not, for a clean install, use your ftp to delete the include/install.lock file, and then re-install.
Title: [fixed]: problem with resize tool.
Post by: 13th-angel on February 25, 2004, 11:53:13 AM
OK after redoing everything Im back to where I started, here is the issue.

Once I've done a batch add picture to the album I want I assume that it makes a 'normal_' file which is the resized version of the file I uploaded.

When I go to the "resize picture" section, I want to delete the original sized photo and replace it with the sized version that the forums makes (which I assume is the 'normal_' pics)

However what happens is that after it does that on the album I select, I go to view the file by clicking on the thumbnail the new resized version does not appear.

So it seems that it deletes the resized photos and originals OR it's not making those resized picture.

Im pretty sure the feature was made to delete the larger sized original files and keep the resized versions however mind doesn't seem to want to do that... or yet again, Im doing something really stupid...

This time the files are now under "coppermine/albums/upload" (upload is the folder I created. I moved all the files from the "userpics" to this new folder.
Title: [fixed]: problem with resize tool.
Post by: 13th-angel on February 26, 2004, 06:44:31 PM
BUMP!
Still need help with my previous question!

QuoteOK after redoing everything Im back to where I started, here is the issue.

Once I've done a batch add picture to the album I want I assume that it makes a 'normal_' file which is the resized version of the file I uploaded.

When I go to the "resize picture" section, I want to delete the original sized photo and replace it with the sized version that the forums makes (which I assume is the 'normal_' pics)

However what happens is that after it does that on the album I select, I go to view the file by clicking on the thumbnail the new resized version does not appear.

So it seems that it deletes the resized photos and originals OR it's not making those resized picture.

Im pretty sure the feature was made to delete the larger sized original files and keep the resized versions however mind doesn't seem to want to do that... or yet again, Im doing something really stupid...

This time the files are now under "coppermine/albums/upload" (upload is the folder I created. I moved all the files from the "userpics" to this new folder.
Title: [fixed]: problem with resize tool.
Post by: Casper on February 26, 2004, 08:17:01 PM
I just went to your site again, and most thumbs are not showing.  Looking at your source code, I see that they are still in the database as in the 'userpics' folder.

I think you need to clear your database of the 99 pics in the toronto motor show album, and start again.

As to your question about the batch add, when it deletes the original, it renames the smaller one as the original, ie, it takes off the 'normal_'.

This is normal.  Coppermine will put the original pic in the display, if no 'normal_' exists, but it needs the original(or one with that name) to work properly.
Title: Just installed, 2 quick questions
Post by: allisonv7 on February 26, 2004, 09:11:29 PM
1) I want to remove the full image size files, and I figured out how to do this, but I can't figure our how to remove the javascript link to the full size photo.  I tried a tip from another thread about replacing part of the displayimage.php file but when I do this I get error messages in my gallery.  Any other ideas?

2) I can't get the XP publish to work, when I open the file and click yes to approve a registry change I get an error saying that it's not a registry script and I can only import binary files into my registry.


Help :)


allison.
Title: [fixed]: problem with resize tool.
Post by: Casper on February 26, 2004, 09:38:36 PM
1.  If you use the resize pics utility to remove the original (the only way you should do it), the pop-up will not happen anyway, I beleive.

2.  Don't know the cause of this, but as the admin, you should use ftp to put pics up.  Remember to create folders (correctly chmod'd to 755 or 777) in the /albums folder, NOT the /albums/userpics folder.

And for the future, just one question per thread please  :wink:
Title: [fixed]: problem with resize tool.
Post by: allisonv7 on February 26, 2004, 10:24:03 PM
When I use the resize pic utility I lose all the files except for the thumbnails.  Why is this? shouldn't it just delete the original?


allison.
Title: [fixed]: problem with resize tool.
Post by: Casper on February 26, 2004, 10:42:36 PM
Have you made any changes to the code?
Title: [fixed]: problem with resize tool.
Post by: Casper on February 26, 2004, 10:56:08 PM
OK Allison,

This used to work fine, but I just tried it on my own site and it no longer works correctly.  I suspect that the 'normal_' images replaced the original, so they are there, with the original filename, but coppermine is not seeing them.

Now, what you need to do, is go back to the re-size pics tool, and use the first section, to rebuild the normal pics.  This will get your gallery working properly again, but you will have duplicate files (orig.jpg and normal_orig.jpg)
Title: [fixed]: problem with resize tool.
Post by: Casper on February 26, 2004, 11:05:57 PM
Hi Allison and 13th Angel,

I've merged these threads as they both deal with the same problem.

My apologies for taking a roundabout way of getting to this point  :oops: but I'm sure this used to work.

@GauGau/Tarique, as it has taken me a little while to realise here, when  the re-size utility is used to delete the original, coppermine can no longer display the re-named normal pic.  It is there, but coppermine is still looking for the 'normal_', and giving a little red X.
Title: [fixed]: problem with resize tool.
Post by: FreeMail on February 26, 2004, 11:53:18 PM
Quote from: "allisonv7"When I use the resize pic utility I lose all the files except for the thumbnails.  Why is this? shouldn't it just delete the original?


allison.


happened to me also. :(  i only upload via the web, and i noticed it doesn't happen  not to all files (missing normal size pics.)
Title: [fixed]: problem with resize tool.
Post by: Casper on February 27, 2004, 12:19:50 AM
I have a theory, which I need you all to answer a question.

Those who have this happen, what is your setting in config, for
QuoteUse dimension ( width or height or Max aspect for thumbnail )*

Is it set at Height or Width.  I suspect this only happens if you are set to 'Height', and the pic is in landscape, ie it is wider than it is high.
This is due to this code;

if ($CONFIG['make_intermediate'] && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']) {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
    } else {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
    }
Title: [fixed]: problem with resize tool.
Post by: allisonv7 on February 27, 2004, 06:49:46 AM
QuoteNow, what you need to do, is go back to the re-size pics tool, and use the first section, to rebuild the normal pics. This will get your gallery working properly again, but you will have duplicate files (orig.jpg and normal_orig.jpg

I did this and it worked, but when I delete the originals it's still deleting the normal one.  My config is set to 'height' .  Is there any way this can be fixed? I will have both portrait and landscape pics in my gallery.  I don't mind as much the original file staying there, but I would like it so you can't click on the normal and view the original.  Is there a way to just remove the link?

Thanks,

Allison.
Title: [fixed]: problem with resize tool.
Post by: Casper on February 27, 2004, 11:46:37 AM
Hi Allison,

for the moment, you will have to keep the normal and original, but at least the original is now a smaller file.

For now, don't use the delete original after recreating the normal, or the same thing will happen again.  I hope we can sort this out, so you can delete them later.
Title: [fixed]: problem with resize tool.
Post by: Casper on February 27, 2004, 01:19:35 PM
@gaugau/tarique,

There appears to be a conflict with this piece of code in displayimage.php, and the use of the re-size tool, in certain circumstances;
if ($CONFIG['make_intermediate'] && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']) {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
    } else {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
    }


If the config setting for max size is set at 'height', and the pics are in landscape mode, when the re-size utility is used to delete the original, the display fails.

I think this is because the code is only looking at the pic width '> $CONFIG['picture_width'])', but comparing it against the maximum height.  As the pic is in landscape, this will be greater, so coppermine is looking for a 'normal_' pic, which is not there.

I have spent some time trying to change this code, without success   :?
Title: [fixed]: problem with resize tool.
Post by: FreeMail on February 27, 2004, 01:53:09 PM
Quote from: "casper"I have a theory, which I need you all to answer a question.

Those who have this happen, what is your setting in config, for
QuoteUse dimension ( width or height or Max aspect for thumbnail )*


mine is set to 'Height'
Title: [fixed]: problem with resize tool.
Post by: Casper on March 01, 2004, 12:43:06 PM
*BUMP*
Title: [fixed]: problem with resize tool.
Post by: Joachim Müller on March 01, 2004, 08:19:56 PM
started tracker # 907770 (http://sourceforge.net/tracker/index.php?func=detail&aid=907770&group_id=89658&atid=590907) on this issue.

GauGau
Title: [fixed]: problem with resize tool.
Post by: Tarique Sani on March 02, 2004, 07:57:04 AM
Replace this line if ($CONFIG['make_intermediate'] && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']) {

With
   if($CONFIG['thumb_use']=='ht' && $CURRENT_PIC_DATA['pheight'] > $CONFIG['picture_width'] ){ // The wierd comparision is because only picture_width is stored
      $condition = true;
    }elseif($CONFIG['thumb_use']=='wd' && $CURRENT_PIC_DATA['pwidth'] > $CONFIG['picture_width']){    
      $condition = true;
    }elseif($CONFIG['thumb_use']=='any' && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']){    
      $condition = true;
    }else{    
     $condition = false;    
    }

               
    if ($CONFIG['make_intermediate'] && $condition ) {


Let me know if it is working for you in all combinations and I will commit it to CVS
Title: [fixed]: problem with resize tool.
Post by: Casper on March 02, 2004, 07:39:56 PM
Hi Tarique,

your code works well for me, with the config set both ways, and with pics in both landscape and portrait, thank you very much.  :wink:
Title: [fixed]: problem with resize tool.
Post by: Tarique Sani on March 03, 2004, 08:06:31 AM
Commited to devel in CVS
Title: [fixed]: problem with resize tool.
Post by: FreeMail on March 03, 2004, 01:22:28 PM
Quote from: "tarique"Replace this line if ($CONFIG['make_intermediate'] && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']) {

With
   if($CONFIG['thumb_use']=='ht' && $CURRENT_PIC_DATA['pheight'] > $CONFIG['picture_width'] ){ // The wierd comparision is because only picture_width is stored
      $condition = true;
    }elseif($CONFIG['thumb_use']=='wd' && $CURRENT_PIC_DATA['pwidth'] > $CONFIG['picture_width']){    
      $condition = true;
    }elseif($CONFIG['thumb_use']=='any' && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']){    
      $condition = true;
    }else{    
     $condition = false;    
    }

               
    if ($CONFIG['make_intermediate'] && $condition ) {


Let me know if it is working for you in all combinations and I will commit it to CVS


just to confirm, is this for 'displayimage.php'?

tia!
Title: [fixed]: problem with resize tool.
Post by: Nibbler on March 03, 2004, 02:19:12 PM
Yes, seeing as that is the only file in coppermine which actually has the line you need to replace.
Title: [fixed]: problem with resize tool.
Post by: FreeMail on March 03, 2004, 11:38:01 PM
thanks!
Title: after "delete original"... (now slideshow problem)
Post by: tabassman on March 22, 2004, 07:03:36 AM
i wanted to get rid of my huge 1meg pics but when i went to resize>>delete originals, it renamed all the pics correctly (ie got rid of the normal_) but for the link to the pic it didnt modify where most of them point to.  most still point to the "normal_" version.  none of my galleries are or ever were under the userpics folder either.  The only ones it modified the image path for were the ones it said it couldnt find. For instance "The file albums/wop_party/normal_100_1328.jpg was not found" that pic works.  but most of them said "The file albums/wop_party/normal_100_1306.jpg was successfully used as main picture!" which left the img src as "normal_" and thus leads to broken images.

my link: http://66.90.73.60/~vicphoto/gallery/

I dont want to go to delete originals again, because i fear that it will delete the files without "normal_" because it will mistake them as the originals.

i confused.
Title: [fixed]: problem with resize tool.
Post by: tabassman on March 22, 2004, 08:02:39 AM
it might have something to do with the size of the picture.  all the vertical pictures work fine.  but the horizontal ones do not.  here are my settings for sizes:

quality:  80
max dim of thumbs:  100
use dim:  height
intermediate?:  yes
max width or height of intermediate:  540
max size: 1424 (kB)
max height or width: 2180

i am even more confused now.  where are the paths to the pictures stored?  i analyzed the displayimage.php file to no resolve.
Title: [fixed]: problem with resize tool.
Post by: Casper on March 22, 2004, 11:26:39 AM
See this thread, http://forum.coppermine-gallery.net/index.php?topic=4063.
Title: [fixed]: problem with resize tool.
Post by: tabassman on March 22, 2004, 02:55:56 PM
thanks.  i saw that the guy who started the thread was having other problems so i skipped that thread.
Title: [fixed]: problem with resize tool.
Post by: Casper on March 22, 2004, 03:25:53 PM
That's a shame, because if you had read through the thread, you would see this comes into it, and the fix is there.  Look for the first post by tarique in the thread, on page 2.
So how did you solve it?
Title: [fixed]: problem with resize tool.
Post by: tabassman on March 22, 2004, 03:56:37 PM
Quote from: "casper"That's a shame, because if you had read through the thread, you would see this comes into it, and the fix is there.  Look for the first post by tarique in the thread, on page 2.
So how did you solve it?

i meant i initially skipped the thread when i was first trying to solve it.  having it remake the normals and then deleting the originals worked just fine.  HOWEVER, slideshow still references the normal_ files.  where are the references to these img src's stored?
Title: [fixed]: problem with resize tool.
Post by: tabassman on March 22, 2004, 04:20:59 PM
here is some code in the slideshow include php.

foreach ($pic_data as $picture) {
    if ($CONFIG['make_intermediate'] && max($picture['pwidth'], $picture['pheight']) > $CONFIG['picture_width']) {
        $picture_url = get_pic_url($picture, 'normal');
    } else {
        $picture_url = get_pic_url($picture, 'fullsize');
    }


this makes it so that the normal version is used when the picture width or height is greater than the width defined in config, right?

well, my max width is actually a height.  540.  so landscape pictures never fall into this category correctly.

how do i make it so that it doesnt decide based upon height and width and all that, but instead decides based upon whether or not i have deleted the normal_ files using resize????

thanks for your help, you guys kick ass.

EDIT:  thought about it.  should i use min() instead.  that way 540 would always defeat 540 in the > test and when i have the originals intact they would obviously be > as well (even the min value).  let me know if this is good thinking.  i just did it and it *seems* to work.
Title: [fixed]: problem with resize tool.
Post by: Casper on March 22, 2004, 05:55:13 PM
Apologies for earlier misunderstanding.
You have found a bit that was missed when this was first sorted.

I'm not sure if your solution is the best way, or just carrying out tariques code change in slideshow.php.  
Hopefully he will read this and let us know.

Just to re-cap, tariques code change was;
Replace this line if ($CONFIG['make_intermediate'] && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']) {  

With


if($CONFIG['thumb_use']=='ht' && $CURRENT_PIC_DATA['pheight'] > $CONFIG['picture_width'] ){ // The wierd comparision is because only picture_width is stored
      $condition = true;
    }elseif($CONFIG['thumb_use']=='wd' && $CURRENT_PIC_DATA['pwidth'] > $CONFIG['picture_width']){    
      $condition = true;
    }elseif($CONFIG['thumb_use']=='any' && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']){    
      $condition = true;
    }else{    
     $condition = false;      
    }

             
    if ($CONFIG['make_intermediate'] && $condition ) {  



Merged with thread dealing with this problem.
Title: [fixed]: problem with resize tool.
Post by: tabassman on March 22, 2004, 06:34:06 PM
i hadnt noticed that both pieces of code were similar.  i replaced mine with tariques and it worked fine.
Title: [fixed]: problem with resize tool.
Post by: Casper on March 22, 2004, 06:43:09 PM
Thanks for that, we will have to have this changed for the next version.
Title: [fixed]: problem with resize tool.
Post by: shoobeedoodoo on March 26, 2004, 03:12:50 AM
I implemented Tariq's code changes, and everything is fine now, except that the slideshow doesn't diplay the pictures, and instead displays the red x without the picture.  Are there changes that I have to make to the slideshow code as well, and if so, what are they?

Thanks!

-Stephen
Title: [fixed]: problem with resize tool.
Post by: Casper on March 26, 2004, 01:52:55 PM
Yes,
just do the exact same change to the file include/slideshow.inc.hp, and it should work correctly.