SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
February 08, 2012, 06:24:12 pm

Login with username, password and session length
Members
Total Members: 9898
Latest: zlmember
Stats
Total Posts: 27745
Total Topics: 4856
Online Today: 77
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 2
Guests: 63
Total: 65
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
| | | | |-+ 
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 Go Down Print
Author Topic: Filesize (Gallery Pro)  (Read 9510 times)
Adamzon
SMF Gallery Pro Customer
Newbie
*****
Offline Offline

Posts: 23


View Profile
« 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 Smiley

/adam
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9376


View Profile
« 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:
$filesize = $_FILES['picture']['size'];
After it add
Code:
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);
Logged
Adamzon
SMF Gallery Pro Customer
Newbie
*****
Offline Offline

Posts: 23


View Profile
« Reply #2 on: December 30, 2006, 09:29:57 am »

Got a white page with the test: FileSize: 1124819
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9376


View Profile
« 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']);
Logged
Adamzon
SMF Gallery Pro Customer
Newbie
*****
Offline Offline

Posts: 23


View Profile
« 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?
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9376


View Profile
« 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.
Logged
Adamzon
SMF Gallery Pro Customer
Newbie
*****
Offline Offline

Posts: 23


View Profile
« Reply #6 on: December 30, 2006, 09:42:45 am »

No, not that i know of. I cant find a setting for this

/adam
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9376


View Profile
« 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:
if($image_resized == 1)
{
$filesize = filesize($_FILES['picture']['tmp_name']);
}
else
{
$filesize = $_FILES['picture']['size'];
}
Logged
Adamzon
SMF Gallery Pro Customer
Newbie
*****
Offline Offline

Posts: 23


View Profile
« 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
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9376


View Profile
« 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.
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9376


View Profile
« 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
Logged
Adamzon
SMF Gallery Pro Customer
Newbie
*****
Offline Offline

Posts: 23


View Profile
« 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....
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9376


View Profile
« Reply #12 on: December 30, 2006, 11:10:57 am »

The resize function works. I did not say it didn't work.
Logged
RWL
Full Member
***
Offline Offline

Posts: 100



View Profile WWW
« 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  Roll Eyes

Regards,

Wilsy.
Logged

RewindLancs.com Management

Adamzon
SMF Gallery Pro Customer
Newbie
*****
Offline Offline

Posts: 23


View Profile
« 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?
Logged
Pages: [1] 2 Go Up Print 
« previous next »
Jump to:  

Recent
[Today at 06:14:06 pm]

[Today at 04:36:21 pm]

[Today at 09:56:10 am]

[Today at 09:11:02 am]

[Today at 09:07:32 am]

[Today at 03:46:49 am]

[February 07, 2012, 09:45:42 pm]

[February 07, 2012, 06:09:23 pm]

[February 07, 2012, 02:56:36 pm]

[February 06, 2012, 08:16:24 pm]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.16 | SMF © 2006-2011, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
SMF and SimpleMachines are registered trademarks of Simple Machines. SMFHacks.com is not affiliated with nor endorsed by Simple Machines.
Page created in 0.263 seconds with 20 queries.