FB3-Convert

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

        'XML::Entities::Data' => 0,
        'Clone' => 0,
        'File::ShareDir' => 0,
        'XML::Diff' => 0,
        'Image::Info' => 0,
        'JSON::Path' => 0,
        'Image::Size' => 0,
        'Image::ExifTool' => 0,
        'URI::Escape' => 0,
        'Lingua::Identify' => 0,
        'Image::Magick' => 0,
        'TeX::Hyphen' => 0,
    },
    script_files => [qw{
      bin/convert2fb3.pl
      bin/cutfb3.pl
      bin/fb3_to_fb2.pl
      bin/fb3_2_json.pl
    }],
    share_dir => {
			dist => [ 'share', 't/examples' ]

META.json  view on Meta::CPAN

      },
      "runtime" : {
         "requires" : {
            "Archive::Zip" : "0",
            "Clone" : "0",
            "FB3" : "0.13",
            "File::ShareDir" : "1.00",
            "Hash::Merge" : "0",
            "Image::ExifTool" : "0",
            "Image::Info" : "0",
            "Image::Magick" : "0",
            "Image::Size" : "0",
            "JSON::Path" : "0",
            "Lingua::Identify" : "0",
            "TeX::Hyphen" : "0",
            "URI::Escape" : "0",
            "UUID::Tiny" : "0",
            "WWW::Mechanize::PhantomJS" : "0",
            "XML::Diff" : "0",
            "XML::Entities" : "0",
            "XML::Entities::Data" : "0",

META.yml  view on Meta::CPAN

  FB3::Euristica:
    file: lib/FB3/Euristica.pm
requires:
  Archive::Zip: '0'
  Clone: '0'
  FB3: '0.13'
  File::ShareDir: '1.00'
  Hash::Merge: '0'
  Image::ExifTool: '0'
  Image::Info: '0'
  Image::Magick: '0'
  Image::Size: '0'
  JSON::Path: '0'
  Lingua::Identify: '0'
  TeX::Hyphen: '0'
  URI::Escape: '0'
  UUID::Tiny: '0'
  WWW::Mechanize::PhantomJS: '0'
  XML::Diff: '0'
  XML::Entities: '0'
  XML::Entities::Data: '0'

lib/FB3/Convert.pm  view on Meta::CPAN

use File::Copy qw(copy);
use File::Temp qw/ tempfile tempdir /;
use FB3::Validator;
use utf8;
use URI::Escape;
use Encode qw(encode_utf8 decode_utf8);
use XML::Entities;
use XML::Entities::Data;
use Time::HiRes qw(gettimeofday sleep);
use Lingua::Identify qw(langof);
use Image::Magick;
use File::ShareDir qw/dist_dir/;
binmode(STDOUT,':utf8');

our $VERSION = 0.48;

=head1 NAME

FB3::Convert - scripts and API for converting FB3 from and to different formats

=cut

lib/FB3/Convert.pm  view on Meta::CPAN

  foreach my $Lang (keys %LangsHashLocal) {
    return lc($Lang) if $LangsHashLocal{$Lang} == $SortedProbability[0];
  }
}

sub Img2JPG {
  my $X = shift;
  my $ImgFile = shift;
  my $UseProfile = shift || undef;
  my $To = $ImgFile.".jpg";
  my $Image = new Image::Magick;

  $Image->Read($ImgFile); #почему-то у IM "or die" всегда срабатывает...;

  if ($UseProfile) {
    if (!-s $sRGBProfile) {
      $X->Msg("Can't find sRGB ICC profile $sRGBProfile. Try convert to RGB colorspace without profile. May wrong colors for CMYK->RGB\n");
      $Image->Quantize(colorspace=>'sRGB');
    } elsif (!-s $CMYKProfile) {
      $X->Msg("Can't find CMYK ICC profile $CMYKProfile. Try convert to RGB colorspace without profile. May wrong colors for CMYK->RGB\n");
      $Image->Quantize(colorspace=>'sRGB');



( run in 1.270 second using v1.01-cache-2.11-cpan-beeb90c9504 )