From 2bccd339a61f55060cb88c33006c708f1c5aab98 Mon Sep 17 00:00:00 2001 From: plegall Date: Tue, 29 Jun 2010 00:18:40 +0000 Subject: [PATCH] bug 1742 fixed: if the EXIF functions are not available: 1) display a warning (but not an error) 2) avoid to try to read EXIF data git-svn-id: http://piwigo.org/svn/branches/2.1@6621 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/include/functions_upload.inc.php | 4 ++++ admin/photos_add_direct.php | 10 ++++++++++ admin/themes/default/default-layout.css | 10 ++++++++-- admin/themes/default/icon/warnings.png | Bin 0 -> 2241 bytes .../default/template/photos_add_direct.tpl | 11 +++++++++++ 5 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 admin/themes/default/icon/warnings.png diff --git a/admin/include/functions_upload.inc.php b/admin/include/functions_upload.inc.php index a52142d0c..d1aed33ca 100644 --- a/admin/include/functions_upload.inc.php +++ b/admin/include/functions_upload.inc.php @@ -141,6 +141,10 @@ function add_uploaded_file($source_filepath, $original_filename=null, $categorie } // update metadata from the uploaded file (exif/iptc) + if ($conf['use_exif'] and !function_exists('read_exif_data')) + { + $conf['use_exif'] = false; + } update_metadata(array($image_id=>$file_path)); invalidate_user_cache(); diff --git a/admin/photos_add_direct.php b/admin/photos_add_direct.php index 7d094755d..6a7aea884 100644 --- a/admin/photos_add_direct.php +++ b/admin/photos_add_direct.php @@ -443,6 +443,7 @@ $template->assign( // +-----------------------------------------------------------------------+ $setup_errors = array(); +$setup_warnings = array(); $error_message = ready_for_upload_message(); if (!empty($error_message)) @@ -455,9 +456,18 @@ if (!function_exists('gd_info')) array_push($setup_errors, l10n('GD library is missing')); } +if ($conf['use_exif'] and !function_exists('read_exif_data')) +{ + array_push( + $setup_warnings, + l10n('Exif extension not available, admin should disable exif use') + ); +} + $template->assign( array( 'setup_errors'=> $setup_errors, + 'setup_warnings' => $setup_warnings, ) ); diff --git a/admin/themes/default/default-layout.css b/admin/themes/default/default-layout.css index 5458de7ae..344818541 100644 --- a/admin/themes/default/default-layout.css +++ b/admin/themes/default/default-layout.css @@ -822,7 +822,7 @@ h2:lang(en) { text-transform:capitalize; } /** * Informations box in administration */ -.infos, .errors { +.infos, .errors, .warnings { text-align: left; margin: 5px; padding: 10px 50px 10px 10px; @@ -845,7 +845,13 @@ h2:lang(en) { text-transform:capitalize; } background-image: url(icon/errors.png); } -.infos li, .errors li { list-style-type:square; } +.warnings { + color: #ee8800; + background-color:#ffdd99; + background-image: url(icon/warnings.png); +} + +.infos li, .errors li, .warnings li { list-style-type:square; } .infos .submit {margin-left:30px;} .checkActions {text-align:left;padding:0;margin:0;} diff --git a/admin/themes/default/icon/warnings.png b/admin/themes/default/icon/warnings.png new file mode 100644 index 0000000000000000000000000000000000000000..03454e334066c17866e70a9e978d433448a980ae GIT binary patch literal 2241 zcmV;y2tN0TP)$HDO}#A$3N7?NO22!tjMP=yvs)0RTjqDCqYNacYN)FNnA zUQpUnR7FLqM5R_p6)J5dC~8XcKm}4M;bsvCkQm!Z9PFHneQqOZAo+F%|HZ{6v}+=9r~AzGIO9^F+=#e%1Lf!7N>*~|mW zxAoir?soh!N`cL%TBi4#BWt}cob z8zbi z%(JVk9ZP%bh5}ueL-HgdZkWY@2x#&oR?{l#d#biSzb1OaLVepTlyJM7`FZ5}TOm0P z>VT+c{#R@?IYwmLms!)0-nYA{ymGMs2;AQszQ1DA+T{{0L(`|h6gVz<({v135~b|Q zOB;Vs=R5!eK5qcBzdhR3(qZ-luNXpOqxqast-P(fcv3ax*3 zFS)J0x8mAB`+A&@-T~tvVd21p@Y}zGs&C4j+mtQUil!8uIgYiehuU?Au6{9FcKgN` z$9@CYpJ@heX)LSkSekh_wDn6kiBXiCO9l%}$iZ$(#F%DvTb>9Z#f)F{IKDKQm{(F{ZM!|9*GmdF#rMf5F z^YV3_-#yn2ra5Qf*2aDu9Nd8>MqH;0qAr%(eXC1cr~M45DpjS5iVwia&tjvgV+01S zV^!6Md(TzS=K>)3KvUo+(amd?NjQjRPJ0n|oyWNRM;)pnuJg8SpP^Dk*g^1}ck-FA z6ztOw4N|)4lG^)MM)m>0g$5vh>}y!x+-<%c=p8_lBVcS0+l{($JWAMLY?QnPd>V-; zYT2&yMv*{aHXJnd0j75|4XaLk^|>9ro8~L%`2q;{mBsgk2Dez6nE-p*<+{&(aUJ(d zB*s4DxSt8EJk2EFzAu)8__L-E=QyFkE6m#P=wtI0bYR}X?XT!JwY4~t!-yp=cSXP$ z#4_H##{naV2)6AYB6%H%g2_NG<(?I?DafTEn?ZAF$mLMmMymR#?9Q!uCAV%*?=!FN z`=k#2Ns5;rb=EH3zH;XGCELFkB{hm@I$sJ69{>HS;%?qdSef`J!NFH17#kbo+RhQK z>3t7<_XtcLg~V}~J_V^MNXK13b{d=v*a=KS2W20=(_dfS_Pb|~o`_#a1_HNM=6)Kz zs%I&|987-%0SkESV;} zzNYHtSoX1d;AS9uJ^T*`Bu8Yh_;Urw_6QSobi`uci1WbQV6UX#zN3CboQd-2cXsgotlF}nx~J~ z&|NB(b>ocAF#fmTpIe?D-c>Bf}?YR`S$EUm{mapneLqc?69e`(NihPW!*5zcGN6wsY~7$Y;Qv+hCLFV z?c97!Q_xTixi=wq80>e!J_40BULpJ#y3CeMU*Vb<#&opNSpN3ik6gK?$$#nt2;5dW z^Wc)66*c6h(A4BS_NQ~qHZTtQI_M$KUIWIwXHvxf*`i*!rhlEC1g40rZ;0Mfo%w~| zgbiSxULD=sxXOIfYHW1>JVMbzbJeZcKonmWJ7{Ln%Ul^PT2mA6AWee%eE3>B#dLb{ZWyh@G3U!?~G$AP@ko(VWCn!@=hVGnpGq zSwUp1g3{>!E~p%ZTZqE@T6kR?Wm5pcYf0)9Z0MYVxu_?o*GCQ=u6^-T$esi&@yb#? za0##sC|TtHgPZXb^&W7-k4Xq9^(?T+0pz?5$uy9;_z&TW {else} + {if count($setup_warnings) > 0} +
+
    + {foreach from=$setup_warnings item=warning} +
  • {$warning}
  • + {/foreach} +
+
+ {/if} + + {if !empty($thumbnails)}
{'Uploaded Photos'|@translate}