25 Jul 2014 21:18:07 UTC
- Distribution: EBook-MOBI-Image
- Module version: 0.16
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (48 / 0 / 0)
- KwaliteeBus factor: 1
- % Coverage
- License: artistic_2
- Download (7.21KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- Boris Däppen
- COPYRIGHT & LICENSE
EBook::MOBI::Image - Make sure that pictures cope with the MOBI standards.
This module was separated from the main code to reduce dependencies. If you need to process images in your ebook data, just install this module additionally to
v0.56or higher) and it should work.
This example is for developers only. Normal users just need to install this module,
EBook::MOBIwill detect automatically that the module is there and use it. See EBook::MOBI for how to actually add images!
use EBook::MOBI::Image; my $p = EBook::MOBI::Image->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::Image->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. The image is a temporary copy (to protect the original) and will be deleted after your code exits.
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 change the maximum values would be nice.
A development version of
Imlib2(non-perl) must be installed locally before installing this module.
Copyright 2013 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>
Module Install Instructions
To install EBook::MOBI::Image, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install EBook::MOBI::Image
For more information on module installation, please visit the detailed CPAN module installation guide.
|s||Focus search bar|
|?||Bring up this help dialog|
|g p||Go to pull requests|
|g i||go to github issues (only if github is preferred repository)|
|g a||Go to author|
|g c||Go to changes|
|g i||Go to issues|
|g d||Go to dist|
|g r||Go to repository/SCM|
|g s||Go to source|
|g b||Go to file browse|