EBook::MOBI::Picture - Make sure that pictures cope with the MOBI standards.
use EBook::MOBI::Picture; my $p = EBook::MOBI::Picture->new(); my $img_path_small = $p->rescale_dimensions($img_path_big);
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();
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.
You can just ignore this method if you are not interested in debuging!
Pass a reference to a debug subroutine and enable debug messages.
Stop debug messages and erease the reference to the subroutine.
A method to 'clean up' and also to change the maximum values would be nice.
Copyright 2012 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.
Boris Däppen <firstname.lastname@example.org>