• Resolved loveglass

    (@loveglass)


    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

Viewing 3 replies - 16 through 18 (of 18 total)
  • Thread Starter loveglass

    (@loveglass)

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

    Thread Starter loveglass

    (@loveglass)

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, [email protected] 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

    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.

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘image processing.php line 12 PLS HELP.’ is closed to new replies.