示例#1
0
 $exif->read();
 $image_data['image_exif_data'] = $exif->serialized;
 $image_data['image_has_exif'] = $exif->status;
 unset($exif);
 /// Rotate the image
 if (phpbb_gallery_config::get('allow_rotate')) {
     $image_tools->rotate_image($rotate[$i], phpbb_gallery_config::get('allow_resize'));
     if ($image_tools->rotated) {
         $image_file->height = $image_tools->image_size['height'];
         $image_file->width = $image_tools->image_size['width'];
     }
 }
 // Resize overside images
 if ($image_file->width > phpbb_gallery_config::get('max_width') || $image_file->height > phpbb_gallery_config::get('max_height')) {
     if (phpbb_gallery_config::get('allow_resize')) {
         $image_tools->resize_image(phpbb_gallery_config::get('max_width'), phpbb_gallery_config::get('max_height'));
         if ($image_tools->resized) {
             $image_file->height = $image_tools->image_size['height'];
             $image_file->width = $image_tools->image_size['width'];
         }
     } else {
         @unlink($image_file->destination_file);
         trigger_error('UPLOAD_IMAGE_SIZE_TOO_BIG');
     }
 }
 if ($image_tools->resized || $image_tools->rotated) {
     $image_tools->write_image($image_file->destination_file, phpbb_gallery_config::get('jpg_quality'), true);
     $image_file->filesize = $image_tools->image_size['file'];
 }
 if (!$image_tools->exif_data_force_db && $image_data['image_has_exif'] == phpbb_gallery_exif::DBSAVED) {
     // Image was not resized, so we can pull the Exif from the image to save db-memory.