We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Question, Problem, Error

problems resizing/uploading jpg files

I haven't had any issues on my development server, but on the staging server, I started running into this issue:

When uploading .jpg files, the file uploads, but screen stay white, and never gets updated on the CMS. I reverted back to the generic Image in content, and same thing happened. I tried a .png file, and didn't have any issues.

In addition, I decided to upgrade to 2.5 and try again. When I went to upload the file, it opened the Assets menu, and when I attempted to upload a .jpg image, a red X appeared on the picture.

Again no issues with .png files. Any ideas where I can look? The config files on the filetypes.ini are the same on both locations.

Thanks.

Linda Keele

Linda Keele 0 points

  • 5 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

How large are the files you are trying to upload?

Can you post your Diagnostics Report? Under Settings in Perch Admin, if you are on 2.5 the Short Version will be fine.

I tried a few .JPG files, and the largest was only 109KB and the others were 30-39KB. So very small. The .PNG files were bigger, so it wasn't the file size, as server can handle up to 2 MB with current settings.

Here's the report: Viewing Diagnostic Information Diagnostics report Health check

PHP 5.4.27 is up to date
MySQL 5.5.13 is up to date
Image processing available
File upload size is low. You can only upload files up to 2M.

Summary information

Perch: 2.5, PHP: 5.4.27, MySQL: 5.6.11, with PDO
Server OS: Linux, apache2handler
Installed apps: content (2.5), assets (2.5)
App runtimes: <?php include(PERCH_PATH.'/core/apps/content/runtime.php'); ?>
PERCH_LOGINPATH: /gacc/sacc/saccadmin
PERCH_PATH: /srv/www/htdocs/gacc/sacc/saccadmin
PERCH_CORE: /srv/www/htdocs/gacc/sacc/saccadmin/core
PERCH_RESFILEPATH: /srv/www/htdocs/gacc/sacc/resources
Image manipulation: GD
PHP limits: Max upload 2M, Max POST 8M, Memory: 512M, Total max file upload: 2M
Resource folder writeable: Yes
HTTP_HOST: www.mydomain.com
DOCUMENT_ROOT: /srv/www/htdocs
REQUEST_URI: /gacc/sacc/saccadmin/core/settings/diagnostics/
SCRIPT_NAME: /gacc/sacc/saccadmin/core/settings/diagnostics/index.php
Drew McLellan

Drew McLellan 2638 points
Perch Support

What happens when the upload fails?

I mentioned it begin with. It just goes to a white screen and does nothing. No Error. The file is uploaded, but nothing else is done (i.e. resizing/adding to CMS database).

After upgrade, it just shows a red X on the photo in the Asset section.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you checked your php error log?

Unfortunately, I don't have access to view the log files. Was hoping it was something you have come across before.

Drew McLellan

Drew McLellan 2638 points
Perch Support

You're on a brand new version, so it could be something mundane or it could be something we've not seen before.

It looks like you have a high memory limit, but it could be the case that not all that memory is available. The blank white screen tends to mean that PHP has completely failed while processing the request. My hunch is lack of available memory.

What type of hosting is this? Is it shared hosting?

When I get a chance I'll try and contact the IT guys responsible for the serve to see if the memory and file size can be looked at for resources.

This hosting is internal to the company and shared with a few of their other websites.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

It would be worth asking to see the error log when you speak to them as that would give you the information you need to debug this.

I was finally able to get a hold of the IT guy and get the error log. We did a few tests of uploading a .jpg file; and same error was happening. When uploading .png files it works fine. Everything works fine with the settings on the development server, just not on this server.

Below is the errors. I've changed the IP, GET path, and the domain to generic.

10.10.10.10 - - [15/Aug/2014:16:54:58 -0500] "GET /site/path/perch/core/apps/assets/ HTTP/1.1" 200 11928 10.10.10.10 - - [15/Aug/2014:16:54:59 -0500] "GET /site/path/perch/core/assets/css/v2.css?v=2.5.4 HTTP/1.1" 304 - 10.10.10.10 - - [15/Aug/2014:16:54:59 -0500] "GET /site/path/perch/core/assets/css/assets.css?v=2.5.4 HTTP/1.1" 304 - 10.10.10.10 - - [15/Aug/2014:16:54:59 -0500] "GET /site/path/perch/core/assets/css/720.css?v=2.5.4 HTTP/1.1" 304 - 10.10.10.10 - - [15/Aug/2014:16:54:59 -0500] "GET /site/path/perch/core/assets/js/head.min.js?v=2.5.4 HTTP/1.1" 304 - 10.10.10.10 - - [15/Aug/2014:16:54:59 -0500] "GET /site/path/perch/core/assets/js/assets.js?v=2.5.4 HTTP/1.1" 304 - 10.10.10.10 - - [15/Aug/2014:16:54:59 -0500] "GET /site/path/perch/core/assets/js/perch.js?v=2.5.4 HTTP/1.1" 304 - 10.10.10.10 - - [15/Aug/2014:16:54:59 -0500] "GET /site/path/perch/core/inc/js_lang.php HTTP/1.1" 200 993 10.10.10.10 - - [15/Aug/2014:16:54:59 -0500] "GET /site/path/perch/core/inc/js_privs.php HTTP/1.1" 200 538 10.10.10.10 - - [15/Aug/2014:16:55:01 -0500] "GET /site/path/perch/core/apps/assets/edit/ HTTP/1.1" 200 6011 10.10.10.10 - - [15/Aug/2014:16:55:01 -0500] "GET /site/path/perch/core/assets/css/v2.css?v=2.5.4 HTTP/1.1" 304 - 10.10.10.10 - - [15/Aug/2014:16:55:01 -0500] "GET /site/path/perch/core/assets/css/assets.css?v=2.5.4 HTTP/1.1" 304 - 10.10.10.10 - - [15/Aug/2014:16:55:01 -0500] "GET /site/path/perch/core/assets/css/720.css?v=2.5.4 HTTP/1.1" 304 - 10.10.10.10 - - [15/Aug/2014:16:55:01 -0500] "GET /site/path/perch/core/assets/js/head.min.js?v=2.5.4 HTTP/1.1" 304 - 10.10.10.10 - - [15/Aug/2014:16:55:01 -0500] "GET /site/path/perch/core/assets/js/assets.js?v=2.5.4 HTTP/1.1" 304 - 10.10.10.10 - - [15/Aug/2014:16:55:01 -0500] "GET /site/path/perch/core/assets/js/perch.js?v=2.5.4 HTTP/1.1" 304 - 10.10.10.10 - - [15/Aug/2014:16:55:01 -0500] "GET /site/path/perch/core/assets/js/jquery.tagsinput.min.js?_=1408140258252 HTTP/1.1" 200 6400 10.10.10.10 - - [15/Aug/2014:16:55:01 -0500] "GET /site/path/perch/core/inc/js_lang.php HTTP/1.1" 200 993 10.10.10.10 - - [15/Aug/2014:16:55:01 -0500] "GET /site/path/perch/core/inc/js_privs.php HTTP/1.1" 200 538 10.10.10.10 - - [15/Aug/2014:16:55:12 -0500] "POST /site/path/perch/core/apps/assets/edit/ HTTP/1.1" 500 5

[Fri Aug 15 16:55:14.118431 2014] [:error] [pid 28750:tid 140043628828416] [client 10.10.10.10:54493] PHP Fatal error: Call to undefined function imagecreatefromjpeg() in /srv/www/htdocs/site/path/perch/core/lib/PerchImage.class.php on line 463, referer: http://www.site.com/site/path/perch/core/apps/assets/edit/ [Fri Aug 15 16:57:11.381628 2014] [:error] [pid 28752:tid 140043492460288] [client 10.10.10.10:54562] PHP Fatal error: Call to undefined function imagecreatefromjpeg() in /srv/www/htdocs/site/path/perch/core/lib/PerchImage.class.php on line 463, referer: http://www.site.com/site/path/perch/core/apps/assets/edit/

Drew McLellan

Drew McLellan 2638 points
Perch Support

So it's throwing an error because the internal PHP function imagecreatefromjpeg() is missing on your installation. This is part of the GD graphics library, which your server is reporting is installed.

It's a very strange circumstance. Perch won't be able to resize images on this server.

That was the problem. I had the IT person check the PHP installation, specifically the imagecreatefromjpg, and now it works. Thanks for the help.