Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12404
Latest: azaratir
New This Month: 10
New This Week: 0
New Today: 0
Stats
Total Posts: 39925
Total Topics: 7028
Most Online Today: 109
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 41
Total: 42

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

0 Members and 1 Guest are viewing this topic.

Offline iosarian

  • Newbie
  • *
  • 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

  • Newbie
  • *
  • 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

  • Newbie
  • *
  • 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

  • Newbie
  • *
  • 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
14526 Views
Last post January 10, 2007, 09:31:07 am
by SMFHacks
2 Replies
4107 Views
Last post May 09, 2009, 10:58:39 am
by SMFHacks
2 Replies
2738 Views
Last post August 16, 2009, 12:57:37 am
by Vincent Volmer
9 Replies
4563 Views
Last post December 19, 2010, 12:01:09 am
by vkot
0 Replies
1524 Views
Last post February 24, 2015, 04:57:22 am
by trifox

+- Recent Topics

Update detect mobile mode PHP5 to PHP7 by Rock Lee
November 16, 2019, 07:18:13 pm

PHP error by davejo
November 12, 2019, 12:09:47 pm

Message Editor Pro Issues by SMFHacks
November 06, 2019, 09:58:33 pm

most popular categories doesnt work by fussilet
November 02, 2019, 02:51:42 pm

Change colors of Halloween theme by SMFHacks
October 24, 2019, 11:44:59 am

prettyurls - TroubleShooting.wiki by Rock Lee
October 10, 2019, 11:37:09 am

Some issues with adding and editing a listing by ajac63
October 07, 2019, 04:16:40 am

Problem update 1.1.21 to 2.0.15 by Rock Lee
October 06, 2019, 06:09:16 pm

[Mod]SMF 2.0.x PHP 7.2 Support by sah62
October 04, 2019, 01:46:00 pm

Ideas by shuban
October 03, 2019, 10:19:06 pm

Powered by EzPortal