Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 230
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 216
Total: 216

Author Topic: Filesize (Gallery Pro)  (Read 24354 times)

0 Members and 1 Guest are viewing this topic.

Offline Adamzon

  • SMF Gallery Pro Customer
  • Member
  • *****
  • Posts: 23
    • View Profile
Filesize (Gallery Pro)
« on: December 30, 2006, 07:01:11 am »
Hi!

I got a big problem.
In the config i have made the value to 100.000 bytes but members can upload pictures that are huge! 1-2-3 mb!

A bug or is it me that is a bug :)

/adam

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Filesize (Gallery Pro)
« Reply #1 on: December 30, 2006, 09:24:12 am »
Strange,
Hmm Can you run a test for me?
Open Gallery.php in your sources folder.
Find
function AddPicture2()

Scroll down till you find
Code: [Select]
$filesize = $_FILES['picture']['size'];
After it add
Code: [Select]
die('FileSize: ' . $filesize);
And tell me what it what it returns when you add a single picture to a category. After you  are finished with the test remove die('FileSize: ' . $filesize);
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Adamzon

  • SMF Gallery Pro Customer
  • Member
  • *****
  • Posts: 23
    • View Profile
Re: Filesize (Gallery Pro)
« Reply #2 on: December 30, 2006, 09:29:57 am »
Got a white page with the test: FileSize: 1124819

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Filesize (Gallery Pro)
« Reply #3 on: December 30, 2006, 09:32:46 am »
Well that's good it is returning the size.
Try another test in the same area
die('MaxFileSize: ' . $modSettings['gallery_max_filesize']);
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Adamzon

  • SMF Gallery Pro Customer
  • Member
  • *****
  • Posts: 23
    • View Profile
Re: Filesize (Gallery Pro)
« Reply #4 on: December 30, 2006, 09:35:22 am »
i put back the org gallery.php file and god this "error"..
Picture exceeds max filesize. Max Filesize is 97.66kb

"Resize Images if too large" dont work then?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Filesize (Gallery Pro)
« Reply #5 on: December 30, 2006, 09:39:47 am »
Well resize images. Only checks the height and width. hmmm. That might be it have to recheck the resized image size.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Adamzon

  • SMF Gallery Pro Customer
  • Member
  • *****
  • Posts: 23
    • View Profile
Re: Filesize (Gallery Pro)
« Reply #6 on: December 30, 2006, 09:42:45 am »
No, not that i know of. I cant find a setting for this

/adam

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Filesize (Gallery Pro)
« Reply #7 on: December 30, 2006, 09:45:48 am »
Figured it out.

Gallery.php
In the addpicture2 and editpicture2 functions
Find
$filesize = $_FILES['picture']['size'];
Replace with
Code: [Select]
if($image_resized == 1)
{
$filesize = filesize($_FILES['picture']['tmp_name']);
}
else
{
$filesize = $_FILES['picture']['size'];
}
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Adamzon

  • SMF Gallery Pro Customer
  • Member
  • *****
  • Posts: 23
    • View Profile
Re: Filesize (Gallery Pro)
« Reply #8 on: December 30, 2006, 09:55:24 am »
After your hack, i still got the
Picture exceeds max filesize. Max Filesize is 97.66kb
"error"

Put the org file here: http://alfa.glidarhoj.se/file/


/adam

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Filesize (Gallery Pro)
« Reply #9 on: December 30, 2006, 09:59:59 am »
Well how big is the file that you are uploading? This is supposed to fix the max file size setting from being avoided by image resize.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Filesize (Gallery Pro)
« Reply #10 on: December 30, 2006, 10:02:59 am »
100000 Bytes equals = 97.65625 Kilobytes I caculate via 1024

So
100000 / 1024 = 97.65625
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Adamzon

  • SMF Gallery Pro Customer
  • Member
  • *****
  • Posts: 23
    • View Profile
Re: Filesize (Gallery Pro)
« Reply #11 on: December 30, 2006, 11:07:05 am »
So the resize function is no function at all?

I want my money back, i feel that i the product i buyed was going to have a function to resize pictures.

That was why i buyed the product from u....

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Filesize (Gallery Pro)
« Reply #12 on: December 30, 2006, 11:10:57 am »
The resize function works. I did not say it didn't work.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline RWL

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • RWL
Re: Filesize (Gallery Pro)
« Reply #13 on: December 30, 2006, 11:13:26 am »
Hey,

This is a quality gallery and the support here is awesome. Be a little more patient  ::)

Regards,

Wilsy.
RewindLancs.com Management


Offline Adamzon

  • SMF Gallery Pro Customer
  • Member
  • *****
  • Posts: 23
    • View Profile
Re: Filesize (Gallery Pro)
« Reply #14 on: December 30, 2006, 03:08:55 pm »
ok, sorry. I´m frustrated (spells)

So, whats the problem and how do we solv it?

 

Related Topics

  Subject / Started by Replies Last post
3 Replies
4542 Views
Last post November 25, 2007, 01:37:19 pm
by dlomneck
3 Replies
5746 Views
Last post October 22, 2008, 06:50:41 pm
by SMFHacks
1 Replies
3929 Views
Last post May 05, 2009, 07:18:21 pm
by SMFHacks
1 Replies
4018 Views
Last post April 13, 2010, 02:53:20 pm
by SMFHacks
1 Replies
3704 Views
Last post April 11, 2014, 08:48:03 am
by SMFHacks

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 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

Powered by EzPortal