diff options
Diffstat (limited to 'admin/include')
-rw-r--r-- | admin/include/functions.php | 19 | ||||
-rw-r--r-- | admin/include/functions_metadata.php | 22 | ||||
-rw-r--r-- | admin/include/functions_upload.inc.php | 2 | ||||
-rw-r--r-- | admin/include/photos_add_direct_prepare.inc.php | 26 |
4 files changed, 47 insertions, 22 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php index 4d3ccebe6..9a827d1d6 100644 --- a/admin/include/functions.php +++ b/admin/include/functions.php @@ -405,11 +405,7 @@ DELETE FROM '.$table.' } // purge of sessions - $query = ' -DELETE FROM '.SESSIONS_TABLE.' - WHERE data LIKE \'pwg_uid|i:'.(int)$user_id.';%\' -;'; - pwg_query($query); + delete_user_sessions($user_id); // destruction of the user $query = ' @@ -2080,6 +2076,8 @@ function cat_admin_access($category_id) */ function fetchRemote($src, &$dest, $get_data=array(), $post_data=array(), $user_agent='Piwigo', $step=0) { + global $conf; + // Try to retrieve data from local file? if (!url_is_remote($src)) { @@ -2115,6 +2113,17 @@ function fetchRemote($src, &$dest, $get_data=array(), $post_data=array(), $user_ if (function_exists('curl_init') && function_exists('curl_exec')) { $ch = @curl_init(); + + if (isset($conf['use_proxy']) && $conf['use_proxy']) + { + @curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 0); + @curl_setopt($ch, CURLOPT_PROXY, $conf['proxy_server']); + if (isset($conf['proxy_auth']) && !empty($conf['proxy_auth'])) + { + @curl_setopt($ch, CURLOPT_PROXYUSERPWD, $conf['proxy_auth']); + } + } + @curl_setopt($ch, CURLOPT_URL, $src); @curl_setopt($ch, CURLOPT_HEADER, 1); @curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); diff --git a/admin/include/functions_metadata.php b/admin/include/functions_metadata.php index 1b5b5bb73..01b453816 100644 --- a/admin/include/functions_metadata.php +++ b/admin/include/functions_metadata.php @@ -173,8 +173,24 @@ function get_sync_metadata($infos) $infos['filesize'] = floor($fs/1024); + $is_tiff = false; + if (isset($infos['representative_ext'])) { + if ($image_size = @getimagesize($file)) + { + $type = $image_size[2]; + + if (IMAGETYPE_TIFF_MM == $type or IMAGETYPE_TIFF_II == $type) + { + // in case of TIFF files, we want to use the original file and not + // the representative for EXIF/IPTC, but we need the representative + // for width/height (to compute the multiple size dimensions) + $is_tiff = true; + } + + } + $file = original_to_representative($file, $infos['representative_ext']); } @@ -184,6 +200,12 @@ function get_sync_metadata($infos) $infos['height'] = $image_size[1]; } + if ($is_tiff) + { + // back to original file + $file = PHPWG_ROOT_PATH.$infos['path']; + } + if ($conf['use_exif']) { $exif = get_sync_exif_data($file); diff --git a/admin/include/functions_upload.inc.php b/admin/include/functions_upload.inc.php index 17e78a200..900612fdd 100644 --- a/admin/include/functions_upload.inc.php +++ b/admin/include/functions_upload.inc.php @@ -535,7 +535,7 @@ function upload_file_video($representative_ext, $file_path) $ffmpeg_video_exts = array( // extensions tested with FFmpeg 'wmv','mov','mkv','mp4','mpg','flv','asf','xvid','divx','mpeg', - 'avi','rm', + 'avi','rm', 'm4v', 'ogg', 'ogv', 'webm', 'webmv', ); if (!in_array(strtolower(get_extension($file_path)), $ffmpeg_video_exts)) diff --git a/admin/include/photos_add_direct_prepare.inc.php b/admin/include/photos_add_direct_prepare.inc.php index 4d852fee4..a795247e3 100644 --- a/admin/include/photos_add_direct_prepare.inc.php +++ b/admin/include/photos_add_direct_prepare.inc.php @@ -25,25 +25,9 @@ // | Photo selection | // +-----------------------------------------------------------------------+ -$upload_max_filesize = min( - get_ini_size('upload_max_filesize'), - get_ini_size('post_max_size') - ); - -if ($upload_max_filesize == get_ini_size('upload_max_filesize')) -{ - $upload_max_filesize_shorthand = get_ini_size('upload_max_filesize', false); -} -else -{ - $upload_max_filesize_shorthand = get_ini_size('post_max_filesize', false); -} - $template->assign( array( 'F_ADD_ACTION'=> PHOTOS_ADD_BASE_URL, - 'upload_max_filesize' => $upload_max_filesize, - 'upload_max_filesize_shorthand' => $upload_max_filesize_shorthand, 'chunk_size' => $conf['upload_form_chunk_size'], ) ); @@ -222,6 +206,16 @@ if (!isset($_SESSION['upload_hide_warnings'])) get_ini_size('post_max_size', false) ); } + + if (get_ini_size('upload_max_filesize') < $conf['upload_form_chunk_size']*1024) + { + $setup_warnings[] = sprintf( + 'Piwigo setting upload_form_chunk_size (%ukB) should be smaller than PHP configuration setting upload_max_filesize (%ukB)', + $conf['upload_form_chunk_size'], + ceil(get_ini_size('upload_max_filesize') / 1024) + ); + } + $template->assign( array( 'setup_warnings' => $setup_warnings, |