if (validate_username($image_data['username'])) { trigger_error('INVALID_USERNAME'); } } $image_tools = new phpbb_gallery_image_file(); $image_tools->set_image_options(phpbb_gallery_config::get('max_filesize'), phpbb_gallery_config::get('max_height'), phpbb_gallery_config::get('max_width')); $image_tools->set_image_data($image_file->destination_file, $image_data['image_name'], $image_file->filesize); // Read exif data from file $exif = new phpbb_gallery_exif($image_file->destination_file); $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);