Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

convert jpg to tiff file

by priyaviswam (Sexton)
on Oct 31, 2011 at 11:53 UTC ( #934867=perlquestion: print w/replies, xml ) Need Help??
priyaviswam has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, I have tried converting the jpg file to tif file. This tiff file is not recognised by the microsoft office picture manager. This is the code I have tried

my $dir = "C:\\Users\\rgopikrx\\Desktop\\im"; opendir (DIR, $dir) or die $!; my @directory = readdir(DIR) or die "unable to read $dir : $!"; my $index = 1; foreach my $file (@directory){ my $im = Image::Magick->new(); my $rc; my $dc; my $new = "$index".".tif"; next if ($file eq "."); next if ($file eq ".."); next if ($file eq "tt"); print "Files : $file\n"; print "Tif file : $new\n"; $rc = $im->Read("$dir\\$file");die $rc if $rc; $dc = $im->Write(filename=>"$dir\\$new"); $index++; }
is there anyother way to convert the jpg to tiff which will be recognized by the microsoft office picture manager so that I can use that image to OCR?

Replies are listed 'Best First'.
Re: convert jpg to tiff file
by marto (Bishop) on Oct 31, 2011 at 12:09 UTC

    Office picture manager doesn't support all forms of TIFF compression. If your goal is to OCR images consider using Image::OCR::Tesseract.

      But this Tesseract is not supported on windows machine right?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://934867]
Approved by marto
[Eily]: I still don't understand how the Turkish AA fit into the German+Czech joke though :P
[LanX]: new Firefox + cb sidebar do random auto expand on submit
[LanX]: probably need to start pm discussion
[LanX]: they have a constitutional referendum in turkey, kind of "do you want a dictator" and everybody opting no gets problems ...
[Corion]: LanX: Random Auto Expand?
[Corion]: LanX: Well, everybody opting "yes" will also get problems. The question is more like "Do you want problems now or problems later?"
[LanX]: and the AA had posters with a big say NO with a small "to alcohol"
[ambrus]: LanX: is it the kind of free and secret vote where there's only one box you can check?

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2017-03-27 12:16 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (320 votes). Check out past polls.