Skip to content

Commit

Permalink
Item14509: fixed broken filter parameter
Browse files Browse the repository at this point in the history
Item14510: really default crop to off
  • Loading branch information
MichaelDaum committed Oct 9, 2017
1 parent 02bd6b7 commit 58bc148
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
1 change: 1 addition & 0 deletions data/System/ImagePlugin.txt
Expand Up @@ -325,6 +325,7 @@ $Foswiki::cfg{ImagePlugin}{AutoAttachExternalImages} = 1;
---++ Change History

%TABLE{columnwidths="7em" tablewidth="100%"}%
| 09 Sep 2017 | fixed filter api; really default crop to off |
| 27 Jul 2017 | removed support for Graphics::Magick ... not worth it and not a 100% drop-in replacement; \
performance: don't deliver image blobs by itself, use a redirect instead; \
removed support for xsendfile protocol as we are redirecting now; \
Expand Down
4 changes: 2 additions & 2 deletions lib/Foswiki/Plugins/ImagePlugin.pm
Expand Up @@ -31,8 +31,8 @@ use Foswiki::Func ();
use Foswiki::Plugins ();
use Foswiki::Plugins::ImagePlugin::Core;

our $VERSION = '8.00';
our $RELEASE = '27 Jul 2017';
our $VERSION = '8.01';
our $RELEASE = '09 Sep 2017';
our $NO_PREFS_IN_TOPIC = 1;
our $SHORTDESCRIPTION = 'Image and thumbnail services to display and alignment images using an easy syntax';
our $core;
Expand Down
19 changes: 12 additions & 7 deletions lib/Foswiki/Plugins/ImagePlugin/Core.pm
Expand Up @@ -36,6 +36,7 @@ use MIME::Base64 ();
use File::Temp ();
use URI ();
use Encode ();
use Image::Magick ();

use constant TRACE => 0; # toggle me

Expand Down Expand Up @@ -77,15 +78,19 @@ sub new {
###############################################################################
sub mage {
my $this = shift;

unless ($this->{mage}) {
require Image::Magick;
$this->{mage} = Image::Magick->new(@_);
}

$this->{mage} = $this->createImage(@_) unless $this->{mage};

return $this->{mage};
}

###############################################################################
sub createImage {
my $this = shift;

return Image::Magick->new(@_);
}

###############################################################################
sub filter {
my $this = shift;
Expand Down Expand Up @@ -510,7 +515,7 @@ sub processImage {
my ($this, $imgWeb, $imgTopic, $imgFile, $params, $doRefresh) = @_;

my $size = $params->{size} || '';
my $crop = $params->{crop} || '';
my $crop = $params->{crop} || 'off';
my $zoom = $params->{zoom} || 'off';
my $width = $params->{width} || '';
my $height = $params->{height} || '';
Expand Down Expand Up @@ -1218,7 +1223,7 @@ sub isWebby {
sub isFramish {
my $file = shift;

return 1 if isVideo($file) || $file =~ /\.(tiff|pdf|ps|psd)$/i;
return 1 if isVideo($file) || $file =~ /\.(tiff?|pdf|ps|psd)$/i;
return 0;
}

Expand Down

0 comments on commit 58bc148

Please sign in to comment.