NAME
EBook::MOBI::Picture - Make sure that pictures cope with the MOBI standards.
SYNOPSIS
use EBook::MOBI::Picture;
my $p = EBook::MOBI::Picture->new();
my $img_path_small = $p->rescale_dimensions($img_path_big);
METHODS
new
The code is meant to be used in object oriented style, so you are asked to create an object before using.
my $p = EBook::MOBI::Picture->new();
rescale_dimensions
According to my own research at the web, it is a good idea to have a maximum size for images of 520 x 622. And this is what this method does, it ensures that this maximum is kept.
Pass a path to an image as the first argument, you will then get back the path of a rescaled image. The image is only rescaled if necessary.
Attention: All pictures, no matter what size will be converted to JPG. In my tests, the Kindle-Reader failed to display PNG, that is why I convert everything - to go safe.
debug_on
You can just ignore this method if you are not interested in debuging!
Pass a reference to a debug subroutine and enable debug messages.
debug_off
Stop debug messages and erease the reference to the subroutine.
TODO
A method to 'clean up' and also to change the maximum values would be nice.
COPYRIGHT & LICENSE
Copyright 2011 Boris Däppen, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms of Artistic License 2.0.
AUTHOR
Boris Däppen <boris_daeppen@bluewin.ch>