Win32-ShellExt

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

my $samples = {
	       CtxtMenu::Base64Decode => { 'MIME::Base64' => 2.12 },				# ok
	       CtxtMenu::Base64Encode => { 'MIME::Base64' => 2.12 },				# ok
##not tested.	       CtxtMenu::BinHex => { 'Convert::BinHex' => 1.119 },
#	       CtxtMenu::CanonicalXML => { 'XML::Canonical' => 0.04 },
	       CtxtMenu::CopyPath => {},								# ok
	       CtxtMenu::FIGlet => { 'Text::FIGlet' => 1.05 },					# ok
	       CtxtMenu::Gzip => { 'Compress::Zlib' => 1.16 },
	       CtxtMenu::Gunzip => { 'Compress::Zlib' => 1.16 },
	       CtxtMenu::MD5 => { 'MD5' => 1.7 },
	       CtxtMenu::MagickConvertJPG => { 'Image::Magick' => 5.41 },
	       CtxtMenu::MagickConvertGIF => { 'Image::Magick' => 5.41 },
	       CtxtMenu::MagickConvert => { 'Image::Magick' => 5.41 },
#	       CtxtMenu::ExpandTabs => { 'Text::Tabs' => 98.112801 },
	       CtxtMenu::UnexpandTabs => { 'Text::Tabs' => 98.112801 },
#	       CtxtMenu::PDF => { 'PDF' => 1.11 },
	       CtxtMenu::PDF => { 'Text::PDF' => 0.18 },						# ok, but needs correct parameters for the booklet
	       CtxtMenu::RegisterDll => { 'Win32' => 0.18 },
	       CtxtMenu::UnregisterDll => { 'Win32' => 0.18 },
	       CtxtMenu::RenameMP3 => { 'MP3::Info' => 0.91, 'Win32API::File' => 0.08 }, # KO!
	       CtxtMenu::SwapFileNames => {},							# ok
	       CtxtMenu::Tar => { 'Archive::Tar' => 0.22 },
#	       CtxtMenu::Tgz => { 'Archive::Tar' => 0.22, 'Compress::Zlib' => 1.16 },

Makefile.PL  view on Meta::CPAN

	       CtxtMenu::Zip => { 'Archive::Zip' => 0.11 },
	       CtxtMenu::BinHex => { 'Convert::BinHex' => 1.119 },
#KO	       CtxtMenu::LinkExtor => { 'Win32::Clipboard' => 0.51 ,
#			      'HTML::Parser' => 3.25, # HTML::LinkExtor
#			      'URI::URL' => 1.18 }
	       QueryInfo::PM => {},
	       QueryInfo::ELisp => {},
	       QueryInfo::TeX => {},
	       QueryInfo::LineCount => {},
	       QueryInfo::Shortcut => {},
	       QueryInfo::JpgSize => { 'Image::Magick' => 5.41 },
	       QueryInfo::PDF => { 'PDF' => 1.11 },
	       QueryInfo::Zip => { 'Archive::Zip' => 0.11 },
	       ColumnProvider::JpgSize => { 'Image::Magick' => 5.41 },
	       ColumnProvider::PM => {},
#	       CopyHook::Veto => {},
#KO	       CtxtMenu::Join => { 'Text::Trie' => 0.1 }
# untested     DragAndDropHandler::Zip => {Archive::Zip' => 0.11 },
	       };


$my_samples = {
#KO	       Gzip => { 'Compress::Zlib' => 1.16 },
#KO	       MD5 => { 'MD5' => 1.7 },
#	       MagickConvertJPG => { 'Image::Magick' => 5.41 },
#KO	       Tar => { 'Archive::Tar' => 0.22 },
#	       Zip => { 'Archive::Zip' => 0.11 }
	       MagickConvert => { 'Image::Magick' => 5.41 },
# for testing with multiple commands...
#	       CopyPath => {},								
#	       FIGlet => { 'Text::FIGlet' => 1.05 },					

	       };


# Before writing the makefile, let's check that CLSID's really are unique, this will avoids surprises afterwards...
my %clsids;
push @INC,"examples";

ShellExt/ColumnProvider/JpgSize.pm  view on Meta::CPAN

#
# (C) 2002 jbnivoit@cpan.org
#

