Commit a2be2a61 authored by Jonny Bradley's avatar Jonny Bradley

[FIX] images: Strict: Non-static methods in Image classes should not be called...

[FIX] images: Strict: Non-static methods in Image classes should not be called statically (not easy to fix inside the Image classes as it seems to have been designed to work that way)
parent 7967a311
......@@ -253,11 +253,12 @@ if ( isset($_GET['preview']) || isset($_GET['thumbnail']) || isset($_GET['displa
$format = substr($info['filename'], strrpos($info['filename'], '.') + 1);
// Fallback to an icon if the format is not supported
if ( ! Image::is_supported($format) ) {
$tmp = new Image('img/icons/pixel_trans.gif', true, 'gif'); // needed to call non-static Image functions non-statically
if ( ! $tmp->is_supported($format) ) {
// Is the filename correct? Maybe it doesn't have an extenstion?
// Try to determine the format from the filetype too
$format = substr($info['filetype'], strrpos($info['filetype'], '/') + 1);
if ( ! Image::is_supported($format) ) {
if ( ! $tmp->is_supported($format) ) {
$_GET['icon'] = 'y';
$_GET['max'] = 32;
}
......@@ -278,8 +279,8 @@ if ( isset($_GET['preview']) || isset($_GET['thumbnail']) || isset($_GET['displa
$icon_y = isset($_GET['y']) ? $_GET['y'] : 0;
}
$content = Image::icon($format, $icon_x, $icon_y);
$format = Image::get_icon_default_format();
$content = $tmp->icon($format, $icon_x, $icon_y);
$format = $tmp->get_icon_default_format();
$info['filetype'] = 'image/'.$format;
$info['lastModif'] = 0;
}
......@@ -328,7 +329,7 @@ if ( isset($_GET['preview']) || isset($_GET['thumbnail']) || isset($_GET['displa
}
// We change the image format if needed
if ( isset($_GET['format']) && Image::is_supported($_GET['format']) ) {
if ( isset($_GET['format']) && $image->is_supported($_GET['format']) ) {
$image->convert($_GET['format']);
} elseif ( isset($_GET['thumbnail']) ) {
// Or, if no format is explicitely specified and a thumbnail has to be created, we convert the image to the $thumbnail_format
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment