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: Changing Fullsize Image Resolution  (Read 2817 times)

0 Members and 1 Guest are viewing this topic.

myjunkman

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Changing Fullsize Image Resolution
« on: September 06, 2005, 04:34:38 am »

HI - This may seem like an odd request, but I would like to be able to adjust the size of the resolution for the fullsize image from the original resolution (i.e. 1600 x 1200) to a resolution that I manually specify in the displayimage.php script (i.e. 1024 x 768). 

For instanace, if my orgininal image is stored on the server at 1600 x 1200, I would like to have the resolution for the fullsize image that is displayed on the screen (after the intermediate picture) to 1024 x 768.  I would still like to keep the intermediate picture size at defined in the admin configuration setting and the orginal file size must remain intact at the original file size / resolution.  So, I don't want to reduce the image resolution / size on the server to accomplish this.

Please let me know if you can point me in the right direction to make this happen.

I hope this make sense.

Thanks in advance.

-Jerry M.
« Last Edit: September 06, 2005, 05:20:57 pm by GauGau »
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Changing Fullsize Image Resolution
« Reply #1 on: September 06, 2005, 06:01:46 am »

The request doesn't make sense to me.  Why force a visitor to see 1024x768 when the image is actually 1600x1200?  Why not just upload a 1024x768 image?
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

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Changing Fullsize Image Resolution
« Reply #2 on: September 06, 2005, 07:00:16 am »

Even though I don't see the point, I think this code will do what you want.

In displayimage.php, find

Code: [Select]
$geom = 'width="' . $row['pwidth'] . '" height="' . $row['pheight'] . '"';
replace with

Code: [Select]
        if (max($row['pwidth'], $row['pheight']) > 1024)
        {
        $xh = 1024 / max($row['pwidth'], $row['pheight']);
        } else {
        $xh = 1;
        }
        $geom = 'width="' . ($row['pwidth'] * $xh) . '" height="' . ($row['pheight'] * $xh) . '"';

Just change 1024 to whatever number you want.  This code should resize both the width and height according to the proper ratio.
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

myjunkman

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Changing Fullsize Image Resolution
« Reply #3 on: September 06, 2005, 02:37:38 pm »

This worked perfectly! Thanks for the quick response!
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 15 queries.