Permalink
Browse files

Add a new method to handle 'callback' method of HTML::Image::Save

  • Loading branch information...
1 parent 658d45c commit b24328b018efb964e9fa2099068a478363312b43 @edipretoro committed Apr 18, 2009
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/App/uri2mobi.pm
View
@@ -4,7 +4,7 @@ use warnings;
use strict;
use base 'Class::Accessor::Fast';
-__PACKAGE__->mk_accessors( qw( uri xpath output_file clean ) );
+__PACKAGE__->mk_accessors( qw( uri xpath output_file clean img_callback ) );
use HTML::Excerpt::FromXPath;
use HTML::Image::Save;
@@ -62,6 +62,7 @@ sub new {
xpath => $args{xpath},
output_file => $args{output_file},
clean => $args{clean},
+ img_callback => $args{img_callback} || undef,
};
return bless($self, $class);
@@ -102,6 +103,7 @@ sub convert {
my $img_saver = HTML::Image::Save->new(
base_url => $self->uri,
);
+ $img_saver->callback( $self->img_callback );
$img_saver->html( $html );
$img_saver->output_html( 'uri2mobi.html' );
$img_saver->output_dir( './tmp_uri2mobi' );

0 comments on commit b24328b

Please sign in to comment.