Image loaded is empty, no exception thrown

Help
Anonymous
2013-03-27
2013-06-26

  • Anonymous
    2013-03-27



     

  • Anonymous
    2013-03-27

    Hi, the post was posted accidentally while i was still editing, and I have no idea where the edit button is.
    Anyway:
    For this project, I need to merge the following:
    1. a base image with some background patten.
    2. a photo load from user facebook album.
    3. a frame png with a hole to fit in the baby face.
    4. deco eyes
    5. deco mouth.

    I have never encountered this situation during development and testing. However, when comes to production, the rate of empty image is quite high. It s about 10%. Appreciate if anyone can point me an direction.

    My code is here:

                  try{
                $base = EWideImage::load(TEMPLATE_PATH);
                $photo= EWideImage::load($photoURL)->resize($adjusted_photo_width,$adjusted_photo_height);
            }catch(Exception $e){
                EcError::printJson(EcError::$SYSTEM_ERROR, $e->getMessage());               
            }
            $result = $base->merge($photo, $adjusted_photo_left, $adjusted_photo_top);
            $base->destroy();
            $photo->destroy();
            //marge the frame
            $frame = EWideImage::load('images/photo-zone/photo-frame'.$frame_id.'.png');
            $result=$result->merge($frame,0,0);
            $frame->destroy();
    
            $deco_eye= EWideImage::load('images/photo-zone/deco/Face_cutomization_eyes'.$eyes_id.'.png');
            $deco_mouth= EWideImage::load('images/photo-zone/deco/Face_customization_Mouths'.$mouth_id.'.png');
            $result=$result->merge($deco_eye,150,265);
            $result=$result->merge($deco_mouth,150,298);
            //save image
            $output_path =UGC_PATH.$submissionId.'.jpg';
            $result->saveToFile($output_path,75);
    
     
  • Gasper Kozak
    Gasper Kozak
    2013-06-26

    Hi, sorry for the late response. Did you manage to make this work?

    I'd start off by saving the $result image in between steps, so you can find out where it goes wrong.