Example #1
0
         }
         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.
             $image_data['image_has_exif'] = phpbb_gallery_exif::AVAILABLE;
             $image_data['image_exif_data'] = '';
         }
         $image_data['image_filesize'] = $image_file->filesize;
         if ($image_data['image_filesize'] > 1.2 * phpbb_gallery_config::get('max_filesize')) {
             @unlink($image_file->destination_file);
             trigger_error('BAD_UPLOAD_FILE_SIZE');
         }
         $image_data = phpbb_gallery_misc::upload_image($image_data, $album_id);
         $image_id = $image_data['image_id'];
         $image_name = $image_data['image_name'];
         $image_id_ary[] = $image_id;
     }
 }
 $image_id = $images > 1 ? 0 : $image_id;
 // Complete... now send a message to user
 if ($images < 1) {
     $error .= ($error ? '<br />' : '') . $user->lang['UPLOAD_NO_FILE'];
 } else {
     phpbb_gallery_misc::notification('album', $album_id, $image_name);
     phpbb_gallery_image::handle_counter($image_id_ary, true);
     $sql = 'UPDATE ' . GALLERY_ALBUMS_TABLE . " \n\t\t\t\t\t\t\tSET album_images_real = album_images_real + {$images}\n\t\t\t\t\t\t\tWHERE album_id = {$album_id}";
     $db->sql_query($sql);
 }