WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] image processing.php line 12 PLS HELP. (19 posts)

  1. loveglass
    Member
    Posted 4 years ago #

    Hi, I am having a problem with uploading product images. It gives me error with "Fatal error: Out of memory (allocated 34078720) (tried to allocate 13056 bytes) in /homepages/7/d259763837/htdocs/wordpress/wp love-glass/wp-content/plugins/wp-e-commerce/image_processing.php on line 12"
    When I go to Editing wp-e-commerce/image_processing.php it tells me it's inactive?! I don't know why and where I shall switch it on? And then I don't understand what's wrong on line 12? Could you pls have a look and help with it?!
    <?php
    function image_processing($image_input, $image_output, $width = null, $height = null,$imagefield='') {
    global $wpdb;
    /*
    * this handles all resizing of images that results in a file being saved, if no width and height is supplied, then it just copies the image
    */
    $imagetype = getimagesize($image_input);
    if(file_exists($image_input) && is_numeric($height) && is_numeric($width) && function_exists('imagecreatefrompng') && (($height != $imagetype[1]) && ($width != $imagetype[0]))) {
    switch($imagetype[2]) {
    case IMAGETYPE_JPEG:
    //$extension = ".jpg";
    $src_img = imagecreatefromjpeg($image_input);
    $pass_imgtype = true;
    break;

    Thanks for help

  2. Samuel B
    moderator
    Posted 4 years ago #

    fix the memory issue 1st
    add this line to wp-config.php

    define('WP_MEMORY_LIMIT', '64M');

  3. loveglass
    Member
    Posted 4 years ago #

    Oh, thank you. Trouble is I don't know where to edit wp-config.php?!?! Where is it?

  4. Samuel B
    moderator
    Posted 4 years ago #

    in your wordpress root

  5. loveglass
    Member
    Posted 4 years ago #

    in file wp-config.php does it matter where I will paste the line or not? and also I remember, last time when I was editing wp-config. there was some trick about saving file and putting back on ftp account? thank you

  6. Samuel B
    moderator
    Posted 4 years ago #

    put the line right after

    <?php
    // ** MySQL settings ** //

    if editing in host's file manager - just save it

    if you downloaded to your computer - save it and upload it back to site

  7. loveglass
    Member
    Posted 4 years ago #

    thank you very much, appreciate your help.
    will do :-)

  8. loveglass
    Member
    Posted 4 years ago #

    after i've done what you said it's still giving me this error

    Fatal error: Out of memory (allocated 34078720) (tried to allocate 3264 bytes) in /homepages/7/d259763837/htdocs/wordpress/wp love-glass/wp-content/plugins/wp-e-commerce/image_processing.php on line 12
    any ideas?

  9. Samuel B
    moderator
    Posted 4 years ago #

    try changing 64M to 96M

  10. loveglass
    Member
    Posted 4 years ago #

    stiil the same

    // ** MySQL settings - You can get this info from your web host ** //
    define('WP_MEMORY_LIMIT', '96M');
    /** The name of the database for WordPress */
    define('DB_NAME', 'db301422293');

    is there something wrong?

    thank u

  11. Samuel B
    moderator
    Posted 4 years ago #

    well then your host must not allow this method
    ask them to bump the php memory for you

  12. loveglass
    Member
    Posted 4 years ago #

    ok thanks

  13. loveglass
    Member
    Posted 4 years ago #

    Do you know why is it trying to allocate the image in d259763837 when my db is db301422293')? My available storage space is 99.4 MB. :|

  14. Samuel B
    moderator
    Posted 4 years ago #

    d259763837 is just a server designation - nothing to do with amount of space

    the error is specific to low php memory

  15. Lee Willis
    Member
    Posted 4 years ago #

    Try doing it by adding the following line in your .htaccess file:

    php_value memory_limit 64M

  16. loveglass
    Member
    Posted 4 years ago #

    i couldn't get the .htaccess file from server through Fetch. I remember i have to rename it or something like that. What's the trick guys pls. thanks ps. working in mac

  17. loveglass
    Member
    Posted 4 years ago #

    i've got it. does it matter which line I paste it? thanks

  18. loveglass
    Member
    Posted 4 years ago #

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, webadmin@kundenserver.de and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

    i put as last line php_value memory_limit 64M and that's appeared

  19. GKauten
    Member
    Posted 4 years ago #

    How big is the file size on the image you are trying to upload? I have seen this happen quite a few times when people will upload images from their cameras or something which are usually upwards of a MB. The resize functions then have to load this full file size into memory on top of the other memory it already needs to allocate to create the various resized outputs.

    I might suggest resizing the picture you are uploading so that the dimensions of your source file you wish to upload match that of the dimensions of the largest picture of your website. For example, resize the image from your computer to match whatever you have the dimensions set for the single product page image.

    Settings -> Presentation -> Thumbnail Settings: Single Product Image Size

    This will likely greatly reduce the file size of the image before even uploading it to the site, making it easier on the image-processing.php file and allowing you to work with the memory limits set upon you by your hosting server.

Topic Closed

This topic has been closed to new replies.

About this Topic