package Win32::ShellExt::ColumnProvider::JpgSize;

use 5.006;
use strict;
use warnings;
use Win32::ShellExt::ColumnProvider 0.1;
use Image::Magick 5.41;

$Win32::ShellExt::ColumnProvider::JpgSize::VERSION='0.1';
@Win32::ShellExt::ColumnProvider::JpgSize::ISA=qw(Win32::ShellExt::ColumnProvider);

$ENV{MAGICK_HOME}="C:\\perl\\bin";

$Win32::ShellExt::ColumnProvider::JpgSize::COLUMNS = {
						      'height' => { 'description' => 'provides the height of JPGs', 'callback' => 'get_item_data_height' },
						      'width'  => { 'description' => 'provides the width of JPGs',  'callback' => 'get_item_data_width'  }
						     };

ShellExt/ColumnProvider/JpgSize.pm  view on Meta::CPAN

  local *F;
  open F,">>D:\log8.txt";
  print F "$m $s\n";
  close F;
}

sub get_item_data_height() {
  my ($self,$file) = @_;
  &log("get_item_data_height",$file);
  return undef if($file!~m!jpg$!i) ;
  my $img = new Image::Magick;
  $img->Read($file);
  my $s = $img->GetAttribute('height');
  &log("get_item_data_height",$s);
  $s;
}
sub get_item_data_width() {
  my ($self,$file) = @_;
  &log("get_item_data_width",$file);
  return undef if($file!~m!jpg$!i) ;
  my $img = new Image::Magick;
  $img->Read($file);
  my $s = $img->GetAttribute('width');
  &log("get_item_data_width",$s);
  $s;
}

