Permalink
Browse files

Various changes:

 - fix drawing text on 2/4 channel images for FT2
 - reading ASCII PBMs was broken, it assumed there was whitespace 
   between samples but there doesn't need to be
 - add makemap type of mono/monochrome for producing monochrome images
 - roughly tripled speed of reading any sort of PNM
 - reading a pnm can now return a partial image if you set allow_partial
 - reading a bmp can now return a partial image if you set allow_partial
 - we can now read 16-bit/sample binary PGM/PPM images
 - we can now write 16-bit/sample binary PGM/PPM files if explicitly 
   requested (since GIMP can't read them)
 - reading a tiff will now only return an incomplete image if you set 
   allow_partial
 - some documentation reformatting
  • Loading branch information...
1 parent 31d007e commit 9c106321e22c5a74d0e5d946b452db24e1c9d6f7 Tony Cook committed Dec 30, 2006
View
@@ -1269,11 +1269,13 @@ sub read {
return $self;
}
+ my $allow_partial = $input{allow_partial};
+ defined $allow_partial or $allow_partial = 0;
+
if ( $input{'type'} eq 'tiff' ) {
my $page = $input{'page'};
defined $page or $page = 0;
- # Fixme, check if that length parameter is ever needed
- $self->{IMG}=i_readtiff_wiol( $IO, -1, $page );
+ $self->{IMG}=i_readtiff_wiol( $IO, $allow_partial, $page );
if ( !defined($self->{IMG}) ) {
$self->{ERRSTR}=$self->_error_as_msg(); return undef;
}
@@ -1282,7 +1284,7 @@ sub read {
}
if ( $input{'type'} eq 'pnm' ) {
- $self->{IMG}=i_readpnm_wiol( $IO, -1 ); # Fixme, check if that length parameter is ever needed
+ $self->{IMG}=i_readpnm_wiol( $IO, $allow_partial );
if ( !defined($self->{IMG}) ) {
$self->{ERRSTR}='unable to read pnm image: '._error_as_msg();
return undef;
@@ -1301,7 +1303,7 @@ sub read {
}
if ( $input{'type'} eq 'bmp' ) {
- $self->{IMG}=i_readbmp_wiol( $IO );
+ $self->{IMG}=i_readbmp_wiol( $IO, $allow_partial );
if ( !defined($self->{IMG}) ) {
$self->{ERRSTR}=$self->_error_as_msg();
return undef;
View
@@ -535,6 +535,8 @@ static struct value_name make_color_names[] =
{ "webmap", mc_web_map, },
{ "addi", mc_addi, },
{ "mediancut", mc_median_cut, },
+ { "mono", mc_mono, },
+ { "monochrome", mc_mono, },
};
static struct value_name translate_names[] =
@@ -2250,9 +2252,9 @@ i_test_format_probe(ig, length)
#ifdef HAVE_LIBTIFF
Imager::ImgRaw
-i_readtiff_wiol(ig, length, page=0)
+i_readtiff_wiol(ig, allow_partial, page=0)
Imager::IO ig
- int length
+ int allow_partial
int page
void
@@ -2881,9 +2883,9 @@ i_readgif_multi_wiol(ig)
Imager::ImgRaw
-i_readpnm_wiol(ig, length)
+i_readpnm_wiol(ig, allow_partial)
Imager::IO ig
- int length
+ int allow_partial
undef_int
@@ -2912,8 +2914,9 @@ i_writebmp_wiol(im,ig)
Imager::IO ig
Imager::ImgRaw
-i_readbmp_wiol(ig)
+i_readbmp_wiol(ig, allow_partial=0)
Imager::IO ig
+ int allow_partial
undef_int
View
@@ -173,6 +173,7 @@ raw.c
regmach.c
regmach.h
regops.perl
+render.im
rgb.c Reading and writing SGI rgb files
rotate.c
rubthru.im
View
@@ -157,7 +157,7 @@ my @objs = qw(Imager.o draw.o polygon.o image.o io.o iolayer.o
regmach.o trans2.o quant.o error.o convert.o
map.o tags.o palimg.o maskimg.o img16.o rotate.o
bmp.o tga.o rgb.o color.o fills.o imgdouble.o limits.o hlines.o
- imext.o scale.o rubthru.o);
+ imext.o scale.o rubthru.o render.o);
$Recommends{Imager} =
{ 'Parse::RecDescent' => 0 };
View
8 TODO
@@ -187,7 +187,7 @@ MultiImage & metadata support:
New Features:
- Add mng support, pcx and aalib support.
- - Windows icon files (.ico)
+ - Windows icon files (.ico) (done)
- ILBM (Amiga) images
- photoshop files (I think I've seen docs)
- XBM
@@ -209,7 +209,7 @@ New Features:
(or even from an existing bold or slanted font)
- utf8 support for text output
- (available for FT1, freetype2, should be easy for Win32)
+ (available for FT1, freetype2, T1, Win32)
- easy interfaces for text output:
- align text around point, including:
@@ -304,7 +304,7 @@ Format specific issues:
- provide patches for libgif and libungif that fix their bugs
and give a useful extension interface. Probe for the
installation of the patches in Makefile.PL to let gif.c
- know what features it can use.
+ know what features it can use. (no need anymore)
- Add options for pnm writer to save in any of the p1..P6
formats. Even if the input has 1 channel, write 3 and such
@@ -322,7 +322,7 @@ Format specific issues:
- read more metadata from images, esp tiff tags, EXIF format information
from TIFF and JPEG.
-- handle 16-bit/sample pgm/ppm files
+- handle 16-bit/sample pgm/ppm files (done)
- "jpeg lossless rotation" - directly manipulates the JPEG
representation to rotate, scale or in some limited cases, crop an
Oops, something went wrong.

0 comments on commit 9c10632

Please sign in to comment.