[ic] [interchange] Revert "Add image file check mechanism to verify file type before passing to"
Mike Heins
mike at heins.com
Sat May 14 12:28:55 UTC 2016
On Fri, May 13, 2016 at 3:23 PM, David Christensen <
interchange-cvs at icdevgroup.org> wrote:
> commit c5ee9b0690521ccf54c6a186b9841a868a018b92
> Author: David Christensen <david at endpoint.com>
> Date: Fri May 13 14:22:48 2016 -0500
>
> Revert "Add image file check mechanism to verify file type before
> passing to"
>
> Per discussion, this is not Interchange's responsibility.
>
>
Since the image tag does call "mogrify", I would argue that it is the Image
tag's responsibility.
> This reverts commit 68d34396df797232e005e5bd164a1b8e72779bb6.
>
> code/SystemTag/image.tag | 29 +++--------------------------
> 1 files changed, 3 insertions(+), 26 deletions(-)
> ---
> diff --git a/code/SystemTag/image.tag b/code/SystemTag/image.tag
> index f7ec938..6d4de2a 100644
> --- a/code/SystemTag/image.tag
> +++ b/code/SystemTag/image.tag
> @@ -9,15 +9,13 @@ UserTag image Order src
> UserTag image AttrAlias geometry makesize
> UserTag image AttrAlias resize makesize
> UserTag image AddAttr
> -UserTag image Version 1.27
> +UserTag image Version 1.26
> UserTag image Routine <<EOR
> sub {
> my ($src, $opt) = @_;
> my ($image, $path, $secure, $sku);
> my ($imagedircurrent, $imagedir, $imagedirsecure);
>
> - use Image::Size;
> -
> my @descriptionfields = grep /\S/, split /\s+/,
> $opt->{descriptionfields} ||
> $::Variable->{DESCRIPTIONFIELDS} || $Vend::Cfg->{DescriptionField};
> @descriptionfields = qw( description ) if ! @descriptionfields;
> @@ -30,22 +28,6 @@ sub {
> my $filere = qr/\.\w{2,4}$/;
> my $absurlre = qr!^(?i:https?)://!;
>
> - my $verify_image = sub {
> - my $file = shift;
> -
> - return unless -f $file;
> -
> - my ($imgx, $imgy, $error) = imgsize($file);
> -
> - if(! $imgx) {
> - ::logError("Image::Size error on verify-image:
> $error");
> - return undef;
> - }
> -
> - return 1 if ($error =~
> /(jpg|jpeg|gif|png|bmp|tif|ico|xbm)/i);
> - return undef;
> - };
> -
> if ($opt->{ui}) {
> # unless no image dir specified, add locale string
> my $locale = $Scratch->{mv_locale} ? $Scratch->{mv_locale}
> : 'en_US';
> @@ -240,12 +222,6 @@ sub {
> }
> }
> last MOGIT unless $exec;
> -
> - unless ($verify_image->($newpath)){
> - logError("Image file not valid
> image:%s", $newpath);
> - last MOGIT;
> - }
> -
> system qq{$exec -geometry "$siz"
> '$newpath'};
> if($?) {
> logError("%s: Unable to mogrify
> image '%s'", 'image tag', $newpath);
> @@ -265,7 +241,8 @@ sub {
>
> if ($opt->{getsize} and $path) {
> eval {
> - my ($width, $height) = imgsize($path);
> + require Image::Size;
> + my ($width, $height) =
> Image::Size::imgsize($path);
> $opt->{height} = $height
> if defined($height) and not
> exists($opt->{height});
> $opt->{width} = $width
>
> _______________________________________________
> interchange-cvs mailing list
> interchange-cvs at icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-cvs
>
--
The problem with Internet quotations is that many of them
are not genuine. -- Abraham Lincoln
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.icdevgroup.org/pipermail/interchange-users/attachments/20160514/41691478/attachment.html>
More information about the interchange-users
mailing list