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
This commit is contained in:
parent
46e324e582
commit
2bccd339a6
5 changed files with 33 additions and 2 deletions
|
@ -141,6 +141,10 @@ function add_uploaded_file($source_filepath, $original_filename=null, $categorie
|
||||||
}
|
}
|
||||||
|
|
||||||
// update metadata from the uploaded file (exif/iptc)
|
// 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));
|
update_metadata(array($image_id=>$file_path));
|
||||||
|
|
||||||
invalidate_user_cache();
|
invalidate_user_cache();
|
||||||
|
|
|
@ -443,6 +443,7 @@ $template->assign(
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
|
|
||||||
$setup_errors = array();
|
$setup_errors = array();
|
||||||
|
$setup_warnings = array();
|
||||||
|
|
||||||
$error_message = ready_for_upload_message();
|
$error_message = ready_for_upload_message();
|
||||||
if (!empty($error_message))
|
if (!empty($error_message))
|
||||||
|
@ -455,9 +456,18 @@ if (!function_exists('gd_info'))
|
||||||
array_push($setup_errors, l10n('GD library is missing'));
|
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(
|
$template->assign(
|
||||||
array(
|
array(
|
||||||
'setup_errors'=> $setup_errors,
|
'setup_errors'=> $setup_errors,
|
||||||
|
'setup_warnings' => $setup_warnings,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -822,7 +822,7 @@ h2:lang(en) { text-transform:capitalize; }
|
||||||
/**
|
/**
|
||||||
* Informations box in administration
|
* Informations box in administration
|
||||||
*/
|
*/
|
||||||
.infos, .errors {
|
.infos, .errors, .warnings {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
padding: 10px 50px 10px 10px;
|
padding: 10px 50px 10px 10px;
|
||||||
|
@ -845,7 +845,13 @@ h2:lang(en) { text-transform:capitalize; }
|
||||||
background-image: url(icon/errors.png);
|
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;}
|
.infos .submit {margin-left:30px;}
|
||||||
|
|
||||||
.checkActions {text-align:left;padding:0;margin:0;}
|
.checkActions {text-align:left;padding:0;margin:0;}
|
||||||
|
|
BIN
admin/themes/default/icon/warnings.png
Normal file
BIN
admin/themes/default/icon/warnings.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
|
@ -216,6 +216,17 @@ var buttonText = 'Browse';
|
||||||
</div>
|
</div>
|
||||||
{else}
|
{else}
|
||||||
|
|
||||||
|
{if count($setup_warnings) > 0}
|
||||||
|
<div class="warnings">
|
||||||
|
<ul>
|
||||||
|
{foreach from=$setup_warnings item=warning}
|
||||||
|
<li>{$warning}</li>
|
||||||
|
{/foreach}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
|
||||||
{if !empty($thumbnails)}
|
{if !empty($thumbnails)}
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>{'Uploaded Photos'|@translate}</legend>
|
<legend>{'Uploaded Photos'|@translate}</legend>
|
||||||
|
|
Loading…
Add table
Reference in a new issue