Author Topic: Thumbnail size  (Read 18168 times)

0 Members and 1 Guest are viewing this topic.

Offline Warz

  • Newbie
  • *
  • Posts: 44
    • View Profile
Thumbnail size
« on: December 05, 2008, 04:40:54 PM »
Hey,

When user upload image, thumb is automatically created, but it does not resize thumb to my prefered size. I need to have thumbnail automatically resized to a fixed size of 154x104 px when creating thumb on upload.

Let me know how much it costs.

Payment via paypal

Thanks

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: Thumbnail size
« Reply #1 on: December 05, 2008, 05:10:21 PM »
hi...
you can define your thumbnail size in your ACP-control panel.. go to settings -> upload setting -> define thumbnail size to 154

thatīs it.
bergblume

Offline Warz

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Thumbnail size
« Reply #2 on: December 05, 2008, 05:56:23 PM »
Sorry, it doesn't work. I can get thumbnail in other formats...  :(

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Re: Thumbnail size
« Reply #3 on: December 05, 2008, 06:03:29 PM »
Hi,
Quote
fixed size of 154x104
and how do you thing is this possible with images in this two upload formats:
1024x768
768x1024

in 4images settings you can only fix one side from the image
Two fix sides is not possible in standard script

And i can't remember about a mod for this...


Kurt

Offline Warz

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Thumbnail size
« Reply #4 on: December 05, 2008, 06:17:47 PM »
Hi,
Quote
fixed size of 154x104
and how do you thing is this possible with images in this two upload formats:
1024x768
768x1024

in 4images settings you can only fix one side from the image
Two fix sides is not possible in standard script

And i can't remember about a mod for this...


Kurt

True, so I pay $$$ if you or anyone else can make this mod :)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Thumbnail size
« Reply #5 on: December 06, 2008, 12:37:13 AM »
In includes/image_utils.php find:
  if ($resize_handle($src$dest$quality$width_height['width'], $width_height['height'], $image_info)) {


Insert above:  global $config;
  
$width_height = array("width" => $config['max_thumb_width'], "height" => $config['max_thumb_height']);
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Re: Thumbnail size
« Reply #6 on: December 06, 2008, 10:10:02 AM »
and this code resize the different image sizes correctly  8O

Offline Warz

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Thumbnail size
« Reply #7 on: December 06, 2008, 12:36:12 PM »
In includes/image_utils.php find:
  if ($resize_handle($src$dest$quality$width_height['width'], $width_height['height'], $image_info)) {


Insert above:  global $config;
  
$width_height = array("width" => $config['max_thumb_width'], "height" => $config['max_thumb_height']);

Hmmm... seems to work a bit better, I mean it's not totally out of correct size anymore, but it still doesn't stretch it to always be 154x104. Thanks though

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Thumbnail size
« Reply #8 on: December 06, 2008, 04:37:04 PM »
Hmmm... seems to work a bit better, I mean it's not totally out of correct size anymore, but it still doesn't stretch it to always be 154x104. Thanks though
Ok, I'm running out of ideas. Please show us.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Warz

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Thumbnail size
« Reply #9 on: December 06, 2008, 06:32:14 PM »
Hi,

What I need is:
When uploading image, auto make thumb with size 154x104

Now when I upload image after your code, I get image with 154x103, 139x105 etc.... It is similar to 154x104 but not exact value 154x104.

I will give you an example:

This is wrong (154x103):

This is correct (154x104):


You see what I mean?  :)
« Last Edit: December 06, 2008, 06:50:40 PM by Warz »

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Re: Thumbnail size
« Reply #10 on: December 06, 2008, 07:15:35 PM »
what is the reason about this size :?:

and nice two small images. i need a lupe to see anything :lol:

Offline Warz

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Thumbnail size
« Reply #11 on: December 06, 2008, 07:19:59 PM »
what is the reason about this size :?:

and nice two small images. i need a lupe to see anything :lol:
The reason for the size is because I have another site where I use thumbnails from my 4images site. And if images are in different sizes it will not look good....

If you really want to read you can go here: http://i242.photobucket.com/albums/ff198/Warz/4imagesSettings01.jpg

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Thumbnail size
« Reply #12 on: December 06, 2008, 07:30:58 PM »
On my test site (fresh 4images with the code above) it creates 154x104 thumbnails no matter what size and dimensions of the original image. Make sure you've inserted the code ABOVE and not BELOW
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Warz

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Thumbnail size
« Reply #13 on: December 06, 2008, 08:58:47 PM »
On my test site (fresh 4images with the code above) it creates 154x104 thumbnails no matter what size and dimensions of the original image. Make sure you've inserted the code ABOVE and not BELOW
Yupp,

Code: [Select]
  $width_height = get_width_height($dimension, $image_info[0], $image_info[1], $resize_type);
  $resize_handle = "resize_image_".$convert_options['convert_tool'];
// custom added line between here
global $config;
  $width_height = array("width" => $config['max_thumb_width'], "height" => $config['max_thumb_height']);
// and here to make max thumb size
  if ($resize_handle($src, $dest, $quality, $width_height['width'], $width_height['height'], $image_info)) {
    @chmod($dest, CHMOD_FILES);
    return true;
  }
  else {
    return false;

Wonder what it could be then  :? I tried all kinds of different settings aswell under admin panel, settings

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Thumbnail size
« Reply #14 on: December 06, 2008, 11:24:47 PM »
Just to be sure we are on the same topic. This modification affects only new thumbnails, not already existed.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)