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]   Go Down

Author Topic: Keep thumb and normal pictures at max aspect  (Read 4426 times)

0 Members and 1 Guest are viewing this topic.

je79ayps

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 45
Keep thumb and normal pictures at max aspect
« on: April 03, 2004, 10:26:14 am »

I would like that thumbs only are 75px heigh so that it doesn't change the design regarding the width and height of the tables. I would like my normals only to be 640px max aspect.

As I see this is not possible when I have chosen "height" in the config. Becuase the my normal pictures could end being more than 640px in width.

Either I should choose "max aspect" and live with the thumbs being 75px overall. Isn't this correct?

Here's my config part:

Pictures and thumbnails settings
Quality for JPEG files: 100
Max dimension of a thumbnail: 75px
Use dimension ( width or height or Max aspect for thumbnail ): height
Create intermediate pictures: yes
Max width or height of an intermediate picture: 640
Max size for uploaded pictures (KB): 512kb
Max width or height for uploaded pictures (pixels): 1280
Logged

je79ayps

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 45
Keep thumb and normal pictures at max aspect
« Reply #1 on: April 13, 2004, 10:11:52 am »

*bump*
Logged

hyperion

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 1317
  • - retired -
Keep thumb and normal pictures at max aspect
« Reply #2 on: April 13, 2004, 05:45:27 pm »

You can hardcode the settings in include/picmgmt.inc.php.
Logged
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

je79ayps

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 45
Keep thumb and normal pictures at max aspect
« Reply #3 on: April 15, 2004, 09:39:29 pm »

Thanks, but is it line 25 I should fool around with:
    $thumb = $CONFIG['fullpath'] . $filepath . $CONFIG['thumb_pfx'] . $filename;
Logged

hyperion

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 1317
  • - retired -
Keep thumb and normal pictures at max aspect
« Reply #4 on: April 16, 2004, 12:39:00 am »

No, that is the file path. You want the resize functions, which begin on 28.

Code: [Select]
   
if (!file_exists($thumb))
        if (!resize_image($image, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use']))
            return false;

        if (max($imagesize[0], $imagesize[1]) > $CONFIG['picture_width'] && $CONFIG['make_intermediate'] && !file_exists($normal))
            if (!resize_image($image, $normal, $CONFIG['picture_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use']))
                return false;
Logged
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

je79ayps

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 45
Keep thumb and normal pictures at max aspect
« Reply #5 on: April 16, 2004, 08:16:15 am »

OK, but how do I set the pixels I want?

I guess it's the $CONFIG['thumb_width'] I should concentrate about but should I just make somthing like: $CONFIG['75']?

But it isn't really the width I want to set - it's the height so that the thumbs only are 75px in height.
Logged

hyperion

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 1317
  • - retired -
Keep thumb and normal pictures at max aspect
« Reply #6 on: April 16, 2004, 08:36:32 am »

Change:

Code: [Select]

        if (!resize_image($image, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use']))


to:

Code: [Select]

        if (!resize_image($image, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], 'ht'))


It says $CONFIG['thumb_width'], but it is really just the length for the dimension specified in $CONFIG['thumb_use'].

Then set the Config console to max aspect. Your thumbs will get resized by height, and your intermediates will get the max aspect treatment.  Pixels for both intermediates and thumbs should be specified in the Config console.
Logged
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

je79ayps

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 45
Keep thumb and normal pictures at max aspect
« Reply #7 on: April 16, 2004, 08:19:43 pm »

Okay, got it - but it doesn't seem to work.

If you look at http://www.brutaldeluxe.dk the horistonal picture is only 75px in width but I want this to be 100 px and then the height should be 75 px.

Config:

Pictures and thumbnails settings
Quality for JPEG files    80
Max dimension of a thumbnail *   75
Use dimension ( width or height or Max aspect for thumbnail )*   Max Aspect
Create intermediate pictures   Yes
Max width or height of an intermediate picture *    640
Max size for uploaded pictures (KB)    1024
Max width or height for uploaded pictures (pixels)    2048
Logged

hyperion

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 1317
  • - retired -
Keep thumb and normal pictures at max aspect
« Reply #8 on: April 17, 2004, 03:54:58 am »

Hmmm . . . This may require more than that. Look at the thumbnails using the FTP client (no browsers) to see if the files were actually resized correctly.  This may be an image tag issue.
Logged
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

je79ayps

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 45
Keep thumb and normal pictures at max aspect
« Reply #9 on: April 17, 2004, 09:24:21 am »

On a note - the 2 pictures were uploaded after I made the changes to the code.

If I look at the pictures they have the rigth dimension: 56x75 and 100x75 - so that should be allright...
Logged

je79ayps

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 45
Keep thumb and normal pictures at max aspect
« Reply #10 on: April 18, 2004, 03:13:54 pm »

I guess I want the same function as height sizing on thumbs in categories.

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.upit.dk%2Ffiles%2FSNAG-0000.jpg&hash=6190024bca6b263a91375fd299d668b542a30bcb)

And the film strip:

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.upit.dk%2Ffiles%2FSNAG-0001.jpg&hash=4c41629af33749ee3923f32bd69a38a1c591f5ff)

Hope this is possible...
Logged

hyperion

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 1317
  • - retired -
Keep thumb and normal pictures at max aspect
« Reply #11 on: April 20, 2004, 01:03:31 am »

Yes, this is possible. I am too busy to work on this right now, but the issue is an HTML image tag issue.  You need to look in thumbnails.php and /include/functions.inc.php.  The relevant functions are display_thumbnails and compute_image_geom. You will need to add an argument to the function to return a custom image geometry for thumbnails instead of relying on the max aspect setting.
Logged
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

je79ayps

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 45
Keep thumb and normal pictures at max aspect
« Reply #12 on: April 20, 2004, 08:22:35 am »

OK, thanks for your help so far hyperion!

I'll try and mess around with the two files - we can't be that far from the goal since the thumbs are created correctly, so...

Perhaps gaugau or casper can be of assistance for the last part?
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Keep thumb and normal pictures at max aspect
« Reply #13 on: April 20, 2004, 10:47:55 am »

I wish I could help, but it's all alien to me.  The other people who really could help, other than Gaugau, such as Tarique, Omni, Nibbler and the other devs, are all quite busy getting 1.3 ready for stable release at the moment.
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

je79ayps

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 45
Keep thumb and normal pictures at max aspect
« Reply #14 on: April 20, 2004, 02:33:08 pm »

OK, no problem - I'll live with the "problem".

Perhaps it could be a feature in the 1.3 version. To use different scaling for the normal and thumb pictures that is.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Keep thumb and normal pictures at max aspect
« Reply #15 on: April 20, 2004, 11:07:07 pm »

sorry, no additional features for cpg1.3.0 - we had a feature freeze and are within the pre-release beta testing phase.

GauGau
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 19 queries.