view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
use ExtUtils::MakeMaker;
WriteMakefile(
'NAME'=>'Meta',
'VERSION'=>'0.08',
'ABSTRACT'=>'Meta class library',
'AUTHOR'=>'Mark Veltzer <veltzer@cpan.org>',
'PREREQ_PM'=>{
'IO::Handle',1.21_00,
'Image::Magick',5.48,
'Time::Piece',1.08,
'LWP::UserAgent',2.001,
'Frontier::Daemon',undef,
'File::Find',1.04,
'Module::Info',0.15,
'BerkeleyDB',0.20,
'Pod::Text',2.21,
'File::stat',1.00,
'XML::LibXSLT',1.50,
'Getopt::Long',2.32,
Meta/Image/Magick.pm view on Meta::CPAN
#!/bin/echo This is a perl module and should not be run
package Meta::Image::Magick;
use strict qw(vars refs subs);
use Image::Magick qw();
our($VERSION,@ISA);
$VERSION="0.06";
@ISA=qw(Image::Magick);
#sub Thumb($$$);
#sub TEST($);
#__DATA__
sub Thumb($$$) {
my($self,$maxx,$maxy)=@_;
my($x,$y)=$self->Get('width','height');
if($x>$maxx) {
Meta/Image/Magick.pm view on Meta::CPAN
my($context)=@_;
return(1);
}
1;
__END__
=head1 NAME
Meta::Image::Magick - Meta extensions to Image::Magick.
=head1 COPYRIGHT
Copyright (C) 2001, 2002 Mark Veltzer;
All rights reserved.
=head1 LICENSE
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Meta/Image/Magick.pm view on Meta::CPAN
=head1 DETAILS
MANIFEST: Magick.pm
PROJECT: meta
VERSION: 0.06
=head1 SYNOPSIS
package foo;
use Meta::Image::Magick qw();
my($image)=Meta::Image::Magick->new();
my($thumbnail)=$object->thunb(50,50);
=head1 DESCRIPTION
Since I found there were a few methods I wanted that were missing from
Image::Magick I inherited from it and extended it. This is the result.
The original motivation was the creation of well scaled thumbnails.
=head1 FUNCTIONS
Thumb($$$)
TEST($)
=head1 FUNCTION DOCUMENTATION
=over 4
Meta/Image/Magick.pm view on Meta::CPAN
than x and y dimensions but only in a single dimension.
=item B<TEST($)>
Test suite for this module.
=back
=head1 SUPER CLASSES
Image::Magick(3)
=head1 BUGS
None.
=head1 AUTHOR
Name: Mark Veltzer
Email: mailto:veltzer@cpan.org
WWW: http://www.veltzer.org
Meta/Image/Magick.pm view on Meta::CPAN
0.00 MV thumbnail project basics
0.01 MV thumbnail user interface
0.02 MV more thumbnail issues
0.03 MV website construction
0.04 MV web site automation
0.05 MV SEE ALSO section fix
0.06 MV md5 issues
=head1 SEE ALSO
Image::Magick(3), strict(3)
=head1 TODO
-add method which resizes the image to the thumb size exactly.
Meta/Projects/Pics/pics_dir_check.pl view on Meta::CPAN
#!/usr/bin/env perl
use strict qw(vars refs subs);
use Meta::Utils::System qw();
use Meta::Utils::Opts::Opts qw();
use Meta::Utils::File::Iterator qw();
use Meta::Utils::Output qw();
use Image::Magick qw();
my($verbose,$dire);
my($opts)=Meta::Utils::Opts::Opts->new();
$opts->set_standard();
$opts->def_bool("verbose","should I be noisy ?",0,\$verbose);
$opts->def_dire("directory","directory to scan",".",\$dire);
$opts->set_free_allo(0);
$opts->analyze(\@ARGV);
my($iterator)=Meta::Utils::File::Iterator->new();
$iterator->add_directory($dire);
$iterator->start();
my($bad)=0;
while(!$iterator->get_over()) {
my($curr)=$iterator->get_curr();
if($verbose) {
Meta::Utils::Output::print("doing [".$curr."]\n");
}
my($image)=Image::Magick->new();
my($ret)=$image->Read($curr);
if($ret) {
Meta::Utils::Output::print($curr."\n");
$bad++;
}
$iterator->next();
}
$iterator->fini();
my($scod);
Meta/Projects/Pics/pics_dir_check.pl view on Meta::CPAN
This script checks a list of files (currently all files contained
recursivly in a directory) for damaged image files and either
produces a list of the damaged files or just removes them.
Why should you need such a script ? well, it seems that most image
viewers today will show you an image even if the file itself is
damaged (some of the last scan lines are missing etc...). This
script is intended to aid you in finding the bad images in a big
image collection.
How does it work ? It uses Image::Magick to load the image. If the
file is ok then all is well and the image is discarded. If the load
fails then it reports the image as being bad or removed it (your
preference).
Other strategies for determining the correctness of the image file
may be added in the future.
=head1 OPTIONS
=over 4
Meta/Projects/Pics/pics_dir_check.pl view on Meta::CPAN
WWW: http://www.veltzer.org
CPAN id: VELTZER
=head1 HISTORY
0.00 MV move tests to modules
0.01 MV md5 issues
=head1 SEE ALSO
Image::Magick(3), Meta::Utils::File::Iterator(3), Meta::Utils::Opts::Opts(3), Meta::Utils::Output(3), Meta::Utils::System(3), strict(3)
=head1 TODO
Nothing.
Meta/Projects/Pics/pics_import.pl view on Meta::CPAN
#!/usr/bin/env perl
use strict qw(vars refs subs);
use Meta::Utils::System qw();
use Meta::Utils::Opts::Opts qw();
use Meta::Db::Def qw();
use Meta::Db::Connections qw();
use Meta::Db::Dbi qw();
use Meta::Db::Info qw();
use Meta::Utils::File::File qw();
use Meta::Image::Magick qw();
use Digest::MD5 qw();
use Meta::Utils::File::Iter qw();
use Meta::Baseline::Aegis qw();
use Meta::Sql::Stats qw();
my($def_file,$connections_file,$name,$con_name,$clean,$verb,$dire,$thumb_y,$thumb_x);
my($opts)=Meta::Utils::Opts::Opts->new();
$opts->set_standard();
$opts->def_modu("def_file","what def XML file to use ?","xmlx/def/pics.xml",\$def_file);
$opts->def_modu("connections_file","what connections XML file to use ?","xmlx/connections/connections.xml",\$connections_file);
Meta/Projects/Pics/pics_import.pl view on Meta::CPAN
my($iter)=Meta::Utils::File::Iter->new();
$iter->add_directory($dire);
$iter->start();
while(!($iter->get_over())) {
my($curr)=$iter->get_curr();
if($verb) {
Meta::Utils::Output::print("importing [".$curr."]\n");
}
my($data);
Meta::Utils::File::File::load($curr,\$data);
my($image)=Meta::Image::Magick->new(magick=>'jpg');
$image->BlobToImage($data);
my($x,$y)=$image->Get('width','height');
$image->Thumb($thumb_x,$thumb_y);
my($thumb)=$image->ImageToBlob();
my($checksum)=Digest::MD5::md5($data);
my($rv1)=$prep->bind_param(1,$dbi->quote($thumb,DBI::SQL_BINARY),{ TYPE=>"SQL_BINARY" });
#my($rv1)=$prep->bind_param(1,$thumb);
if(!$rv1) {
throw Meta::Error::Simple("unable to bind param 1");
}
Meta/Projects/Pics/pics_import.pl view on Meta::CPAN
0.11 MV website construction
0.12 MV improve the movie db xml
0.13 MV web site automation
0.14 MV SEE ALSO section fix
0.15 MV move tests to modules
0.16 MV web site development
0.17 MV md5 issues
=head1 SEE ALSO
Digest::MD5(3), Meta::Baseline::Aegis(3), Meta::Db::Connections(3), Meta::Db::Dbi(3), Meta::Db::Def(3), Meta::Db::Info(3), Meta::Image::Magick(3), Meta::Sql::Stats(3), Meta::Utils::File::File(3), Meta::Utils::File::Iter(3), Meta::Utils::Opts::Opts(3)...
=head1 TODO
Nothing.
Meta/Projects/Pics/pics_info.pl view on Meta::CPAN
#!/usr/bin/env perl
use strict qw(vars refs subs);
use Meta::Utils::System qw();
use Meta::Utils::Opts::Opts qw();
use Image::Magick qw();
use Image::Size qw();
use Meta::Info::Enum qw();
use Meta::Utils::Output qw();
my($enum)=Meta::Info::Enum->new();
$enum->insert("magick","use Image::Magick to do the work");
$enum->insert("imagesize","use Image::Size to do the work");
$enum->set_default("imagesize");
my($file,$method);
my($opts)=Meta::Utils::Opts::Opts->new();
$opts->def_file("file","what file to use ?",undef,\$file);
$opts->def_enum("method","what type of method to use ?","imagesize",\$method,$enum);
$opts->set_standard();
$opts->set_free_allo(0);
$opts->analyze(\@ARGV);
my($size_x,$size_y);
if($enum->is_selected($method,"magick")) {
my($image)=Image::Magick->new();
my($ret)=$image->Read($file);
if($ret) {
throw Meta::Error::Simple("unable to read image [".$file."]");
}
#$image->Display();
($size_x,$size_y)=$image->Get('height','width');
}
if($enum->is_selected($method,"imagesize")) {
($size_x,$size_y)=Image::Size::imgsize($file);
}
Meta/Projects/Pics/pics_info.pl view on Meta::CPAN
=item B<file> (type: file, default: )
what file to use ?
=item B<method> (type: enum, default: imagesize)
what type of method to use ?
options:
magick - use Image::Magick to do the work
imagesize - use Image::Size to do the work
=item B<help> (type: bool, default: 0)
display help message
=item B<pod> (type: bool, default: 0)
display pod options snipplet
Meta/Projects/Pics/pics_info.pl view on Meta::CPAN
=head1 HISTORY
0.00 MV move tests to modules
0.01 MV bring movie data
0.02 MV finish papers
0.03 MV teachers project
0.04 MV md5 issues
=head1 SEE ALSO
Image::Magick(3), Image::Size(3), Meta::Info::Enum(3), Meta::Utils::Opts::Opts(3), Meta::Utils::Output(3), Meta::Utils::System(3), strict(3)
=head1 TODO
-add ability to see tags (in formats that support tags)
Meta/Projects/Pics/pics_multi_view.pl view on Meta::CPAN
#!/usr/bin/env perl
use strict qw(vars refs subs);
use Meta::Utils::System qw();
use Meta::Utils::Opts::Opts qw();
use Gtk qw();
use Gtk::Gdk::ImlibImage qw();
use Image::Magick qw();
use Meta::Utils::Output qw();
my($col_size,$col_sizes);
my($opts)=Meta::Utils::Opts::Opts->new();
$opts->set_standard();
$opts->def_bool("col_size","should I find image size ?",1,\$col_size);
$opts->def_bool("col_sizes","should I find image sizes ?",0,\$col_sizes);
$opts->set_free_allo(1);
$opts->set_free_stri("[files]");
$opts->set_free_mini(1);
Meta/Projects/Pics/pics_multi_view.pl view on Meta::CPAN
Meta::Utils::Output::print("error: [".$name."] is not a file\n");
return;
}
my(@params);
push(@params,$name);
if($col_size) {
my($size)=(CORE::stat($name))[7];
push(@params,$size);
}
if($col_sizes) {
my($image)=Image::Magick->new();
my($ret)=$image->Read($name);
if($ret) {
throw Meta::Error::Simple("unable to read image [".$name."]");
} else {
my($x_size,$y_size)=$image->Get('height','width');
push(@params,$x_size,$y_size);
}
}
$list->append(@params);
}
Meta/Projects/Pics/pics_multi_view.pl view on Meta::CPAN
0.05 MV more thumbnail issues
0.06 MV website construction
0.07 MV improve the movie db xml
0.08 MV web site automation
0.09 MV SEE ALSO section fix
0.10 MV move tests to modules
0.11 MV md5 issues
=head1 SEE ALSO
Gtk(3), Gtk::Gdk::ImlibImage(3), Image::Magick(3), Meta::Utils::Opts::Opts(3), Meta::Utils::Output(3), Meta::Utils::System(3), strict(3)
=head1 TODO
-enable to resize or not to resize with each new image
-enable to move or not to move with each new image.
-how about the scroll bars on the main list - do we need them that way ?
-if you kill the picture window then program gets broken.
Meta/Projects/Pics/pics_remove_small.pl view on Meta::CPAN
#!/usr/bin/env perl
use strict qw(vars refs subs);
use Meta::Utils::System qw();
use Meta::Utils::Opts::Opts qw();
use Meta::Utils::Output qw();
use Meta::Utils::File::Remove qw();
use Image::Magick qw();
use Image::Size qw();
use Meta::Info::Enum qw();
use Meta::Utils::File::Iterator qw();
my($enum)=Meta::Info::Enum->new();
$enum->insert("magick","use Image::Magick");
$enum->insert("imagesize","use Image::Size");
$enum->set_default("magick");
my($verbose,$demo,$summ,$x_size,$y_size,$method,$dire);
my($opts)=Meta::Utils::Opts::Opts->new();
$opts->set_standard();
$opts->def_bool("verbose","should I be noisy ?",1,\$verbose);
$opts->def_bool("demo","should I just fake it ?",1,\$demo);
$opts->def_bool("summary","should I display summary ?",0,\$summ);
$opts->def_inte("x","minimum x size",200,\$x_size);
Meta/Projects/Pics/pics_remove_small.pl view on Meta::CPAN
my($iterator)=Meta::Utils::File::Iterator->new();
$iterator->add_directory($dire);
$iterator->start();
while(!$iterator->get_over()) {
my($curr)=$iterator->get_curr();
Meta::Utils::Output::verbose($verbose,"doing [".$curr."]\n");
my($curr_x,$curr_y);
if($enum->is_selected($method,"magick")) {
my($image)=Image::Magick->new();
my($ret)=$image->Read($curr);
if($ret) {
throw Meta::Error::Simple("unable to read image [".$curr."]");
}
#$image->Display();
($curr_x,$curr_y)=$image->Get('height','width');
}
if($enum->is_selected($method,"imagesize")) {
($curr_x,$curr_y)=Image::Size::imgsize($curr);
}
Meta/Projects/Pics/pics_remove_small.pl view on Meta::CPAN
=item B<y> (type: inte, default: 200)
minimum y size
=item B<method> (type: enum, default: magick)
what type of method to use ?
options:
magick - use Image::Magick
imagesize - use Image::Size
=item B<directory> (type: dire, default: .)
directory to scan
=back
no free arguments are allowed
Meta/Projects/Pics/pics_remove_small.pl view on Meta::CPAN
0.09 MV web site automation
0.10 MV SEE ALSO section fix
0.11 MV move tests to modules
0.12 MV bring movie data
0.13 MV finish papers
0.14 MV teachers project
0.15 MV md5 issues
=head1 SEE ALSO
Image::Magick(3), Image::Size(3), Meta::Info::Enum(3), Meta::Utils::File::Iterator(3), Meta::Utils::File::Remove(3), Meta::Utils::Opts::Opts(3), Meta::Utils::Output(3), Meta::Utils::System(3), strict(3)
=head1 TODO
-add option to only produce of list of files to be removed.
Meta/Projects/Thumbnail/thumbnail_import.pl view on Meta::CPAN
#!/usr/bin/env perl
use strict qw(vars refs subs);
use Meta::Utils::System qw();
use Meta::Utils::Opts::Opts qw();
use Meta::Db::Def qw();
use Meta::Db::Connections qw();
use Meta::Db::Dbi qw();
use Meta::Utils::File::File qw();
use Image::Magick qw();
use Digest::MD5 qw();
use Meta::Utils::File::Iterator qw();
use GD qw();
use Image::GD::Thumbnail qw();
use Meta::Image::Magick qw();
use Meta::Db::Info qw();
use Meta::Sql::Stats qw();
use Meta::Baseline::Aegis qw();
use Meta::Utils::File::Prop qw();
use File::MMagic qw();
use Error qw(:try);
my($def_file,$connections_file,$name,$con_name,$clean,$verb,$demo,$dire,$thumb_y,$thumb_x);
my($opts)=Meta::Utils::Opts::Opts->new();
$opts->set_standard();
Meta/Projects/Thumbnail/thumbnail_import.pl view on Meta::CPAN
$iter->start();
while(!($iter->get_over())) {
my($curr)=$iter->get_curr();
#find out if file is jpg
my($type)=$mm->checktype_filename($curr);
Meta::Utils::Output::verbose($verb,"considering [".$curr."] with type [".$type."]\n");
if($type eq "image/jpeg") {
Meta::Utils::Output::verbose($verb,"importing [".$curr."]\n");
my($data);
Meta::Utils::File::File::load($curr,\$data);
my($image)=Meta::Image::Magick->new(magick=>'jpg');
$image->BlobToImage($data);
my($width,$height)=$image->Get('width','height');
#GD implementation
#my($gdimage)=GD::Image->newFromJpegData($data);
#my($gdthumb)=Image::GD::Thumbnail::create($gdimage,$thumb_y);
#my($thumb)=$gdthumb->jpeg();
#ImageMagick implementation
#$image->Resize(height=>$thumb_y,width=>$thumb_x);
Meta/Projects/Thumbnail/thumbnail_import.pl view on Meta::CPAN
0.09 MV website construction
0.10 MV improve the movie db xml
0.11 MV web site automation
0.12 MV SEE ALSO section fix
0.13 MV move tests to modules
0.14 MV teachers project
0.15 MV md5 issues
=head1 SEE ALSO
Digest::MD5(3), Error(3), File::MMagic(3), GD(3), Image::GD::Thumbnail(3), Image::Magick(3), Meta::Baseline::Aegis(3), Meta::Db::Connections(3), Meta::Db::Dbi(3), Meta::Db::Def(3), Meta::Db::Info(3), Meta::Image::Magick(3), Meta::Sql::Stats(3), Meta:...
=head1 TODO
-add importing of directory structure.
-add importing of file system stuff (inode etc...).
-maybe use Net::Pbm or whatever the gallery project uses to produce good thumbnails.