Solved

Problem uploading images with Joomla Estate Agency (Joomla component)

Posted on 2013-06-20
16
1,406 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
 
LVL 108

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 108

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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 108

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 108

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 108

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 108

Expert Comment

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

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

First of all, we will need Jumi component or Sourcerer plugin for this to work. We need either of these because the main focus here is custom development outside of the standard modules or articles within Joomla. You can find Jumi here...it's my …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now