Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: 1 [2] 3   Go Down

Author Topic: [fixed]: problem with resize tool.  (Read 22599 times)

0 Members and 1 Guest are viewing this topic.

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
[fixed]: problem with resize tool.
« Reply #20 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.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
[fixed]: problem with resize tool.
« Reply #21 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;
Code: [Select]
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   :?
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

FreeMail

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 67
    • http://www.myphotodb.com
[fixed]: problem with resize tool.
« Reply #22 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
Quote
Use dimension ( width or height or Max aspect for thumbnail )*




mine is set to 'Height'
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
[fixed]: problem with resize tool.
« Reply #23 on: March 01, 2004, 12:43:06 pm »

*BUMP*
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
[fixed]: problem with resize tool.
« Reply #24 on: March 01, 2004, 08:19:56 pm »

started tracker # 907770 on this issue.

GauGau
Logged

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
[fixed]: problem with resize tool.
« Reply #25 on: March 02, 2004, 07:57:04 am »

Replace this line
Code: [Select]
if ($CONFIG['make_intermediate'] && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']) {

With
Code: [Select]
   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
Logged
SANIsoft PHP applications for E Biz

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
[fixed]: problem with resize tool.
« Reply #26 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:
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
[fixed]: problem with resize tool.
« Reply #27 on: March 03, 2004, 08:06:31 am »

Commited to devel in CVS
Logged
SANIsoft PHP applications for E Biz

FreeMail

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 67
    • http://www.myphotodb.com
[fixed]: problem with resize tool.
« Reply #28 on: March 03, 2004, 01:22:28 pm »

Quote from: "tarique"
Replace this line
Code: [Select]
if ($CONFIG['make_intermediate'] && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']) {

With
Code: [Select]
   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!
Logged

Nibbler

  • Guest
[fixed]: problem with resize tool.
« Reply #29 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.
Logged

FreeMail

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 67
    • http://www.myphotodb.com
[fixed]: problem with resize tool.
« Reply #30 on: March 03, 2004, 11:38:01 pm »

thanks!
Logged

tabassman

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
after "delete original"... (now slideshow problem)
« Reply #31 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.
Logged

tabassman

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
[fixed]: problem with resize tool.
« Reply #32 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.
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
[fixed]: problem with resize tool.
« Reply #33 on: March 22, 2004, 11:26:39 am »

Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

tabassman

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
[fixed]: problem with resize tool.
« Reply #34 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.
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
[fixed]: problem with resize tool.
« Reply #35 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?
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

tabassman

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
[fixed]: problem with resize tool.
« Reply #36 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?
Logged

tabassman

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
[fixed]: problem with resize tool.
« Reply #37 on: March 22, 2004, 04:20:59 pm »

here is some code in the slideshow include php.

Code: [Select]
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.
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
[fixed]: problem with resize tool.
« Reply #38 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
Code: [Select]
if ($CONFIG['make_intermediate'] && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']) {  

With

Code: [Select]

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.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

tabassman

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
[fixed]: problem with resize tool.
« Reply #39 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.
Logged
Pages: 1 [2] 3   Go Up
 

Page created in 0.051 seconds with 18 queries.