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: 43261
Total Topics: 7519
Most Online Today: 297
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 273
Total: 274

Author Topic: Bulk upload resize?  (Read 10365 times)

0 Members and 1 Guest are viewing this topic.

Offline msensintaffar

  • Member
  • *
  • Posts: 9
    • View Profile
Bulk upload resize?
« on: October 10, 2007, 12:45:51 pm »
Is it my understanding that bulk upload will not automatically resize images?

The behavior I am experience is when you bulk upload several images it seem to upload but when you get to the results page it displays nothing and the upload seems to be null unless the image was within geometry constraints.

I am running 1.3
« Last Edit: October 10, 2007, 02:27:58 pm by msensintaffar »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Bulk upload resize?
« Reply #1 on: October 10, 2007, 09:24:17 pm »
It does not list which uploads were successful or failed after the images have been bulk uploaded?
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 msensintaffar

  • Member
  • *
  • Posts: 9
    • View Profile
Re: Bulk upload resize?
« Reply #2 on: October 10, 2007, 09:46:12 pm »
No it comes back with no response at all unless the image is under the geometry constraints then it says picture approved.
« Last Edit: October 10, 2007, 09:53:57 pm by msensintaffar »

Offline msensintaffar

  • Member
  • *
  • Posts: 9
    • View Profile
Re: Bulk upload resize?
« Reply #3 on: October 12, 2007, 09:27:03 am »
This is exactly what i get after trying to do a upload with a series of images that are bigger than 800x800 which is my geometry constraint. I would really like to get this going for my users. Any help would be appreciated.


« Last Edit: October 23, 2007, 03:12:34 pm by msensintaffar »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Bulk upload resize?
« Reply #4 on: October 12, 2007, 11:01:37 pm »
If you getting a white screen try changing the php settings to display_errors = on

Since it shoulds like it either times out or going over the processing limit.
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 iosarian

  • Member
  • *
  • Posts: 24
    • View Profile
Re: Bulk upload resize?
« Reply #5 on: October 13, 2007, 06:38:38 pm »
I think the problem is in this part:
Code: [Select]
// No size, then it's probably not a valid pic.
if ($sizes === false)
{
$errors .= $_FILES['picture']['name'][$n] . '&nbsp;' . $txt['gallery_error_invalid_picture'] . '<br />';
continue;
}
elseif ((!empty($modSettings['gallery_max_width']) && $sizes[0] > $modSettings['gallery_max_width']) || (!empty($modSettings['gallery_max_height']) && $sizes[1] > $modSettings['gallery_max_height']))
{

if(!empty($modSettings['gallery_resize_image']))
{
//Check to resize image?
DoImageResize($sizes,$_FILES['picture']['tmp_name'][$n]);
$image_resized = 1;
}
else
{
$errors .= $_FILES['picture']['name'][$n] . '&nbsp;' . $txt['gallery_error_img_size_height'] . $sizes[1] . $txt['gallery_error_img_size_width'] . $sizes[0] . '<br />';
// Delete the temp file
@unlink($_FILES['picture']['tmp_name'][$n]);
continue;
}
}
else
{
// Get the filesize
$filesize = $_FILES['picture']['size'][$n];
if(!empty($modSettings['gallery_max_filesize']) && $filesize > $modSettings['gallery_max_filesize'])
{

$errors .= $_FILES['picture']['name'][$n] . '&nbsp;' . $txt['gallery_error_img_filesize'] . $modSettings['gallery_max_filesize'] . '<br />';

// Delete the temp file
@unlink($_FILES['picture']['tmp_name'][$n]);
continue;.....

You go to the "DoImageResize" and than nowhere. The "else" right before "// Get the filesize" is needless.

offtopic: I think that @ini_set("memory_limit","12M"); actually decrease the memory limit because in Subs-Graphics.php is set to 48M
« Last Edit: October 13, 2007, 06:47:45 pm by iosarian »

Offline msensintaffar

  • Member
  • *
  • Posts: 9
    • View Profile
Re: Bulk upload resize?
« Reply #6 on: October 30, 2007, 02:02:48 pm »
Anything else on this? I really would like to get this accomplished.

Offline iosarian

  • Member
  • *
  • Posts: 24
    • View Profile
Re: Bulk upload resize?
« Reply #7 on: October 31, 2007, 09:18:44 am »
In gallery.php, funcion bulkadd2 find:
Code: [Select]
else
{
$errors .= $_FILES['picture']['name'][$n] . '&nbsp;' . $txt['gallery_error_img_size_height'] . $sizes[1] . $txt['gallery_error_img_size_width'] . $sizes[0] . '<br />';
// Delete the temp file
@unlink($_FILES['picture']['tmp_name'][$n]);
continue;
}
}
else
{

Change to:
Code: [Select]
else
{
$errors .= $_FILES['picture']['name'][$n] . '&nbsp;' . $txt['gallery_error_img_size_height'] . $sizes[1] . $txt['gallery_error_img_size_width'] . $sizes[0] . '<br />';
// Delete the temp file
@unlink($_FILES['picture']['tmp_name'][$n]);
continue;
}
}



Find:
Code: [Select]
// Fix height & width of posted image in message
preparsecode($msgOptions['body']);

if(function_exists('parse_bbc'))
createPost($msgOptions, $topicOptions, $posterOptions);
else
AddMsgPost108($title,$msgOptions['body'],$rowcat['ID_BOARD']);
}

Change to:
Code: [Select]
// Fix height & width of posted image in message
preparsecode($msgOptions['body']);

if(function_exists('parse_bbc'))
createPost($msgOptions, $topicOptions, $posterOptions);
else
AddMsgPost108($title,$msgOptions['body'],$rowcat['ID_BOARD']);

Offline msensintaffar

  • Member
  • *
  • Posts: 9
    • View Profile
Re: Bulk upload resize?
« Reply #8 on: November 01, 2007, 09:23:02 am »
Thanks a bunch ISO.

Offline dlomneck

  • Member
  • *
  • Posts: 11
    • View Profile
Re: Bulk upload resize?
« Reply #9 on: November 26, 2007, 02:08:55 am »
Ok, still doesn't work.  I can only use bulk-add if my images are under the size I set in the gallery prefs.  If the image requires resizing, all I get is a blank screen (white screen).  This is really a crippling effect to a very powerful feature of this site. 

error logs show nothing, and PHP is set to display errors, but all I get is a blank page.  I tried doing the above fix, and it didn't correct it.   I have tried uploadin 1, 2, 3, 4, and 5 images at once.  None work if any of them require resizing.  Any hope here????

Thanks

Dave

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Bulk upload resize?
« Reply #10 on: November 26, 2007, 07:56:12 pm »
Figured it turns out it was a memory limit issue.
Fixed for next update.

Hotfix
Open Sources/Gallery.php
Find
Code: [Select]
@ini_set("memory_limit","12M");
Change to
Code: [Select]
@ini_set("memory_limit","30M");


There is more than one place in the code replace each instance.
« Last Edit: November 26, 2007, 08:56:03 pm by SMFHacks »
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 dlomneck

  • Member
  • *
  • Posts: 11
    • View Profile
Re: Bulk upload resize?
« Reply #11 on: November 26, 2007, 09:19:43 pm »
Your fix and iosarian's fix seemed to have allowed me to upload images via the bulk image upload now. 

There seems to be a bug in the way you store the "filesize" information.  All my "bulk image" uploads are showing the wrong filesize.  It's like it is showing the size BEFORE it does the "imagejpeg($image, $filename, 65);" optimization.  The actual size of the file is correct, so I know it's doing the optimization.  But the displayed filesize is wrong.

Any guidance here?

David

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Bulk upload resize?
« Reply #12 on: November 26, 2007, 09:30:53 pm »
Around line 4030 in Sources/Gallery.php
Find
Code: [Select]
// Get the filesize
$filesize = $_FILES['picture']['size'][$n];

Change to
Code: [Select]
// Get the filesize
$filesize = filesize($_FILES['picture']['tmp_name'][$n]);
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 dlomneck

  • Member
  • *
  • Posts: 11
    • View Profile
Re: Bulk upload resize?
« Reply #13 on: November 27, 2007, 03:07:55 am »
That did it :)  Awesome.   So, should I be documenting all these changes, or are they making their way into your future versions? :)

Dave

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Bulk upload resize?
« Reply #14 on: November 27, 2007, 07:06:37 am »
Changes will be in the next update.
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/

 

Related Topics

  Subject / Started by Replies Last post
2 Replies
3834 Views
Last post May 24, 2010, 11:42:51 am
by SMFHacks
4 Replies
4859 Views
Last post September 13, 2010, 02:12:49 pm
by jarska
4 Replies
4428 Views
Last post February 10, 2013, 02:50:11 pm
by Dragracegossip
3 Replies
4221 Views
Last post February 05, 2017, 06:34:57 am
by landyvlad
1 Replies
2490 Views
Last post March 03, 2018, 09:53:33 pm
by SMFHacks

+- Recent Topics

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
Today at 08:27:36 am

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

Powered by EzPortal