Sign in to follow this  
Followers 0
sirhc

Out of memory resizing image

2 posts in this topic

Hi,

I have a big image in my image field and want to resize it to 2280px before showing it to the user.

Most images are fine and showing as expected, but with one I have the following error;

Error: Out of memory (allocated 159383552) (tried to allocate 12288 bytes) (line 243 of /htdocs/process/wire/core/ImageSizerEngineGD.php) 

Why is this with one image and not with the other ones, and how to solve this?

Greetz.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By jothanne
      I have a problem realizing a picture gallery with albums using repeater fields.
      Here is what I have:
      - The repeater field 'repeater_gallery' for all the albums
      - A text field 'album_name' in the repeater for the album name
      - An image field 'album_images' in the repeater for all the album images
      Now I'd like to pick a small selection of images (say 4) of ALL albums randomly and present them with their associated album name.
      How can this be done with the described repeater setup? Or is there a better way to realize such a gallery without repeaters?
      Thanks in advance for a little help.
    • By Dennis Spohr
      Hi all,
      in the backend of ProcessWire it's possible to define a maximum width and height for images. If you upload an image, it will be resized automatically. I find this feature very handy to safe space. Very often users upload images which are much bigger than needed.
      On my application users can upload their images via the frontend. But if you upload images using the API, images won't be resized automatically.
      Is there any way to do this?
      Currently that's my code:
      if ($_FILES['thumbnail']['name']) { $upload = new WireUpload('thumbnail'); $upload->setMaxFiles(1); $upload->setOverwrite(true); $upload->setDestinationPath($lesson->video_image->path()); $upload->setValidExtensions(array('jpg', 'jpeg', 'png')); $lesson->video_image->removeAll(); foreach ($upload->execute() as $file) $lesson->video_image->add($file); } Thanks very much!
      Dennis
    • By Peter Knight
      I have a page that's throwing an error because some of the pages in the for each loop don't have an image
      The docs say it's wise to check that an image has content and only then try to output something.
      I thought the following would work with the if($image) below.
       
      $products = $page->children(); foreach ($products as $prod){ $image = $prod->images->first(); echo" <div > <div class='prod-ov-wrapper'>"; if($image) echo " <a href='$prod->url'> <img src='{$image->height(160)->url}' class='prod-preview'> </a>"; echo" <div class='prod-ov-text'> <strong>Part No:</strong>{$prod->title} <br/> {$prod->prod_summary} <a href='$prod->url' class='uk-icon-button' uk-icon='icon: chevron-right'></a> </div> </div> </div> ";} What am I overlooking here? Thanks
    • By FrancisChung
      Hi PW Community,
      I have a problem where a page is loading up fine on my local dev machine + 1 of the test sites, but not on another test site.

      They have identical PW (2.8.35?) and codebase installed.
      The 2 sites are hosted on the same hosting provider, as well as our other sites.
      1) Error Logs. There is nothing particularly strange logged on the PW Error log for all the sites. I am getting a "You must assign a template to the page before setting custom field values (title__data) [pageClass=Page, template=] (WireLog)" error, but I'm getting this error on working pages as well.
       However, there are some errors in our Hosting Provider's log. The error seems to point at some sort of permissioning issue regarding reading the image files?
      1.a) File / Dir permissions of Images  - I've checked file permissions on the normal and problematic sites. They are all identical
      2) .htaccess  -  I've tried running the .htaccess file from the working site on the problematic site - No Luck
      3)  codebase - I've done 3 comparisons. They are identical on all sites.
      4) wire directory - See above
      5) Behaviour - So the problematic site loads up most of its page as expected without problems. It's just a couple that it has issues with.
       
      Problematic URL Example  : http://kinder-reime.com/kindergedichte/kategorien/gedichte-fuer-kindergarten-und-schule/
      Working URL : http://finger-spiele.com/kindergedichte/kategorien/gedichte-fuer-kindergarten-und-schule/
      I've also attached the KIS Error Logs.
      Has anyone come across  behaviour like this before and what would be the way forward to fix this?
      KIS.Error.Logs
    • By cgohio
      We had an outside vendor help develop our website.  The vendor has closed their business.  I'm trying to modify 1 of the images near the bottom of our website but can't figure out how.  We're new to processwire.  I see how I can modify the individual pages but can't seem to figure out where to go to change this image n www.gchbs.com near the bottom  I attached the image that I need to change.  Thanks in advance for any of your help!