Before you ask please READ THIS

Error Uploading Images

edited October 2014 in Blame Posts: 5
http://dev.redchalkstudios.com/century/
Blame Theme
I'm using the theme right out of the box. Nothing custom has been added.

1) Image upload doesn't work correctly. I just get "Error upload. Please try again later." Then if I exit media and come back, sometimes the image is there (just with no preview) I disabled plugins and still was acting funny, I disable Blame theme and try 2014, works again normally. I checked the error logs and noticed something funny with imagemagick.

php: magick/cache.c:3443: GetVirtualPixels: Assertion `image->signature == 0xabacadabUL' failed

Comments

  • AirAir
    Posts: 10,970
    Hello
    Redchalk said: php: magick/cache.c:3443: GetVirtualPixels: Assertion `image->signature == 0xabacadabUL' failed
    I have searched on google and only thing I came up is this topic https://bugs.php.net/bug.php?id=59465 but it is more of server configuration.
    Redchalk said: 1) Image upload doesn't work correctly. I just get "Error upload. Please try again later."
    I have found some similar topics about that, and it also ended like it is theme fault. However in theme we don't do anything funky about images, just using standard wordpress functions. HOWEVER we add many images sizes(doing it wordpress way), and maybe your server has problem with this exact thing.

    These image sizes are needed for different places in layout, so images would look nice.

    Thing I will write below is not solution but rather debug test, as I have never seen such issue before:
    Please go to blame\advance\apollo13.php line ~185 and delete all this code
    
            add_image_size( 'sidebar-size', 100, 100, true ); //post in sidebar
            add_image_size( 'apollo-post-thumb', 810, 0, true); //post with sidebar
            add_image_size( 'apollo-post-thumb-big', 1080, 0, true); //post without sidebar
            add_image_size( 'apollo-post-short_list', 450, 0, true); //short-list variant of blog
            add_image_size( 'apollo-post-brick', 500, 360, true); //similar posts widget for post type
    
            //blog masonry variant
            $temp_w = $this->get_option( 'blog', 'brick_width' );
            add_image_size( 'apollo-post-masonry_blog', intval($temp_w*1.2), 0, true ); /* better quality for stretched photos*/
    
            //work scroller image
            $temp_h = $this->get_option( 'cpt_work', 'scroller_height' );
            add_image_size( 'work-scroller-image', 0, $temp_h, true );
    
            //work slider image
            $temp_h = $this->get_option( 'cpt_work', 'slider_height' );
            add_image_size( 'work-slider-image', 0, $temp_h, true );
    
            //Custom post types fixed sizes(used on cpt lists)
            add_image_size( 'cpt-cover-big', 525, 380, true );
            add_image_size( 'cpt-cover-medium', 340, 245, true );
            add_image_size( 'cpt-cover-small', 250, 180, true ); //also related works
    
            //work cover masonry
            $temp_w = $this->get_option( 'cpt_work', 'brick_width' );
            $temp_h = $this->get_option( 'cpt_work', 'brick_height' );
            add_image_size( 'work-cover-fluid', intval($temp_w*1.2), intval($temp_h*1.2), true ); /* better quality for stretched photos*/
    
            //Gallery cover masonry
            $temp_w = $this->get_option( 'cpt_gallery', 'gl_brick_width' );
            $temp_h = $this->get_option( 'cpt_gallery', 'gl_brick_height' );
            add_image_size( 'gallery-cover-fluid', intval($temp_w*1.2), intval($temp_h*1.2), true ); /* better quality for stretched photos*/
    
            //Gallery bricks
            $temp_w = $this->get_option( 'cpt_gallery', 'brick_width' );
            $temp_h = $this->get_option( 'cpt_gallery', 'brick_height' );
            add_image_size( 'gallery-bricks', intval($temp_w*1.2), intval($temp_h*1.2), true ); /* better quality for stretched photos*/
    
            //gallery slider image
            $temp_h = $this->get_option( 'cpt_gallery', 'slider_height' );
            add_image_size( 'gallery-slider-image', 0, $temp_h, true );
    
    I suspect that there is problem with resizing images on your server, or there is some limit. I may be wrong!

    Meanwhile I will google about simialr issues.

    With regards.
  • AirAir
    edited October 2014 Posts: 10,970
  • It's on a VPS server.... I previously already upped the PHP resources in php.ini I can try switching the theme to another server and see what happens.

    Thanks for all the info, I will start working my way through! See what the culprit is.
  • AirAir
    Posts: 10,970
    Please try first my debug test that I provided two posts above:-)

    With regards.
  • Hello Air,

    Ok, so I've been trying everything you mentioned. First I upped my php_memory way more than wordpress recommends. (8000M) for testing purposes. Still got the error. Left the memory limit the same and deleted code from apollo13.php still ran into issue.

    Looked at the logs, realized it was Imagemagick burning out from my resources. Basically I solved it by making Imagemagick use one thread instead of unlimited threads and burning up the servers resources.

    Basically all I had to do was add putenv("MAGICK_THREAD_LIMIT=1"); in my php.ini and it works!

    Thanks for the help!
  • AirAir
    Posts: 10,970
    Wow! That are great news. You are one clever man there:-) I will have to mark this topic for future reference if anyone get similar issue. Big thanks for sharing your solution!

    Still I wonder what exactly in theme could make it "burn" processor so much. These all are standard wordpress functions for preparing thumbnails. Hope I will get to solve this mystery someday.

    Thanks again!

    With kind regards.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!