Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43260
Total Topics: 7518
Most Online Today: 297
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 270
Total: 270

Author Topic: Problem with image size  (Read 5943 times)

0 Members and 1 Guest are viewing this topic.

Offline iosarian

  • Member
  • *
  • Posts: 24
    • View Profile
Problem with image size
« on: September 29, 2007, 02:12:51 pm »
The Settings are:

Max allowed image height:  768
Max allowed image width:   1024

Max display image width:  640
Max display image height: 480

How you can see here http://dog.bg/forum/index.php?action=gallery;sa=view;id=461 and here http://dog.bg/forum/index.php?action=gallery;sa=view;id=456 and here http://dog.bg/forum/index.php?action=gallery;sa=view;id=458
the pictures are shrunk to 450x480.  To se it in the correct propotion of width and height I have to click on it.

I tried different settings for display image pixels with no success.
Any Idea?

EDIT: Ok, I made display pixels same as allowed and now it's ok. (so you can't see the deformed pictures). But I cannot allow bigger pictures now.
« Last Edit: September 29, 2007, 07:32:08 pm by iosarian »

Offline iosarian

  • Member
  • *
  • Posts: 24
    • View Profile
Re: Problem with image size
« Reply #1 on: October 02, 2007, 09:29:30 am »
In gallery.template.php I've changed this lines:
Code: [Select]
$thumbheight = ($context['gallery_pic']['height'] > $modSettings['gallery_set_disp_maxheight'] ? $modSettings['gallery_set_disp_maxheight'] : $context['gallery_pic']['height']);
$thumbwidth = ($context['gallery_pic']['width'] > $modSettings['gallery_set_disp_maxwidth'] ? $modSettings['gallery_set_disp_maxwidth'] : $context['gallery_pic']['width']);

To:
Code: [Select]
if ($context['gallery_pic']['width']>=$modSettings['gallery_set_disp_maxwidth'])
{
$thumbwidth=$modSettings['gallery_set_disp_maxwidth'];
$thumbheight=$context['gallery_pic']['height']*$modSettings['gallery_set_disp_maxwidth']/$context['gallery_pic']['width'];
}
else {$thumbwidth=$context['gallery_pic']['width'];
$thumbheight=$context['gallery_pic']['height'];
}

if ($thumbheight>$modSettings['gallery_set_disp_maxheight'])
{
$thumbheight = $modSettings['gallery_set_disp_maxheight'];
$thumbwidth = $context['gallery_pic']['width']*$modSettings['gallery_set_disp_maxheight']/$context['gallery_pic']['height'];
}

And...the width and height now are in correct propotions.
« Last Edit: October 02, 2007, 09:31:47 am by iosarian »

Offline haderaschta

  • Member
  • *
  • Posts: 8
    • View Profile
    • haderaschta
Re: Problem with image size
« Reply #2 on: October 02, 2007, 07:24:40 pm »
works great! thank you very much!  :D

Offline dlomneck

  • Member
  • *
  • Posts: 11
    • View Profile
Re: Problem with image size
« Reply #3 on: November 23, 2007, 11:30:42 pm »
Yes, this works a treat.  Just bought the pro version specifically FOR the image resize function and was quite upset when the image size/scaling was not taking into account Aspect Ratio.  Hopefully this makes it into newer versions so I don't have to re-hack this with every upgrade. Thanks

Dave

 

Related Topics

  Subject / Started by Replies Last post
image size problem

Started by cb49747 « 1 2 » Support

16 Replies
18166 Views
Last post January 10, 2007, 09:31:07 am
by SMFHacks
2 Replies
6088 Views
Last post May 09, 2009, 10:58:39 am
by SMFHacks
2 Replies
4447 Views
Last post August 16, 2009, 12:57:37 am
by Vincent Volmer
9 Replies
7969 Views
Last post December 19, 2010, 12:01:09 am
by vkot
0 Replies
3385 Views
Last post February 24, 2015, 04:57:22 am
by trifox

+- Recent Topics

No thumbnails on new uploads by Tonyvic
Today at 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal