News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

max thumbnail size

Started by purper, May 25, 2008, 05:17:06 PM

Previous topic - Next topic

purper

Hi!

I discovered my pictures directly uploaded from the camera, result in trouble:

Those images are 3872x2592, and once uploaded, I do not see a thumbnail being created in the attachment folder. (encryption on)
After the upload the screen stays empty (white), and that also happens everytime you click on the topic. If the admin (me :D) deletes the attachment, the topic is reachable again and can be edited.

Changing quality does not help, but rescaled to 1024x768 works. It might be a good idea to check the image dimensions and prompt an error when there is a max size reached?


Regards,

Richard.

Bulakbol

What is the filesize of the 3872x2592 image?
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

purper

normally around 2 - 3 Megabytes.. I had to change max file size to make that work (obviously)
I'll try a new post, with an attachment, to check what happens... :D

purper

#3
ok, my results:

I posted a new thread in the chitchat section, with an attachment. After the upload is finished (monitored with taskmgr network)  the screen stays white. (just like my own forum)
Back in the chitchat the topic was not there, so I made one with just text, no problemo.

After that I uploaded the image, white screen appears. You can check this yourself: http://www.simplemachines.org/community/index.php?topic=245014.0
There should be a picture named DSC_0075.JPG in the attachment directory (if encryption if off ;) ) but NO tumbnail. And i suspect that is the reason the post stays completely white.

Good luck investigating... I did not try this on 1.x version forum yet..

Regards,

Richard

Ow, and just in case.. The forum is running on a 2003 server machine, with xampp installed and admin rights.. Plenty of harddisc space available (obviously)

SleePy

Thanks, Bug #2229: Large resolution images can cause pages to fail

Can you upload the original somewhere? So that way we have this for reference and while attempting to fix the bug?
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

purper

Hi!

You can find it at http://purper.mine.nu/plaatjus/DSC_0075.JPG

Hope this is a positive tribute to SMF!

Regards,

Richard.

JayBachatero

Most likely, PHP is running out of memory.  Here you will not get a PHP error since we have errors off, but check in your error log to see if you get something like Fatal error: Allowed memory size of XXXXX bytes exhausted (tried to allocate XXXX bytes)
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

purper

Where can I find this log? :o   I looked around in php admin, but there are a lot of smf log entries there..???

SleePy

It is a fatal error, SMF can't catch this error. So look in your php error logs. Your Host should know where these are and tell you how to access them.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

purper

Hihihihi... I AM the host... so I will look into this...
XAMPP might use default directories or whatever. I tried looking for a .log file, but did not find anything that even looked like it (yet) :-\

SleePy

It won't end in a .log most likely.

it would say something like error_log by default.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

purper

#11
I changed the php.ini and it now looks like this. When I attached the picture to a message, no error shows, and the error file is not in the directory expected..  ??? ??? ::)

Did you find that same error on this forum btw?

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; error_reporting is a bit-field.  Or each number up to get desired error
; reporting level
; E_ALL             - All errors and warnings (doesn't include E_STRICT)
; E_ERROR           - fatal run-time errors
; E_WARNING         - run-time warnings (non-fatal errors)
; E_PARSE           - compile-time parse errors
; E_NOTICE          - run-time notices (these are warnings which often result
;                     from a bug in your code, but it's possible that it was
;                     intentional (e.g., using an uninitialized variable and
;                     relying on the fact it's automatically initialized to an
;                     empty string)
; E_STRICT         - run-time notices, enable to have PHP suggest changes
;                     to your code which will ensure the best interoperability
;                     and forward compatibility of your code
; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
;                     initial startup
; E_COMPILE_ERROR   - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR      - user-generated error message
; E_USER_WARNING    - user-generated warning message
; E_USER_NOTICE     - user-generated notice message
;
; Examples:
;
;   - Show all errors, except for notices and coding standards warnings
;
;error_reporting = E_ALL & ~E_NOTICE
;
;   - Show all errors, except for notices
;
;error_reporting = E_ALL & ~E_NOTICE | E_STRICT
;
;   - Show only errors
;
;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
;
;   - Show all errors except for notices and coding standards warnings
;
error_reporting  =  E_ALL & ~E_NOTICE

; Print out errors (as a part of the output).  For production web sites,
; you're strongly encouraged to turn this feature off, and use error logging
; instead (see below).  Keeping display_errors enabled on a production web site
; may reveal security information to end users, such as file paths on your Web
; server, your database schema or other information.
display_errors = Off

; Even when display_errors is on, errors that occur during PHP's startup
; sequence are not displayed.  It's strongly recommended to keep
; display_startup_errors off, except for when debugging.
display_startup_errors = Off

; Log errors into a log file (server-specific log, stderr, or error_log (below))
; As stated above, you're strongly advised to use error logging in place of
; error displaying on production web sites.
log_errors = On

; Set maximum length of log_errors. In error_log information about the source is
; added. The default is 1024 and 0 allows to not apply any maximum length at all.
log_errors_max_len = 1024

; Do not log repeated messages. Repeated errors must occur in same file on same
; line until ignore_repeated_source is set true.
ignore_repeated_errors = Off

; Ignore source of message when ignoring repeated messages. When this setting
; is On you will not log errors with repeated messages from different files or
; sourcelines.
ignore_repeated_source = Off

; If this parameter is set to Off, then memory leaks will not be shown (on
; stdout or in the log). This has only effect in a debug compile, and if
; error reporting includes E_WARNING in the allowed list
report_memleaks = On

; Store the last error/warning message in $php_errormsg (boolean).
track_errors = Off

; Disable the inclusion of HTML tags in error messages.
; Note: Never use this feature for production boxes.
;html_errors = Off

; If html_errors is set On PHP produces clickable error messages that direct
; to a page describing the error or function causing the error in detail.
; You can download a copy of the PHP manual from http://www.php.net/docs.php
; and change docref_root to the base URL of your local copy including the
; leading '/'. You must also specify the file extension being used including
; the dot.
; Note: Never use this feature for production boxes.
;docref_root = "/phpmanual/"
;docref_ext = .html

; String to output before an error message.
;error_prepend_string = "<font color=ff0000>"

; String to output after an error message.
;error_append_string = "</font>"

; Log errors to specified file.
error_log = "C:\xampp\apache\logs\phperror.log"

; Log errors to syslog (Event Log on NT, not valid in Windows 95).
error_log = syslog

JayBachatero

Change display_errors = Off to display_errors = On

That should show you the error.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

purper

Tnx, I must have missed that... Unfortunately when attaching an image now, no error log is made :(
So there might not be a PHP error at all? :/

JayBachatero

You just get a white page?  I'll test this out more tonight when I get home.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

purper

a white page indeed.. I posted the image on this forum too, same result.. The link is in the bug form..

JayBachatero

Finally got around to this one.  It's a memory limit issue.  PHP is running out of memory when trying to create the thumbnail.

Code (Subs-Graphics.php) Select

// Ask for more memory: we need it for this, and it'll only happen once!
@ini_set('memory_limit', '48M');

Change to
Code (Subs-Graphics.php) Select

// Ask for more memory: we need it for this, and it'll only happen once!
@ini_set('memory_limit', '256M');
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

purper

Nice job! This works like a charm! Now all my old threads are readable with tumbnails :D

Tnx very much for all you're help!

Advertisement: