Solved

Problem uploading images with Joomla Estate Agency (Joomla component)

Posted on 2013-06-20
16
1,408 Views
Last Modified: 2013-07-22
Hi,

I've installed Joomla Estate Agency (JEA) version 2.30 on my joomla version  2.5.4 website. When I attempt to upload 2 images to site via JEA list property I get the following error

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 18432 bytes) in <joomla installation folder>/libraries/joomla/image/image.php on line 392

Line 392 of image.php :
// Attempt to create the image handle.
                        $handle = imagecreatefromjpeg($path);
                        if (!is_resource($handle))
                        {
                              // @codeCoverageIgnoreStart
                              throw new RuntimeException('Unable to process JPG image.');
                              // @codeCoverageIgnoreEnd
                        }
                        $this->handle = $handle;
                        break;


I have the following settings in the loaded php.ini file
memory_limit = 128M
post_max_size = 10M
upload_max_filesize = 10M

How can I fix this problem?
0
Comment
Question by:mavcom
  • 6
  • 5
  • 3
16 Comments
 
LVL 28

Accepted Solution

by:
chilternPC earned 250 total points
ID: 39264651
the images you are uploading are too big.
you need to resize them before you upload

if you haven't got a graphics program that can resize for web...
google image resizer  and install and use to resize you image to around 1200 x 800 pixels


then upload these web friendly photos  (they should not be bigger than 1200 px wide)
0
 

Author Comment

by:mavcom
ID: 39265792
Hi

Thanks. Is there a script I can use to check the file size before attempting to upload?

What is a good real estate component for joomla that allows users to add their properties?
0
 
LVL 28

Assisted Solution

by:chilternPC
chilternPC earned 250 total points
ID: 39265815
in wondows just right click on the image file and click on properties
or hover over the file name (windows) and it will tell you the size
or simply use the file manager to list the images the folder listing can e configured to show the size.

its not free but this si good:
http://extensions.joomla.org/extensions/vertical-markets/real-estate/1790
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 109

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 total points
ID: 39265897
You might focus on this:

memory_limit = 128M

Try making that MUCH larger (Start with 512M).  I think the other upload and post-related limits are OK if the files are getting uploaded and the failure is happening after the upload, as the script attempts to create an image resource.

PHP has some bizarre internal data structures.  For example, a text file that is read into memory may occupy a value equal to its file size.  But convert the text file to an array by using explode() and it balloons up to 20X file size.  There may be something similar going on with imageCreateFromJPEG().

You may also want to inspect the program logic surrounding the use of the variables that are created with the imageCreate() functions.  There is a corresponding imageDestroy() function that needs to be called to release the memory.  In the code sample shown above, I would try it like this.

// Attempt to create the image handle.
                        $handle = imagecreatefromjpeg($path);
                        if (!is_resource($handle))
                        {
                              // @codeCoverageIgnoreStart
                              throw new RuntimeException('Unable to process JPG image.');
                              // @codeCoverageIgnoreEnd
                        }
                        $this->handle = $handle;
                        imageDestroy($handle); // RELEASE THE UNUSED LOCAL VARIABLE
                        break;

Open in new window

0
 

Author Comment

by:mavcom
ID: 39265950
Hi,

Adding imageDestroy($handle); // RELEASE THE UNUSED LOCAL VARIABLE didn't help.
0
 
LVL 109

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 total points
ID: 39265973
Try running this script again using a very, very small image.  If that works, raise the memory limit to 512M and have a go with the larger image.

If you want to post a URL link to the image that's causing the failure I will be glad to experiment with it and see if I can load the image resource.
0
 

Author Comment

by:mavcom
ID: 39271650
Hi

Thanks for the assistance, but it appears that there might be something wrong with the images, because i've uploaded larger image files without getting the error.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39271669
memory size of 134217728 bytes exhausted
That's pretty unambiguous.  Please post the URL of some of the images that are causing problems.  I will try uploading them to my server so we can see if the image files are the problem.
0
 

Author Comment

by:mavcom
ID: 39318480
problem was solved but thanks for your assistance.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39318704
I don't know why you gave us the worst possible grade anyone can give at EE. We tried ot hep you and you did not follow our suggestions or respond to our requests for information.  Please see the grading guidelines here.
http://support.experts-exchange.com/customer/portal/articles/481419

I will ask a moderator to reopen the question so you can show us your solution and accept your own answer.
0
 
LVL 28

Expert Comment

by:chilternPC
ID: 39319521
I think what  Ray_Paseur is trying to say is you have accepted comments as solutions which  would not help any visiting customer with the same problem, i.e. you have given  Ray_Paseur 100 points for asking to see one of the images. not really helpful to others.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39320764
If the author can post an answer that explains why our suggestions were not helpful (and shows how the issue was resolved) I would recommend B for that answer.  Otherwise recommend A.
0
 

Author Comment

by:mavcom
ID: 39343766
I've requested that this question be deleted for the following reason:

No solution was found.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39344431
10-4.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question