sub hkeys() {
  my $h = {
	   "CLSID" => "{DF02ACD0-8458-453A-8541-699EE3FC676D}",
	   "package" => "Win32::ShellExt::ColumnProvider::JpgSize"

ShellExt/CtxtMenu/MagickConvert.pm  view on Meta::CPAN

# -*- cperl -*-
# (C) 2002 Jean-Baptiste Nivoit
package Win32::ShellExt::CtxtMenu::MagickConvert;

use Image::Magick 5.41;
use Win32::ShellExt::CtxtMenu;

$Win32::ShellExt::CtxtMenu::MagickConvert::VERSION='0.1';
$Win32::ShellExt::CtxtMenu::MagickConvert::COMMAND = {
					 'convert_jpg' => 'Convert to JPEG',
					 'convert_gif' => 'Convert to GIF',
					 'convert_png' => 'Convert to PNG',
					 'convert_fpx' => 'Convert to FPX'
					 };
@Win32::ShellExt::CtxtMenu::MagickConvert::ISA=qw(Win32::ShellExt::CtxtMenu);

ShellExt/CtxtMenu/MagickConvert.pm  view on Meta::CPAN

}

sub AUTOLOAD {
  my $self = shift;
  my $type = ref($self) || die "$self is not an object";
  my $format = $AUTOLOAD;
  $format =~ s/.*://;   # strip fully-qualified portion

  $format =~ s/convert_//g;
  map {
    my $img=Image::Magick->new;
    my ($infile,$outfile)= ($_,$_);
    $outfile =~ s!\.([^.]+)$!!g;
    $outfile .= ".$format";
    my $status=$img->ReadImage($infile);
    my $status2=$img->WriteImage( filename=>"$outfile" ) ;
    local *F;
    open F,">>d:\\log8.txt";
    print F "$img $infile $outfile $status $status2\n";
    close F;
  } @_;

ShellExt/CtxtMenu/MagickConvertGIF.pm  view on Meta::CPAN

# -*- cperl -*-
# (C) 2002 Jean-Baptiste Nivoit
package Win32::ShellExt::CtxtMenu::MagickConvertGIF;

use Image::Magick 5.41;
use Win32::ShellExt::CtxtMenu;

$Win32::ShellExt::CtxtMenu::MagickConvertGIF::VERSION='0.1';
$Win32::ShellExt::CtxtMenu::MagickConvertGIF::COMMAND="Convert to GIF";
@Win32::ShellExt::CtxtMenu::MagickConvertGIF::ISA=qw(Win32::ShellExt::CtxtMenu);

sub new() {
  my $proto = shift;
  my $class = ref($proto) || $proto;
  my $self  = {};

ShellExt/CtxtMenu/MagickConvertGIF.pm  view on Meta::CPAN

	$ok;
}

sub action() {
	my $self = shift;
	# @_ now holds the list of file paths we want to act on.	

	# this probably would be a good place to start a separate thread to do the job, otherwise it'll block the explorer.
	map {
	  unless(/\.je?pg$/i) { # nothing to do if it's already a jpg file.
	    my $img=Image::Magick->new;
	    my ($infile,$outfile)= ($_,$_);
	    $outfile =~ s!\.([^.]+)$!\.gif!g;
	    my $status=$img->ReadImage($infile);
	    $status=$img->WriteImage( filename=>"$outfile" ) ;
	  }
	} @_;

	1;
}

ShellExt/CtxtMenu/MagickConvertJPG.pm  view on Meta::CPAN

# -*- cperl -*-
# (C) 2002 Jean-Baptiste Nivoit
package Win32::ShellExt::CtxtMenu::MagickConvertJPG;

use Image::Magick 5.41;
use Win32::ShellExt::CtxtMenu;

$Win32::ShellExt::CtxtMenu::MagickConvertJPG::VERSION='0.1';
$Win32::ShellExt::CtxtMenu::MagickConvertJPG::COMMAND="Convert to JPEG";
@Win32::ShellExt::CtxtMenu::MagickConvertJPG::ISA=qw(Win32::ShellExt::CtxtMenu);

sub new() {
  my $proto = shift;
  my $class = ref($proto) || $proto;
  my $self  = {};

ShellExt/CtxtMenu/MagickConvertJPG.pm  view on Meta::CPAN

	$ok;
}

sub action() {
	my $self = shift;
	# @_ now holds the list of file paths we want to act on.	

	# this probably would be a good place to start a separate thread to do the job, otherwise it'll block the explorer.
	map {
	  unless(/\.je?pg$/i) { # nothing to do if it's already a jpg file.
	    my $img=Image::Magick->new;
	    my ($infile,$outfile)= ($_,$_);
	    $outfile =~ s!\.([^.]+)$!\.jpg!g;
	    my $status=$img->ReadImage($infile);
	    $status=$img->WriteImage( filename=>"$outfile" ) ;
	  }
	} @_;

	1;
}

ShellExt/QueryInfo/JpgSize.pm  view on Meta::CPAN

#
# (C) 2002 jbnivoit@cpan.org
#

package Win32::ShellExt::QueryInfo::JpgSize;

use 5.006;
use strict;
use warnings;
use Win32::ShellExt::QueryInfo 0.1;
use Image::Magick 5.41;

$Win32::ShellExt::QueryInfo::JpgSize::VERSION='0.1';
@Win32::ShellExt::QueryInfo::JpgSize::ISA=qw(Win32::ShellExt::QueryInfo);

sub get_info_tip() {
  my ($self,$file) = @_;

# another way of doing it, with a different module:
#  use Image::Size qw(:all);
#  my ($w, $h, $err) = imgsize($file);
#  print "JPEG size $h x $w\n";

  my $img = new Image::Magick;
  $img->Read($file);
  my $h = $img->GetAttribute('height');
  my $w = $img->GetAttribute('width');
  undef $img;
  "JPEG size $h x $w";
}

sub hkeys() {
  my $h = {
	   "CLSID" => "{C29C09C5-AEBF-4504-9667-169A16E11F24}",

test2.pl  view on Meta::CPAN

# -*- cperl -*-
#
# (C) 2002 Jean-Baptiste Nivoit <jbnivoit@cpan.org>
#
use Image::Magick 5.41;

my $file = "C:\\Documents and Settings\\jb\\My Documents\\vancouver06.jpg";
my $img = new Image::Magick;
$img->Read($file);
my $h = $img->GetAttribute('height');
my $w = $img->GetAttribute('width');
my $g = $img->GetAttribute('geometry');
print "JPEG size $h x $w ($g)\n";

use Image::Size qw(:all);
my ($w, $h, $err) = imgsize($file);

print "JPEG size $h x $w\n";



( run in 0.370 second using v1.01-cache-2.11-cpan-beeb90c9504 )