laag-libtiff 4.0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +57 -0
- data/LICENSE.txt +21 -0
- data/README.org +34 -0
- data/ext/laag/libtiff/extconf.rb +13 -0
- data/laag-libtiff.gemspec +20 -0
- data/lib/laag/libtiff.rb +29 -0
- data/vendor/gitlab.com/libtiff/libtiff/.appveyor.yml +109 -0
- data/vendor/gitlab.com/libtiff/libtiff/.cvsignore +4 -0
- data/vendor/gitlab.com/libtiff/libtiff/.travis.yml +34 -0
- data/vendor/gitlab.com/libtiff/libtiff/CMakeLists.txt +764 -0
- data/vendor/gitlab.com/libtiff/libtiff/COMMITTERS +19 -0
- data/vendor/gitlab.com/libtiff/libtiff/COPYRIGHT +21 -0
- data/vendor/gitlab.com/libtiff/libtiff/ChangeLog +8073 -0
- data/vendor/gitlab.com/libtiff/libtiff/HOWTO-RELEASE +119 -0
- data/vendor/gitlab.com/libtiff/libtiff/HOWTO-SECURITY-RELEASE +19 -0
- data/vendor/gitlab.com/libtiff/libtiff/Makefile.am +91 -0
- data/vendor/gitlab.com/libtiff/libtiff/Makefile.in +995 -0
- data/vendor/gitlab.com/libtiff/libtiff/Makefile.vc +58 -0
- data/vendor/gitlab.com/libtiff/libtiff/README +61 -0
- data/vendor/gitlab.com/libtiff/libtiff/README.vms +12 -0
- data/vendor/gitlab.com/libtiff/libtiff/RELEASE-DATE +1 -0
- data/vendor/gitlab.com/libtiff/libtiff/SConstruct +171 -0
- data/vendor/gitlab.com/libtiff/libtiff/TODO +12 -0
- data/vendor/gitlab.com/libtiff/libtiff/VERSION +1 -0
- data/vendor/gitlab.com/libtiff/libtiff/aclocal.m4 +1194 -0
- data/vendor/gitlab.com/libtiff/libtiff/archive/html/man/bmp2tiff.1.html +121 -0
- data/vendor/gitlab.com/libtiff/libtiff/archive/html/man/gif2tiff.1.html +141 -0
- data/vendor/gitlab.com/libtiff/libtiff/archive/html/man/ras2tiff.1.html +139 -0
- data/vendor/gitlab.com/libtiff/libtiff/archive/html/man/sgi2tiff.1.html +147 -0
- data/vendor/gitlab.com/libtiff/libtiff/archive/html/man/tiffsv.1.html +207 -0
- data/vendor/gitlab.com/libtiff/libtiff/archive/man/bmp2tiff.1 +85 -0
- data/vendor/gitlab.com/libtiff/libtiff/archive/man/gif2tiff.1 +81 -0
- data/vendor/gitlab.com/libtiff/libtiff/archive/man/ras2tiff.1 +96 -0
- data/vendor/gitlab.com/libtiff/libtiff/archive/man/sgi2tiff.1 +93 -0
- data/vendor/gitlab.com/libtiff/libtiff/archive/man/tiffsv.1 +142 -0
- data/vendor/gitlab.com/libtiff/libtiff/archive/tools/bmp2tiff.c +937 -0
- data/vendor/gitlab.com/libtiff/libtiff/archive/tools/gif2tiff.c +591 -0
- data/vendor/gitlab.com/libtiff/libtiff/archive/tools/ras2tiff.c +338 -0
- data/vendor/gitlab.com/libtiff/libtiff/archive/tools/rasterfile.h +44 -0
- data/vendor/gitlab.com/libtiff/libtiff/archive/tools/sgi2tiff.c +337 -0
- data/vendor/gitlab.com/libtiff/libtiff/archive/tools/sgisv.c +318 -0
- data/vendor/gitlab.com/libtiff/libtiff/archive/tools/ycbcr.c +168 -0
- data/vendor/gitlab.com/libtiff/libtiff/autogen.sh +8 -0
- data/vendor/gitlab.com/libtiff/libtiff/build/.cvsignore +1 -0
- data/vendor/gitlab.com/libtiff/libtiff/build/CMakeLists.txt +25 -0
- data/vendor/gitlab.com/libtiff/libtiff/build/Makefile.am +32 -0
- data/vendor/gitlab.com/libtiff/libtiff/build/Makefile.in +680 -0
- data/vendor/gitlab.com/libtiff/libtiff/build/README +3 -0
- data/vendor/gitlab.com/libtiff/libtiff/build/travis-ci +108 -0
- data/vendor/gitlab.com/libtiff/libtiff/commit +233 -0
- data/vendor/gitlab.com/libtiff/libtiff/config/compile +347 -0
- data/vendor/gitlab.com/libtiff/libtiff/config/config.guess +1526 -0
- data/vendor/gitlab.com/libtiff/libtiff/config/config.sub +1658 -0
- data/vendor/gitlab.com/libtiff/libtiff/config/depcomp +791 -0
- data/vendor/gitlab.com/libtiff/libtiff/config/install-sh +507 -0
- data/vendor/gitlab.com/libtiff/libtiff/config/ltmain.sh +11156 -0
- data/vendor/gitlab.com/libtiff/libtiff/config/missing +215 -0
- data/vendor/gitlab.com/libtiff/libtiff/config/mkinstalldirs +161 -0
- data/vendor/gitlab.com/libtiff/libtiff/config/test-driver +127 -0
- data/vendor/gitlab.com/libtiff/libtiff/configure +23612 -0
- data/vendor/gitlab.com/libtiff/libtiff/configure.ac +1112 -0
- data/vendor/gitlab.com/libtiff/libtiff/configure.com +1357 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/.cvsignore +2 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/CMakeLists.txt +35 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/Makefile.am +31 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/Makefile.in +679 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/README +2 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/addtiffo/.cvsignore +5 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/addtiffo/CMakeLists.txt +34 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/addtiffo/Makefile.am +39 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/addtiffo/Makefile.in +652 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/addtiffo/Makefile.vc +28 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/addtiffo/README +142 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/addtiffo/addtiffo.c +181 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/addtiffo/tif_overview.c +916 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/addtiffo/tif_ovrcache.c +344 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/addtiffo/tif_ovrcache.h +103 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/dbs/.cvsignore +8 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/dbs/CMakeLists.txt +43 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/dbs/Makefile.am +46 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/dbs/Makefile.in +798 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/dbs/README +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/dbs/tiff-bi.c +91 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/dbs/tiff-grayscale.c +147 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/dbs/tiff-palette.c +284 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/dbs/tiff-rgb.c +201 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/dbs/xtiff/.cvsignore +2 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/dbs/xtiff/CMakeLists.txt +29 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/dbs/xtiff/Makefile.am +47 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/dbs/xtiff/Makefile.in +516 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/dbs/xtiff/README +6 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/dbs/xtiff/patchlevel.h +8 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/dbs/xtiff/xtiff.c +1290 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/dbs/xtiff/xtifficon.h +21 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/iptcutil/.cvsignore +5 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/iptcutil/CMakeLists.txt +35 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/iptcutil/Makefile.am +40 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/iptcutil/Makefile.in +650 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/iptcutil/README +25 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/iptcutil/iptcutil.c +954 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/iptcutil/test.iptc +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/iptcutil/test.txt +32 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/mfs/.cvsignore +2 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/mfs/CMakeLists.txt +27 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/mfs/Makefile.am +29 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/mfs/Makefile.in +499 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/mfs/README +37 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/mfs/mfs_file.c +586 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/pds/.cvsignore +2 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/pds/CMakeLists.txt +30 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/pds/Makefile.am +32 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/pds/Makefile.in +502 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/pds/README +90 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/pds/tif_imageiter.c +525 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/pds/tif_imageiter.h +64 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/pds/tif_pdsdirread.c +1131 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/pds/tif_pdsdirwrite.c +971 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/ras/.cvsignore +2 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/ras/CMakeLists.txt +28 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/ras/Makefile.am +30 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/ras/Makefile.in +500 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/ras/README +10 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/ras/ras2tif.c +254 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/ras/tif2ras.c +344 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/stream/.cvsignore +2 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/stream/CMakeLists.txt +28 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/stream/Makefile.am +30 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/stream/Makefile.in +500 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/stream/README +30 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/stream/tiffstream.cpp +238 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/stream/tiffstream.h +70 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/tags/.cvsignore +2 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/tags/CMakeLists.txt +32 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/tags/Makefile.am +33 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/tags/Makefile.in +503 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/tags/README +132 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/tags/listtif.c +39 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/tags/maketif.c +77 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/tags/xtif_dir.c +350 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/tags/xtiffio.h +59 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/tags/xtiffiop.h +72 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/win_dib/.cvsignore +2 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/win_dib/CMakeLists.txt +30 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/win_dib/Makefile.am +32 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/win_dib/Makefile.in +502 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/win_dib/Makefile.w95 +134 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/win_dib/README.Tiffile +31 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/win_dib/README.tiff2dib +51 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/win_dib/Tiffile.cpp +449 -0
- data/vendor/gitlab.com/libtiff/libtiff/contrib/win_dib/tiff2dib.c +379 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/.cvsignore +5 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/BigTIFFProposal.html +99 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/CMakeLists.txt +87 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/Makefile.am +96 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/Makefile.in +798 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/TIFFTechNote2.html +707 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/addingtags.html +292 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/bigtiffdesign.html +80 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/bigtiffpr.html +77 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/bigtiffpr_images/esri.png +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/bigtiffpr_images/leica.png +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/bigtiffpr_images/safe.png +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/bigtiffpr_images/weogeo.png +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/bugs.html +61 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/build.html +737 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/contrib.html +209 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/document.html +52 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images.html +41 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/.cvsignore +2 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/CMakeLists.txt +46 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/Makefile.am +49 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/Makefile.in +572 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/back.gif +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/bali.jpg +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/cat.gif +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/cover.jpg +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/cramps.gif +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/dave.gif +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/info.gif +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/jello.jpg +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/jim.gif +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/note.gif +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/oxford.gif +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/quad.jpg +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/ring.gif +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/smallliz.jpg +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/strike.gif +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/images/warning.gif +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/index.html +122 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/internals.html +572 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/intro.html +68 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/libtiff.html +747 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/.cvsignore +2 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/CMakeLists.txt +108 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/HtmlDoc.cmake +50 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/Makefile.am +122 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/Makefile.in +642 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFClose.3tiff.html +87 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFDataWidth.3tiff.html +98 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFError.3tiff.html +106 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFFieldDataType.3tiff.html +89 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFFieldName.3tiff.html +86 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFFieldPassCount.3tiff.html +98 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFFieldReadCount.3tiff.html +101 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFFieldTag.3tiff.html +88 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFFieldWriteCount.3tiff.html +108 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFFlush.3tiff.html +113 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFGetField.3tiff.html +1969 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFOpen.3tiff.html +421 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFPrintDirectory.3tiff.html +225 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFRGBAImage.3tiff.html +319 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFReadDirectory.3tiff.html +218 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFReadEncodedStrip.3tiff.html +133 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFReadEncodedTile.3tiff.html +130 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFReadRGBAImage.3tiff.html +301 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFReadRGBAStrip.3tiff.html +208 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFReadRGBATile.3tiff.html +261 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFReadRawStrip.3tiff.html +109 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFReadRawTile.3tiff.html +111 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFReadScanline.3tiff.html +157 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFReadTile.3tiff.html +133 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFSetDirectory.3tiff.html +122 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFSetField.3tiff.html +1865 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFWarning.3tiff.html +108 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFWriteDirectory.3tiff.html +176 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFWriteEncodedStrip.3tiff.html +153 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFWriteEncodedTile.3tiff.html +147 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFWriteRawStrip.3tiff.html +144 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFWriteRawTile.3tiff.html +128 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFWriteScanline.3tiff.html +206 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFWriteTile.3tiff.html +115 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFbuffer.3tiff.html +116 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFcodec.3tiff.html +116 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFcolor.3tiff.html +975 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFmemory.3tiff.html +110 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFquery.3tiff.html +148 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFsize.3tiff.html +95 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFstrip.3tiff.html +129 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFswab.3tiff.html +110 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/TIFFtile.3tiff.html +141 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/fax2ps.1.html +252 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/fax2tiff.1.html +607 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/index.html +64 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/libtiff.3tiff.html +1150 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/pal2rgb.1.html +189 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/ppm2tiff.1.html +141 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/raw2tiff.1.html +510 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/rgb2ycbcr.1.html +155 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/thumbnail.1.html +148 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/tiff2bw.1.html +161 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/tiff2pdf.1.html +609 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/tiff2ps.1.html +639 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/tiff2rgba.1.html +162 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/tiffcmp.1.html +156 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/tiffcp.1.html +569 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/tiffcrop.1.html +684 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/tiffdither.1.html +196 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/tiffdump.1.html +145 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/tiffgt.1.html +551 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/tiffinfo.1.html +196 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/tiffmedian.1.html +183 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/tiffset.1.html +176 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/man/tiffsplit.1.html +102 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/misc.html +117 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/support.html +655 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/tools.html +137 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.4beta007.html +112 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.4beta016.html +122 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.4beta018.html +84 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.4beta024.html +139 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.4beta028.html +146 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.4beta029.html +86 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.4beta031.html +94 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.4beta032.html +90 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.4beta033.html +82 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.4beta034.html +68 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.4beta035.html +63 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.4beta036.html +117 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.5.1.html +75 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.5.2.html +108 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.5.3.html +132 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.5.4.html +88 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.5.5.html +155 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.5.6-beta.html +185 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.5.7.html +259 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.6.0.html +434 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.6.1.html +199 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.7.0.html +144 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.7.0alpha.html +249 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.7.0beta.html +162 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.7.0beta2.html +131 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.7.1.html +233 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.7.2.html +222 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.7.3.html +230 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.7.4.html +133 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.8.0.html +199 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.8.1.html +217 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.8.2.html +137 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.9.0.html +261 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.9.0beta.html +304 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.9.1.html +115 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.9.2.html +122 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.9.3.html +160 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.9.4.html +125 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v3.9.5.html +270 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v4.0.0.html +269 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v4.0.1.html +113 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v4.0.2.html +118 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v4.0.3.html +125 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v4.0.4.html +274 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v4.0.4beta.html +291 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v4.0.5.html +148 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v4.0.6.html +139 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v4.0.7.html +411 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v4.0.8.html +445 -0
- data/vendor/gitlab.com/libtiff/libtiff/html/v4.0.9.html +373 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff-4.pc.in +11 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/.cvsignore +22 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/CMakeLists.txt +165 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/Makefile.am +154 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/Makefile.in +966 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/Makefile.lcc +129 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/Makefile.vc +102 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/SConstruct +73 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/libtiff.def +168 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/libtiff.map +4 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/libtiffxx.map +4 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/mkg3states.c +454 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/mkspans.c +82 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/t4.h +292 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_aux.c +376 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_close.c +140 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_codec.c +165 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_color.c +309 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_compress.c +304 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_config.h-vms +46 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_config.h.cmake.in +261 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_config.h.in +410 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_config.vc.h +137 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_config.wince.h +71 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_dir.c +1767 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_dir.h +309 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_dirinfo.c +1070 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_dirread.c +5803 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_dirwrite.c +3024 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_dumpmode.c +143 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_error.c +88 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_extension.c +118 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_fax3.c +1648 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_fax3.h +540 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_fax3sm.c +1260 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_flush.c +118 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_getimage.c +3048 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_jbig.c +214 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_jpeg.c +2601 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_jpeg_12.c +69 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_luv.c +1765 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_lzma.c +495 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_lzw.c +1218 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_next.c +189 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_ojpeg.c +2563 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_open.c +725 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_packbits.c +311 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_pixarlog.c +1485 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_predict.c +881 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_predict.h +79 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_print.c +722 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_read.c +1572 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_stream.cxx +430 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_strip.c +389 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_swab.c +312 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_thunder.c +208 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_tile.c +322 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_unix.c +386 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_version.c +40 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_vms.c +611 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_warning.c +89 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_win32.c +476 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_wince.c +293 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_write.c +834 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tif_zip.c +476 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tiff.h +681 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tiffconf.h-vms +99 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tiffconf.h.cmake.in +130 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tiffconf.h.in +127 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tiffconf.vc.h +161 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tiffconf.wince.h +121 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tiffio.h +560 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tiffio.hxx +49 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tiffiop.h +445 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tiffvers.h +9 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/tiffvers.h.in +9 -0
- data/vendor/gitlab.com/libtiff/libtiff/libtiff/uvcode.h +180 -0
- data/vendor/gitlab.com/libtiff/libtiff/m4/acinclude.m4 +851 -0
- data/vendor/gitlab.com/libtiff/libtiff/m4/ice_find_athena.m4 +187 -0
- data/vendor/gitlab.com/libtiff/libtiff/m4/libtool.m4 +8388 -0
- data/vendor/gitlab.com/libtiff/libtiff/m4/ltoptions.m4 +437 -0
- data/vendor/gitlab.com/libtiff/libtiff/m4/ltsugar.m4 +124 -0
- data/vendor/gitlab.com/libtiff/libtiff/m4/ltversion.m4 +23 -0
- data/vendor/gitlab.com/libtiff/libtiff/m4/lt~obsolete.m4 +99 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/.cvsignore +3 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/CMakeLists.txt +97 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/Makefile.am +94 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/Makefile.in +684 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFClose.3tiff +53 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFDataWidth.3tiff +74 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFError.3tiff +69 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFFieldDataType.3tiff +53 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFFieldName.3tiff +52 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFFieldPassCount.3tiff +73 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFFieldReadCount.3tiff +77 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFFieldTag.3tiff +56 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFFieldWriteCount.3tiff +88 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFFlush.3tiff +64 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFGetField.3tiff +229 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFOpen.3tiff +279 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFPrintDirectory.3tiff +70 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFRGBAImage.3tiff +286 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFReadDirectory.3tiff +164 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFReadEncodedStrip.3tiff +78 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFReadEncodedTile.3tiff +76 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFReadRGBAImage.3tiff +218 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFReadRGBAStrip.3tiff +170 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFReadRGBATile.3tiff +171 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFReadRawStrip.3tiff +64 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFReadRawTile.3tiff +65 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFReadScanline.3tiff +94 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFReadTile.3tiff +84 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFSetDirectory.3tiff +79 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFSetField.3tiff +217 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFWarning.3tiff +70 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFWriteDirectory.3tiff +138 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFWriteEncodedStrip.3tiff +102 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFWriteEncodedTile.3tiff +96 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFWriteRawStrip.3tiff +96 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFWriteRawTile.3tiff +84 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFWriteScanline.3tiff +154 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFWriteTile.3tiff +77 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFbuffer.3tiff +77 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFcodec.3tiff +82 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFcolor.3tiff +268 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFmemory.3tiff +90 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFquery.3tiff +142 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFsize.3tiff +59 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFstrip.3tiff +99 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFswab.3tiff +80 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/TIFFtile.3tiff +131 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/fax2ps.1 +159 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/fax2tiff.1 +286 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/libtiff.3tiff +545 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/pal2rgb.1 +111 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/ppm2tiff.1 +105 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/raw2tiff.1 +196 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/rgb2ycbcr.1 +99 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/thumbnail.1 +90 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/tiff2bw.1 +94 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/tiff2pdf.1 +254 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/tiff2ps.1 +294 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/tiff2rgba.1 +97 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/tiffcmp.1 +87 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/tiffcp.1 +317 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/tiffcrop.1 +571 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/tiffdither.1 +135 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/tiffdump.1 +81 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/tiffgt.1 +245 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/tiffinfo.1 +88 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/tiffmedian.1 +112 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/tiffset.1 +99 -0
- data/vendor/gitlab.com/libtiff/libtiff/man/tiffsplit.1 +69 -0
- data/vendor/gitlab.com/libtiff/libtiff/nmake.opt +229 -0
- data/vendor/gitlab.com/libtiff/libtiff/port/.cvsignore +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/port/CMakeLists.txt +60 -0
- data/vendor/gitlab.com/libtiff/libtiff/port/Makefile.am +35 -0
- data/vendor/gitlab.com/libtiff/libtiff/port/Makefile.in +656 -0
- data/vendor/gitlab.com/libtiff/libtiff/port/Makefile.vc +44 -0
- data/vendor/gitlab.com/libtiff/libtiff/port/dummy.c +12 -0
- data/vendor/gitlab.com/libtiff/libtiff/port/getopt.c +125 -0
- data/vendor/gitlab.com/libtiff/libtiff/port/lfind.c +62 -0
- data/vendor/gitlab.com/libtiff/libtiff/port/libport.h +60 -0
- data/vendor/gitlab.com/libtiff/libtiff/port/snprintf.c +38 -0
- data/vendor/gitlab.com/libtiff/libtiff/port/strcasecmp.c +51 -0
- data/vendor/gitlab.com/libtiff/libtiff/port/strtoul.c +109 -0
- data/vendor/gitlab.com/libtiff/libtiff/port/strtoull.c +116 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/.cvsignore +12 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/CMakeLists.txt +382 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/Makefile.am +334 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/Makefile.in +1987 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/TiffSplitTest.cmake +34 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/TiffTest.cmake +63 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/TiffTestCommon.cmake +108 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/ascii_tag.c +177 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/check_tag.c +91 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/common.sh +122 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/custom_dir.c +247 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/images/README.txt +29 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/images/logluv-3c-16b.tiff +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/images/minisblack-1c-16b.tiff +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/images/minisblack-1c-8b.pgm +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/images/minisblack-1c-8b.tiff +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/images/minisblack-2c-8b-alpha.tiff +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/images/miniswhite-1c-1b.pbm +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/images/miniswhite-1c-1b.tiff +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/images/palette-1c-1b.tiff +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/images/palette-1c-4b.tiff +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/images/palette-1c-8b.tiff +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/images/quad-lzw-compat.tiff +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/images/quad-tile.jpg.tiff +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/images/rgb-3c-16b.tiff +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/images/rgb-3c-8b.ppm +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/images/rgb-3c-8b.tiff +0 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/long_tag.c +156 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/ppm2tiff_pbm.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/ppm2tiff_pgm.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/ppm2tiff_ppm.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/raw_decode.c +304 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/rewrite_tag.c +344 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/short_tag.c +205 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/strip.c +290 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/strip_rw.c +157 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/test_arrays.c +829 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/test_arrays.h +63 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiff2bw-palette-1c-8b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiff2bw-quad-lzw-compat.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiff2bw-rgb-3c-8b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiff2pdf.sh +6 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiff2ps-EPS1.sh +6 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiff2ps-PS1.sh +6 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiff2ps-PS2.sh +6 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiff2ps-PS3.sh +6 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiff2rgba-logluv-3c-16b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiff2rgba-minisblack-1c-16b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiff2rgba-minisblack-1c-8b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiff2rgba-minisblack-2c-8b-alpha.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiff2rgba-miniswhite-1c-1b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiff2rgba-palette-1c-1b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiff2rgba-palette-1c-4b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiff2rgba-palette-1c-8b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiff2rgba-quad-tile.jpg.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiff2rgba-rgb-3c-16b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiff2rgba-rgb-3c-8b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcp-g3-1d-fill.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcp-g3-1d.sh +6 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcp-g3-2d-fill.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcp-g3-2d.sh +6 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcp-g3.sh +6 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcp-g4.sh +6 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcp-logluv.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcp-lzw-compat.sh +6 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcp-split-join.sh +16 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcp-split.sh +13 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcp-thumbnail.sh +10 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-R90-logluv-3c-16b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-R90-minisblack-1c-16b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-R90-minisblack-1c-8b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-R90-minisblack-2c-8b-alpha.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-R90-miniswhite-1c-1b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-R90-palette-1c-1b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-R90-palette-1c-4b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-R90-palette-1c-8b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-R90-quad-tile.jpg.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-R90-rgb-3c-16b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-R90-rgb-3c-8b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-doubleflip-logluv-3c-16b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-doubleflip-minisblack-1c-16b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-doubleflip-minisblack-1c-8b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-doubleflip-minisblack-2c-8b-alpha.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-doubleflip-miniswhite-1c-1b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-doubleflip-palette-1c-1b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-doubleflip-palette-1c-4b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-doubleflip-palette-1c-8b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-doubleflip-quad-tile.jpg.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-doubleflip-rgb-3c-16b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-doubleflip-rgb-3c-8b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extract-logluv-3c-16b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extract-minisblack-1c-16b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extract-minisblack-1c-8b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extract-minisblack-2c-8b-alpha.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extract-miniswhite-1c-1b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extract-palette-1c-1b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extract-palette-1c-4b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extract-palette-1c-8b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extract-quad-tile.jpg.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extract-rgb-3c-16b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extract-rgb-3c-8b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extractz14-logluv-3c-16b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extractz14-minisblack-1c-16b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extractz14-minisblack-1c-8b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extractz14-minisblack-2c-8b-alpha.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extractz14-miniswhite-1c-1b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extractz14-palette-1c-1b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extractz14-palette-1c-4b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extractz14-palette-1c-8b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extractz14-quad-tile.jpg.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extractz14-rgb-3c-16b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffcrop-extractz14-rgb-3c-8b.sh +7 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffdump.sh +6 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tiffinfo.sh +6 -0
- data/vendor/gitlab.com/libtiff/libtiff/test/tifftest.h +42 -0
- data/vendor/gitlab.com/libtiff/libtiff/tiff.spec +68 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/.cvsignore +27 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/CMakeLists.txt +125 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/Makefile.am +138 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/Makefile.in +955 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/Makefile.lcc +133 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/Makefile.vc +52 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/fax2ps.c +463 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/fax2tiff.c +491 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/pal2rgb.c +438 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/ppm2tiff.c +397 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/raw2tiff.c +690 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/rgb2ycbcr.c +397 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/thumbnail.c +691 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/tiff2bw.c +501 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/tiff2pdf.c +5594 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/tiff2ps.c +3106 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/tiff2rgba.c +569 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/tiffcmp.c +659 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/tiffcp.c +1913 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/tiffcrop.c +9231 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/tiffdither.c +347 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/tiffdump.c +889 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/tiffgt.c +486 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/tiffinfo.c +488 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/tiffinfoce.c +472 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/tiffmedian.c +918 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/tiffset.c +356 -0
- data/vendor/gitlab.com/libtiff/libtiff/tools/tiffsplit.c +305 -0
- metadata +692 -0
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/* $Id: tif_wince.c,v 1.3 2010-03-10 18:56:49 bfriesen Exp $ */
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 1988-1997 Sam Leffler
|
|
5
|
+
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
|
|
6
|
+
*
|
|
7
|
+
* Permission to use, copy, modify, distribute, and sell this software and
|
|
8
|
+
* its documentation for any purpose is hereby granted without fee, provided
|
|
9
|
+
* that (i) the above copyright notices and this permission notice appear in
|
|
10
|
+
* all copies of the software and related documentation, and (ii) the names of
|
|
11
|
+
* Sam Leffler and Silicon Graphics may not be used in any advertising or
|
|
12
|
+
* publicity relating to the software without the specific, prior written
|
|
13
|
+
* permission of Sam Leffler and Silicon Graphics.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
|
16
|
+
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
|
17
|
+
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
|
18
|
+
*
|
|
19
|
+
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
|
|
20
|
+
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
|
21
|
+
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
22
|
+
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
|
23
|
+
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
|
24
|
+
* OF THIS SOFTWARE.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/*
|
|
28
|
+
* Windows CE-specific routines for TIFF Library.
|
|
29
|
+
* Adapted from tif_win32.c 01/10/2006 by Mateusz Loskot (mateusz@loskot.net)
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
#ifndef _WIN32_WCE
|
|
33
|
+
# error "Only Windows CE target is supported!"
|
|
34
|
+
#endif
|
|
35
|
+
|
|
36
|
+
#include "tiffiop.h"
|
|
37
|
+
#include <windows.h>
|
|
38
|
+
|
|
39
|
+
/* Turn off console support on Windows CE. */
|
|
40
|
+
#undef TIF_PLATFORM_CONSOLE
|
|
41
|
+
|
|
42
|
+
COMPILATION SHOULD FAIL
|
|
43
|
+
This file is not yet updated to reflect changes in LibTiff 4.0. If you have
|
|
44
|
+
the opportunity to update and test this file, please contact LibTiff folks
|
|
45
|
+
for all assistance you may require and contribute the results
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
/*
|
|
49
|
+
* Open a TIFF file for read/writing.
|
|
50
|
+
*/
|
|
51
|
+
TIFF*
|
|
52
|
+
TIFFOpen(const char* name, const char* mode)
|
|
53
|
+
{
|
|
54
|
+
static const char module[] = "TIFFOpen";
|
|
55
|
+
thandle_t fd;
|
|
56
|
+
int m;
|
|
57
|
+
DWORD dwMode;
|
|
58
|
+
TIFF* tif;
|
|
59
|
+
size_t nLen;
|
|
60
|
+
size_t nWideLen;
|
|
61
|
+
wchar_t* wchName;
|
|
62
|
+
|
|
63
|
+
m = _TIFFgetMode(mode, module);
|
|
64
|
+
|
|
65
|
+
switch(m)
|
|
66
|
+
{
|
|
67
|
+
case O_RDONLY:
|
|
68
|
+
dwMode = OPEN_EXISTING;
|
|
69
|
+
break;
|
|
70
|
+
case O_RDWR:
|
|
71
|
+
dwMode = OPEN_ALWAYS;
|
|
72
|
+
break;
|
|
73
|
+
case O_RDWR|O_CREAT:
|
|
74
|
+
dwMode = OPEN_ALWAYS;
|
|
75
|
+
break;
|
|
76
|
+
case O_RDWR|O_TRUNC:
|
|
77
|
+
dwMode = CREATE_ALWAYS;
|
|
78
|
+
break;
|
|
79
|
+
case O_RDWR|O_CREAT|O_TRUNC:
|
|
80
|
+
dwMode = CREATE_ALWAYS;
|
|
81
|
+
break;
|
|
82
|
+
default:
|
|
83
|
+
return ((TIFF*)0);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* On Windows CE, CreateFile is mapped to CreateFileW,
|
|
87
|
+
* but file path is passed as char-based string,
|
|
88
|
+
* so the path has to be converted to wchar_t.
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
nWideLen = 0;
|
|
92
|
+
wchName = NULL;
|
|
93
|
+
nLen = strlen(name) + 1;
|
|
94
|
+
|
|
95
|
+
nWideLen = MultiByteToWideChar(CP_ACP, 0, name, nLen, NULL, 0);
|
|
96
|
+
wchName = (wchar_t*)malloc(sizeof(wchar_t) * nWideLen);
|
|
97
|
+
if (NULL == wchName)
|
|
98
|
+
{
|
|
99
|
+
TIFFErrorExt(0, module, "Memory allocation error!");
|
|
100
|
+
return ((TIFF *)0);
|
|
101
|
+
}
|
|
102
|
+
memset(wchName, 0, sizeof(wchar_t) * nWideLen);
|
|
103
|
+
MultiByteToWideChar(CP_ACP, 0, name, nLen, wchName, nWideLen);
|
|
104
|
+
|
|
105
|
+
fd = (thandle_t)CreateFile(wchName,
|
|
106
|
+
(m == O_RDONLY)?GENERIC_READ:(GENERIC_READ | GENERIC_WRITE),
|
|
107
|
+
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, dwMode,
|
|
108
|
+
(m == O_RDONLY)?FILE_ATTRIBUTE_READONLY:FILE_ATTRIBUTE_NORMAL,
|
|
109
|
+
NULL);
|
|
110
|
+
|
|
111
|
+
free(wchName);
|
|
112
|
+
|
|
113
|
+
if (fd == INVALID_HANDLE_VALUE) {
|
|
114
|
+
TIFFErrorExt(0, module, "%s: Cannot open", name);
|
|
115
|
+
return ((TIFF *)0);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* TODO - mloskot: change to TIFFdOpenW and pass wchar path */
|
|
119
|
+
|
|
120
|
+
tif = TIFFFdOpen((int)fd, name, mode);
|
|
121
|
+
if(!tif)
|
|
122
|
+
CloseHandle(fd);
|
|
123
|
+
return tif;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/*
|
|
127
|
+
* Open a TIFF file with a Unicode filename, for read/writing.
|
|
128
|
+
*/
|
|
129
|
+
TIFF*
|
|
130
|
+
TIFFOpenW(const wchar_t* name, const char* mode)
|
|
131
|
+
{
|
|
132
|
+
static const char module[] = "TIFFOpenW";
|
|
133
|
+
thandle_t fd;
|
|
134
|
+
int m;
|
|
135
|
+
DWORD dwMode;
|
|
136
|
+
int mbsize;
|
|
137
|
+
char *mbname;
|
|
138
|
+
TIFF *tif;
|
|
139
|
+
|
|
140
|
+
m = _TIFFgetMode(mode, module);
|
|
141
|
+
|
|
142
|
+
switch(m) {
|
|
143
|
+
case O_RDONLY: dwMode = OPEN_EXISTING; break;
|
|
144
|
+
case O_RDWR: dwMode = OPEN_ALWAYS; break;
|
|
145
|
+
case O_RDWR|O_CREAT: dwMode = OPEN_ALWAYS; break;
|
|
146
|
+
case O_RDWR|O_TRUNC: dwMode = CREATE_ALWAYS; break;
|
|
147
|
+
case O_RDWR|O_CREAT|O_TRUNC: dwMode = CREATE_ALWAYS; break;
|
|
148
|
+
default: return ((TIFF*)0);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* On Windows CE, CreateFile is mapped to CreateFileW,
|
|
152
|
+
* so no conversion of wchar_t to char is required.
|
|
153
|
+
*/
|
|
154
|
+
|
|
155
|
+
fd = (thandle_t)CreateFile(name,
|
|
156
|
+
(m == O_RDONLY)?GENERIC_READ:(GENERIC_READ|GENERIC_WRITE),
|
|
157
|
+
FILE_SHARE_READ, NULL, dwMode,
|
|
158
|
+
(m == O_RDONLY)?FILE_ATTRIBUTE_READONLY:FILE_ATTRIBUTE_NORMAL,
|
|
159
|
+
NULL);
|
|
160
|
+
if (fd == INVALID_HANDLE_VALUE) {
|
|
161
|
+
TIFFErrorExt(0, module, "%S: Cannot open", name);
|
|
162
|
+
return ((TIFF *)0);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
mbname = NULL;
|
|
166
|
+
mbsize = WideCharToMultiByte(CP_ACP, 0, name, -1, NULL, 0, NULL, NULL);
|
|
167
|
+
if (mbsize > 0) {
|
|
168
|
+
mbname = (char *)_TIFFmalloc(mbsize);
|
|
169
|
+
if (!mbname) {
|
|
170
|
+
TIFFErrorExt(0, module,
|
|
171
|
+
"Can't allocate space for filename conversion buffer");
|
|
172
|
+
return ((TIFF*)0);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
WideCharToMultiByte(CP_ACP, 0, name, -1, mbname, mbsize,
|
|
176
|
+
NULL, NULL);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
tif = TIFFFdOpen((int)fd,
|
|
180
|
+
(mbname != NULL) ? mbname : "<unknown>", mode);
|
|
181
|
+
if(!tif)
|
|
182
|
+
CloseHandle(fd);
|
|
183
|
+
|
|
184
|
+
_TIFFfree(mbname);
|
|
185
|
+
|
|
186
|
+
return tif;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
static void
|
|
190
|
+
Win32WarningHandler(const char* module, const char* fmt, va_list ap)
|
|
191
|
+
{
|
|
192
|
+
/* On Windows CE, MessageBox is mapped to wide-char based MessageBoxW. */
|
|
193
|
+
|
|
194
|
+
size_t nWideLen = 0;
|
|
195
|
+
LPTSTR szWideTitle = NULL;
|
|
196
|
+
LPTSTR szWideMsg = NULL;
|
|
197
|
+
|
|
198
|
+
LPSTR szTitle;
|
|
199
|
+
LPSTR szTmp;
|
|
200
|
+
LPCSTR szTitleText = "%s Warning";
|
|
201
|
+
LPCSTR szDefaultModule = "LIBTIFF";
|
|
202
|
+
LPCSTR szTmpModule;
|
|
203
|
+
|
|
204
|
+
szTmpModule = (module == NULL) ? szDefaultModule : module;
|
|
205
|
+
if ((szTitle = (LPSTR)LocalAlloc(LMEM_FIXED,
|
|
206
|
+
(strlen(szTmpModule) + strlen(szTitleText)
|
|
207
|
+
+ strlen(fmt) + 128) * sizeof(char))) == NULL)
|
|
208
|
+
return;
|
|
209
|
+
|
|
210
|
+
sprintf(szTitle, szTitleText, szTmpModule);
|
|
211
|
+
szTmp = szTitle + (strlen(szTitle) + 2) * sizeof(char);
|
|
212
|
+
vsprintf(szTmp, fmt, ap);
|
|
213
|
+
|
|
214
|
+
/* Convert error message to Unicode. */
|
|
215
|
+
|
|
216
|
+
nWideLen = MultiByteToWideChar(CP_ACP, 0, szTitle, -1, NULL, 0);
|
|
217
|
+
szWideTitle = (wchar_t*)malloc(sizeof(wchar_t) * nWideLen);
|
|
218
|
+
MultiByteToWideChar(CP_ACP, 0, szTitle, -1, szWideTitle, nWideLen);
|
|
219
|
+
|
|
220
|
+
nWideLen = MultiByteToWideChar(CP_ACP, 0, szTmp, -1, NULL, 0);
|
|
221
|
+
szWideMsg = (wchar_t*)malloc(sizeof(wchar_t) * nWideLen);
|
|
222
|
+
MultiByteToWideChar(CP_ACP, 0, szTmp, -1, szWideMsg, nWideLen);
|
|
223
|
+
|
|
224
|
+
/* Display message */
|
|
225
|
+
|
|
226
|
+
MessageBox(GetFocus(), szWideMsg, szWideTitle, MB_OK | MB_ICONEXCLAMATION);
|
|
227
|
+
|
|
228
|
+
/* Free resources */
|
|
229
|
+
|
|
230
|
+
LocalFree(szTitle);
|
|
231
|
+
free(szWideMsg);
|
|
232
|
+
free(szWideTitle);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
TIFFErrorHandler _TIFFwarningHandler = Win32WarningHandler;
|
|
236
|
+
|
|
237
|
+
static void
|
|
238
|
+
Win32ErrorHandler(const char* module, const char* fmt, va_list ap)
|
|
239
|
+
{
|
|
240
|
+
/* On Windows CE, MessageBox is mapped to wide-char based MessageBoxW. */
|
|
241
|
+
|
|
242
|
+
size_t nWideLen = 0;
|
|
243
|
+
LPTSTR szWideTitle = NULL;
|
|
244
|
+
LPTSTR szWideMsg = NULL;
|
|
245
|
+
|
|
246
|
+
LPSTR szTitle;
|
|
247
|
+
LPSTR szTmp;
|
|
248
|
+
LPCSTR szTitleText = "%s Error";
|
|
249
|
+
LPCSTR szDefaultModule = "LIBTIFF";
|
|
250
|
+
LPCSTR szTmpModule;
|
|
251
|
+
|
|
252
|
+
szTmpModule = (module == NULL) ? szDefaultModule : module;
|
|
253
|
+
if ((szTitle = (LPSTR)LocalAlloc(LMEM_FIXED,
|
|
254
|
+
(strlen(szTmpModule) + strlen(szTitleText)
|
|
255
|
+
+ strlen(fmt) + 128) * sizeof(char))) == NULL)
|
|
256
|
+
return;
|
|
257
|
+
|
|
258
|
+
sprintf(szTitle, szTitleText, szTmpModule);
|
|
259
|
+
szTmp = szTitle + (strlen(szTitle) + 2) * sizeof(char);
|
|
260
|
+
vsprintf(szTmp, fmt, ap);
|
|
261
|
+
|
|
262
|
+
/* Convert error message to Unicode. */
|
|
263
|
+
|
|
264
|
+
nWideLen = MultiByteToWideChar(CP_ACP, 0, szTitle, -1, NULL, 0);
|
|
265
|
+
szWideTitle = (wchar_t*)malloc(sizeof(wchar_t) * nWideLen);
|
|
266
|
+
MultiByteToWideChar(CP_ACP, 0, szTitle, -1, szWideTitle, nWideLen);
|
|
267
|
+
|
|
268
|
+
nWideLen = MultiByteToWideChar(CP_ACP, 0, szTmp, -1, NULL, 0);
|
|
269
|
+
szWideMsg = (wchar_t*)malloc(sizeof(wchar_t) * nWideLen);
|
|
270
|
+
MultiByteToWideChar(CP_ACP, 0, szTmp, -1, szWideMsg, nWideLen);
|
|
271
|
+
|
|
272
|
+
/* Display message */
|
|
273
|
+
|
|
274
|
+
MessageBox(GetFocus(), szWideMsg, szWideTitle, MB_OK | MB_ICONEXCLAMATION);
|
|
275
|
+
|
|
276
|
+
/* Free resources */
|
|
277
|
+
|
|
278
|
+
LocalFree(szTitle);
|
|
279
|
+
free(szWideMsg);
|
|
280
|
+
free(szWideTitle);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler;
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
/* vim: set ts=8 sts=8 sw=8 noet: */
|
|
287
|
+
/*
|
|
288
|
+
* Local Variables:
|
|
289
|
+
* mode: c
|
|
290
|
+
* c-basic-offset: 8
|
|
291
|
+
* fill-column: 78
|
|
292
|
+
* End:
|
|
293
|
+
*/
|
|
@@ -0,0 +1,834 @@
|
|
|
1
|
+
/* $Id: tif_write.c,v 1.46 2016-12-03 21:57:44 erouault Exp $ */
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 1988-1997 Sam Leffler
|
|
5
|
+
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
|
|
6
|
+
*
|
|
7
|
+
* Permission to use, copy, modify, distribute, and sell this software and
|
|
8
|
+
* its documentation for any purpose is hereby granted without fee, provided
|
|
9
|
+
* that (i) the above copyright notices and this permission notice appear in
|
|
10
|
+
* all copies of the software and related documentation, and (ii) the names of
|
|
11
|
+
* Sam Leffler and Silicon Graphics may not be used in any advertising or
|
|
12
|
+
* publicity relating to the software without the specific, prior written
|
|
13
|
+
* permission of Sam Leffler and Silicon Graphics.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
|
16
|
+
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
|
17
|
+
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
|
18
|
+
*
|
|
19
|
+
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
|
|
20
|
+
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
|
21
|
+
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
22
|
+
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
|
23
|
+
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
|
24
|
+
* OF THIS SOFTWARE.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/*
|
|
28
|
+
* TIFF Library.
|
|
29
|
+
*
|
|
30
|
+
* Scanline-oriented Write Support
|
|
31
|
+
*/
|
|
32
|
+
#include "tiffiop.h"
|
|
33
|
+
#include <stdio.h>
|
|
34
|
+
|
|
35
|
+
#define STRIPINCR 20 /* expansion factor on strip array */
|
|
36
|
+
|
|
37
|
+
#define WRITECHECKSTRIPS(tif, module) \
|
|
38
|
+
(((tif)->tif_flags&TIFF_BEENWRITING) || TIFFWriteCheck((tif),0,module))
|
|
39
|
+
#define WRITECHECKTILES(tif, module) \
|
|
40
|
+
(((tif)->tif_flags&TIFF_BEENWRITING) || TIFFWriteCheck((tif),1,module))
|
|
41
|
+
#define BUFFERCHECK(tif) \
|
|
42
|
+
((((tif)->tif_flags & TIFF_BUFFERSETUP) && tif->tif_rawdata) || \
|
|
43
|
+
TIFFWriteBufferSetup((tif), NULL, (tmsize_t) -1))
|
|
44
|
+
|
|
45
|
+
static int TIFFGrowStrips(TIFF* tif, uint32 delta, const char* module);
|
|
46
|
+
static int TIFFAppendToStrip(TIFF* tif, uint32 strip, uint8* data, tmsize_t cc);
|
|
47
|
+
|
|
48
|
+
int
|
|
49
|
+
TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample)
|
|
50
|
+
{
|
|
51
|
+
static const char module[] = "TIFFWriteScanline";
|
|
52
|
+
register TIFFDirectory *td;
|
|
53
|
+
int status, imagegrew = 0;
|
|
54
|
+
uint32 strip;
|
|
55
|
+
|
|
56
|
+
if (!WRITECHECKSTRIPS(tif, module))
|
|
57
|
+
return (-1);
|
|
58
|
+
/*
|
|
59
|
+
* Handle delayed allocation of data buffer. This
|
|
60
|
+
* permits it to be sized more intelligently (using
|
|
61
|
+
* directory information).
|
|
62
|
+
*/
|
|
63
|
+
if (!BUFFERCHECK(tif))
|
|
64
|
+
return (-1);
|
|
65
|
+
tif->tif_flags |= TIFF_BUF4WRITE; /* not strictly sure this is right*/
|
|
66
|
+
|
|
67
|
+
td = &tif->tif_dir;
|
|
68
|
+
/*
|
|
69
|
+
* Extend image length if needed
|
|
70
|
+
* (but only for PlanarConfig=1).
|
|
71
|
+
*/
|
|
72
|
+
if (row >= td->td_imagelength) { /* extend image */
|
|
73
|
+
if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {
|
|
74
|
+
TIFFErrorExt(tif->tif_clientdata, module,
|
|
75
|
+
"Can not change \"ImageLength\" when using separate planes");
|
|
76
|
+
return (-1);
|
|
77
|
+
}
|
|
78
|
+
td->td_imagelength = row+1;
|
|
79
|
+
imagegrew = 1;
|
|
80
|
+
}
|
|
81
|
+
/*
|
|
82
|
+
* Calculate strip and check for crossings.
|
|
83
|
+
*/
|
|
84
|
+
if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {
|
|
85
|
+
if (sample >= td->td_samplesperpixel) {
|
|
86
|
+
TIFFErrorExt(tif->tif_clientdata, module,
|
|
87
|
+
"%lu: Sample out of range, max %lu",
|
|
88
|
+
(unsigned long) sample, (unsigned long) td->td_samplesperpixel);
|
|
89
|
+
return (-1);
|
|
90
|
+
}
|
|
91
|
+
strip = sample*td->td_stripsperimage + row/td->td_rowsperstrip;
|
|
92
|
+
} else
|
|
93
|
+
strip = row / td->td_rowsperstrip;
|
|
94
|
+
/*
|
|
95
|
+
* Check strip array to make sure there's space. We don't support
|
|
96
|
+
* dynamically growing files that have data organized in separate
|
|
97
|
+
* bitplanes because it's too painful. In that case we require that
|
|
98
|
+
* the imagelength be set properly before the first write (so that the
|
|
99
|
+
* strips array will be fully allocated above).
|
|
100
|
+
*/
|
|
101
|
+
if (strip >= td->td_nstrips && !TIFFGrowStrips(tif, 1, module))
|
|
102
|
+
return (-1);
|
|
103
|
+
if (strip != tif->tif_curstrip) {
|
|
104
|
+
/*
|
|
105
|
+
* Changing strips -- flush any data present.
|
|
106
|
+
*/
|
|
107
|
+
if (!TIFFFlushData(tif))
|
|
108
|
+
return (-1);
|
|
109
|
+
tif->tif_curstrip = strip;
|
|
110
|
+
/*
|
|
111
|
+
* Watch out for a growing image. The value of strips/image
|
|
112
|
+
* will initially be 1 (since it can't be deduced until the
|
|
113
|
+
* imagelength is known).
|
|
114
|
+
*/
|
|
115
|
+
if (strip >= td->td_stripsperimage && imagegrew)
|
|
116
|
+
td->td_stripsperimage =
|
|
117
|
+
TIFFhowmany_32(td->td_imagelength,td->td_rowsperstrip);
|
|
118
|
+
if (td->td_stripsperimage == 0) {
|
|
119
|
+
TIFFErrorExt(tif->tif_clientdata, module, "Zero strips per image");
|
|
120
|
+
return (-1);
|
|
121
|
+
}
|
|
122
|
+
tif->tif_row =
|
|
123
|
+
(strip % td->td_stripsperimage) * td->td_rowsperstrip;
|
|
124
|
+
if ((tif->tif_flags & TIFF_CODERSETUP) == 0) {
|
|
125
|
+
if (!(*tif->tif_setupencode)(tif))
|
|
126
|
+
return (-1);
|
|
127
|
+
tif->tif_flags |= TIFF_CODERSETUP;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
tif->tif_rawcc = 0;
|
|
131
|
+
tif->tif_rawcp = tif->tif_rawdata;
|
|
132
|
+
|
|
133
|
+
if( td->td_stripbytecount[strip] > 0 )
|
|
134
|
+
{
|
|
135
|
+
/* if we are writing over existing tiles, zero length */
|
|
136
|
+
td->td_stripbytecount[strip] = 0;
|
|
137
|
+
|
|
138
|
+
/* this forces TIFFAppendToStrip() to do a seek */
|
|
139
|
+
tif->tif_curoff = 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (!(*tif->tif_preencode)(tif, sample))
|
|
143
|
+
return (-1);
|
|
144
|
+
tif->tif_flags |= TIFF_POSTENCODE;
|
|
145
|
+
}
|
|
146
|
+
/*
|
|
147
|
+
* Ensure the write is either sequential or at the
|
|
148
|
+
* beginning of a strip (or that we can randomly
|
|
149
|
+
* access the data -- i.e. no encoding).
|
|
150
|
+
*/
|
|
151
|
+
if (row != tif->tif_row) {
|
|
152
|
+
if (row < tif->tif_row) {
|
|
153
|
+
/*
|
|
154
|
+
* Moving backwards within the same strip:
|
|
155
|
+
* backup to the start and then decode
|
|
156
|
+
* forward (below).
|
|
157
|
+
*/
|
|
158
|
+
tif->tif_row = (strip % td->td_stripsperimage) *
|
|
159
|
+
td->td_rowsperstrip;
|
|
160
|
+
tif->tif_rawcp = tif->tif_rawdata;
|
|
161
|
+
}
|
|
162
|
+
/*
|
|
163
|
+
* Seek forward to the desired row.
|
|
164
|
+
*/
|
|
165
|
+
if (!(*tif->tif_seek)(tif, row - tif->tif_row))
|
|
166
|
+
return (-1);
|
|
167
|
+
tif->tif_row = row;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/* swab if needed - note that source buffer will be altered */
|
|
171
|
+
tif->tif_postdecode( tif, (uint8*) buf, tif->tif_scanlinesize );
|
|
172
|
+
|
|
173
|
+
status = (*tif->tif_encoderow)(tif, (uint8*) buf,
|
|
174
|
+
tif->tif_scanlinesize, sample);
|
|
175
|
+
|
|
176
|
+
/* we are now poised at the beginning of the next row */
|
|
177
|
+
tif->tif_row = row + 1;
|
|
178
|
+
return (status);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/*
|
|
182
|
+
* Encode the supplied data and write it to the
|
|
183
|
+
* specified strip.
|
|
184
|
+
*
|
|
185
|
+
* NB: Image length must be setup before writing.
|
|
186
|
+
*/
|
|
187
|
+
tmsize_t
|
|
188
|
+
TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc)
|
|
189
|
+
{
|
|
190
|
+
static const char module[] = "TIFFWriteEncodedStrip";
|
|
191
|
+
TIFFDirectory *td = &tif->tif_dir;
|
|
192
|
+
uint16 sample;
|
|
193
|
+
|
|
194
|
+
if (!WRITECHECKSTRIPS(tif, module))
|
|
195
|
+
return ((tmsize_t) -1);
|
|
196
|
+
/*
|
|
197
|
+
* Check strip array to make sure there's space.
|
|
198
|
+
* We don't support dynamically growing files that
|
|
199
|
+
* have data organized in separate bitplanes because
|
|
200
|
+
* it's too painful. In that case we require that
|
|
201
|
+
* the imagelength be set properly before the first
|
|
202
|
+
* write (so that the strips array will be fully
|
|
203
|
+
* allocated above).
|
|
204
|
+
*/
|
|
205
|
+
if (strip >= td->td_nstrips) {
|
|
206
|
+
if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {
|
|
207
|
+
TIFFErrorExt(tif->tif_clientdata, module,
|
|
208
|
+
"Can not grow image by strips when using separate planes");
|
|
209
|
+
return ((tmsize_t) -1);
|
|
210
|
+
}
|
|
211
|
+
if (!TIFFGrowStrips(tif, 1, module))
|
|
212
|
+
return ((tmsize_t) -1);
|
|
213
|
+
td->td_stripsperimage =
|
|
214
|
+
TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip);
|
|
215
|
+
}
|
|
216
|
+
/*
|
|
217
|
+
* Handle delayed allocation of data buffer. This
|
|
218
|
+
* permits it to be sized according to the directory
|
|
219
|
+
* info.
|
|
220
|
+
*/
|
|
221
|
+
if (!BUFFERCHECK(tif))
|
|
222
|
+
return ((tmsize_t) -1);
|
|
223
|
+
|
|
224
|
+
tif->tif_flags |= TIFF_BUF4WRITE;
|
|
225
|
+
tif->tif_curstrip = strip;
|
|
226
|
+
|
|
227
|
+
if (td->td_stripsperimage == 0) {
|
|
228
|
+
TIFFErrorExt(tif->tif_clientdata, module, "Zero strips per image");
|
|
229
|
+
return ((tmsize_t) -1);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip;
|
|
233
|
+
if ((tif->tif_flags & TIFF_CODERSETUP) == 0) {
|
|
234
|
+
if (!(*tif->tif_setupencode)(tif))
|
|
235
|
+
return ((tmsize_t) -1);
|
|
236
|
+
tif->tif_flags |= TIFF_CODERSETUP;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if( td->td_stripbytecount[strip] > 0 )
|
|
240
|
+
{
|
|
241
|
+
/* Make sure that at the first attempt of rewriting the tile, we will have */
|
|
242
|
+
/* more bytes available in the output buffer than the previous byte count, */
|
|
243
|
+
/* so that TIFFAppendToStrip() will detect the overflow when it is called the first */
|
|
244
|
+
/* time if the new compressed tile is bigger than the older one. (GDAL #4771) */
|
|
245
|
+
if( tif->tif_rawdatasize <= (tmsize_t)td->td_stripbytecount[strip] )
|
|
246
|
+
{
|
|
247
|
+
if( !(TIFFWriteBufferSetup(tif, NULL,
|
|
248
|
+
(tmsize_t)TIFFroundup_64((uint64)(td->td_stripbytecount[strip] + 1), 1024))) )
|
|
249
|
+
return ((tmsize_t)(-1));
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* Force TIFFAppendToStrip() to consider placing data at end
|
|
253
|
+
of file. */
|
|
254
|
+
tif->tif_curoff = 0;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
tif->tif_rawcc = 0;
|
|
258
|
+
tif->tif_rawcp = tif->tif_rawdata;
|
|
259
|
+
|
|
260
|
+
tif->tif_flags &= ~TIFF_POSTENCODE;
|
|
261
|
+
|
|
262
|
+
/* shortcut to avoid an extra memcpy() */
|
|
263
|
+
if( td->td_compression == COMPRESSION_NONE )
|
|
264
|
+
{
|
|
265
|
+
/* swab if needed - note that source buffer will be altered */
|
|
266
|
+
tif->tif_postdecode( tif, (uint8*) data, cc );
|
|
267
|
+
|
|
268
|
+
if (!isFillOrder(tif, td->td_fillorder) &&
|
|
269
|
+
(tif->tif_flags & TIFF_NOBITREV) == 0)
|
|
270
|
+
TIFFReverseBits((uint8*) data, cc);
|
|
271
|
+
|
|
272
|
+
if (cc > 0 &&
|
|
273
|
+
!TIFFAppendToStrip(tif, strip, (uint8*) data, cc))
|
|
274
|
+
return ((tmsize_t) -1);
|
|
275
|
+
return (cc);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
sample = (uint16)(strip / td->td_stripsperimage);
|
|
279
|
+
if (!(*tif->tif_preencode)(tif, sample))
|
|
280
|
+
return ((tmsize_t) -1);
|
|
281
|
+
|
|
282
|
+
/* swab if needed - note that source buffer will be altered */
|
|
283
|
+
tif->tif_postdecode( tif, (uint8*) data, cc );
|
|
284
|
+
|
|
285
|
+
if (!(*tif->tif_encodestrip)(tif, (uint8*) data, cc, sample))
|
|
286
|
+
return ((tmsize_t) -1);
|
|
287
|
+
if (!(*tif->tif_postencode)(tif))
|
|
288
|
+
return ((tmsize_t) -1);
|
|
289
|
+
if (!isFillOrder(tif, td->td_fillorder) &&
|
|
290
|
+
(tif->tif_flags & TIFF_NOBITREV) == 0)
|
|
291
|
+
TIFFReverseBits(tif->tif_rawdata, tif->tif_rawcc);
|
|
292
|
+
if (tif->tif_rawcc > 0 &&
|
|
293
|
+
!TIFFAppendToStrip(tif, strip, tif->tif_rawdata, tif->tif_rawcc))
|
|
294
|
+
return ((tmsize_t) -1);
|
|
295
|
+
tif->tif_rawcc = 0;
|
|
296
|
+
tif->tif_rawcp = tif->tif_rawdata;
|
|
297
|
+
return (cc);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/*
|
|
301
|
+
* Write the supplied data to the specified strip.
|
|
302
|
+
*
|
|
303
|
+
* NB: Image length must be setup before writing.
|
|
304
|
+
*/
|
|
305
|
+
tmsize_t
|
|
306
|
+
TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc)
|
|
307
|
+
{
|
|
308
|
+
static const char module[] = "TIFFWriteRawStrip";
|
|
309
|
+
TIFFDirectory *td = &tif->tif_dir;
|
|
310
|
+
|
|
311
|
+
if (!WRITECHECKSTRIPS(tif, module))
|
|
312
|
+
return ((tmsize_t) -1);
|
|
313
|
+
/*
|
|
314
|
+
* Check strip array to make sure there's space.
|
|
315
|
+
* We don't support dynamically growing files that
|
|
316
|
+
* have data organized in separate bitplanes because
|
|
317
|
+
* it's too painful. In that case we require that
|
|
318
|
+
* the imagelength be set properly before the first
|
|
319
|
+
* write (so that the strips array will be fully
|
|
320
|
+
* allocated above).
|
|
321
|
+
*/
|
|
322
|
+
if (strip >= td->td_nstrips) {
|
|
323
|
+
if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {
|
|
324
|
+
TIFFErrorExt(tif->tif_clientdata, module,
|
|
325
|
+
"Can not grow image by strips when using separate planes");
|
|
326
|
+
return ((tmsize_t) -1);
|
|
327
|
+
}
|
|
328
|
+
/*
|
|
329
|
+
* Watch out for a growing image. The value of
|
|
330
|
+
* strips/image will initially be 1 (since it
|
|
331
|
+
* can't be deduced until the imagelength is known).
|
|
332
|
+
*/
|
|
333
|
+
if (strip >= td->td_stripsperimage)
|
|
334
|
+
td->td_stripsperimage =
|
|
335
|
+
TIFFhowmany_32(td->td_imagelength,td->td_rowsperstrip);
|
|
336
|
+
if (!TIFFGrowStrips(tif, 1, module))
|
|
337
|
+
return ((tmsize_t) -1);
|
|
338
|
+
}
|
|
339
|
+
tif->tif_curstrip = strip;
|
|
340
|
+
if (td->td_stripsperimage == 0) {
|
|
341
|
+
TIFFErrorExt(tif->tif_clientdata, module,"Zero strips per image");
|
|
342
|
+
return ((tmsize_t) -1);
|
|
343
|
+
}
|
|
344
|
+
tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip;
|
|
345
|
+
return (TIFFAppendToStrip(tif, strip, (uint8*) data, cc) ?
|
|
346
|
+
cc : (tmsize_t) -1);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/*
|
|
350
|
+
* Write and compress a tile of data. The
|
|
351
|
+
* tile is selected by the (x,y,z,s) coordinates.
|
|
352
|
+
*/
|
|
353
|
+
tmsize_t
|
|
354
|
+
TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s)
|
|
355
|
+
{
|
|
356
|
+
if (!TIFFCheckTile(tif, x, y, z, s))
|
|
357
|
+
return ((tmsize_t)(-1));
|
|
358
|
+
/*
|
|
359
|
+
* NB: A tile size of -1 is used instead of tif_tilesize knowing
|
|
360
|
+
* that TIFFWriteEncodedTile will clamp this to the tile size.
|
|
361
|
+
* This is done because the tile size may not be defined until
|
|
362
|
+
* after the output buffer is setup in TIFFWriteBufferSetup.
|
|
363
|
+
*/
|
|
364
|
+
return (TIFFWriteEncodedTile(tif,
|
|
365
|
+
TIFFComputeTile(tif, x, y, z, s), buf, (tmsize_t)(-1)));
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/*
|
|
369
|
+
* Encode the supplied data and write it to the
|
|
370
|
+
* specified tile. There must be space for the
|
|
371
|
+
* data. The function clamps individual writes
|
|
372
|
+
* to a tile to the tile size, but does not (and
|
|
373
|
+
* can not) check that multiple writes to the same
|
|
374
|
+
* tile do not write more than tile size data.
|
|
375
|
+
*
|
|
376
|
+
* NB: Image length must be setup before writing; this
|
|
377
|
+
* interface does not support automatically growing
|
|
378
|
+
* the image on each write (as TIFFWriteScanline does).
|
|
379
|
+
*/
|
|
380
|
+
tmsize_t
|
|
381
|
+
TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc)
|
|
382
|
+
{
|
|
383
|
+
static const char module[] = "TIFFWriteEncodedTile";
|
|
384
|
+
TIFFDirectory *td;
|
|
385
|
+
uint16 sample;
|
|
386
|
+
uint32 howmany32;
|
|
387
|
+
|
|
388
|
+
if (!WRITECHECKTILES(tif, module))
|
|
389
|
+
return ((tmsize_t)(-1));
|
|
390
|
+
td = &tif->tif_dir;
|
|
391
|
+
if (tile >= td->td_nstrips) {
|
|
392
|
+
TIFFErrorExt(tif->tif_clientdata, module, "Tile %lu out of range, max %lu",
|
|
393
|
+
(unsigned long) tile, (unsigned long) td->td_nstrips);
|
|
394
|
+
return ((tmsize_t)(-1));
|
|
395
|
+
}
|
|
396
|
+
/*
|
|
397
|
+
* Handle delayed allocation of data buffer. This
|
|
398
|
+
* permits it to be sized more intelligently (using
|
|
399
|
+
* directory information).
|
|
400
|
+
*/
|
|
401
|
+
if (!BUFFERCHECK(tif))
|
|
402
|
+
return ((tmsize_t)(-1));
|
|
403
|
+
|
|
404
|
+
tif->tif_flags |= TIFF_BUF4WRITE;
|
|
405
|
+
tif->tif_curtile = tile;
|
|
406
|
+
|
|
407
|
+
if( td->td_stripbytecount[tile] > 0 )
|
|
408
|
+
{
|
|
409
|
+
/* Make sure that at the first attempt of rewriting the tile, we will have */
|
|
410
|
+
/* more bytes available in the output buffer than the previous byte count, */
|
|
411
|
+
/* so that TIFFAppendToStrip() will detect the overflow when it is called the first */
|
|
412
|
+
/* time if the new compressed tile is bigger than the older one. (GDAL #4771) */
|
|
413
|
+
if( tif->tif_rawdatasize <= (tmsize_t) td->td_stripbytecount[tile] )
|
|
414
|
+
{
|
|
415
|
+
if( !(TIFFWriteBufferSetup(tif, NULL,
|
|
416
|
+
(tmsize_t)TIFFroundup_64((uint64)(td->td_stripbytecount[tile] + 1), 1024))) )
|
|
417
|
+
return ((tmsize_t)(-1));
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/* Force TIFFAppendToStrip() to consider placing data at end
|
|
421
|
+
of file. */
|
|
422
|
+
tif->tif_curoff = 0;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
tif->tif_rawcc = 0;
|
|
426
|
+
tif->tif_rawcp = tif->tif_rawdata;
|
|
427
|
+
|
|
428
|
+
/*
|
|
429
|
+
* Compute tiles per row & per column to compute
|
|
430
|
+
* current row and column
|
|
431
|
+
*/
|
|
432
|
+
howmany32=TIFFhowmany_32(td->td_imagelength, td->td_tilelength);
|
|
433
|
+
if (howmany32 == 0) {
|
|
434
|
+
TIFFErrorExt(tif->tif_clientdata,module,"Zero tiles");
|
|
435
|
+
return ((tmsize_t)(-1));
|
|
436
|
+
}
|
|
437
|
+
tif->tif_row = (tile % howmany32) * td->td_tilelength;
|
|
438
|
+
howmany32=TIFFhowmany_32(td->td_imagewidth, td->td_tilewidth);
|
|
439
|
+
if (howmany32 == 0) {
|
|
440
|
+
TIFFErrorExt(tif->tif_clientdata,module,"Zero tiles");
|
|
441
|
+
return ((tmsize_t)(-1));
|
|
442
|
+
}
|
|
443
|
+
tif->tif_col = (tile % howmany32) * td->td_tilewidth;
|
|
444
|
+
|
|
445
|
+
if ((tif->tif_flags & TIFF_CODERSETUP) == 0) {
|
|
446
|
+
if (!(*tif->tif_setupencode)(tif))
|
|
447
|
+
return ((tmsize_t)(-1));
|
|
448
|
+
tif->tif_flags |= TIFF_CODERSETUP;
|
|
449
|
+
}
|
|
450
|
+
tif->tif_flags &= ~TIFF_POSTENCODE;
|
|
451
|
+
|
|
452
|
+
/*
|
|
453
|
+
* Clamp write amount to the tile size. This is mostly
|
|
454
|
+
* done so that callers can pass in some large number
|
|
455
|
+
* (e.g. -1) and have the tile size used instead.
|
|
456
|
+
*/
|
|
457
|
+
if ( cc < 1 || cc > tif->tif_tilesize)
|
|
458
|
+
cc = tif->tif_tilesize;
|
|
459
|
+
|
|
460
|
+
/* shortcut to avoid an extra memcpy() */
|
|
461
|
+
if( td->td_compression == COMPRESSION_NONE )
|
|
462
|
+
{
|
|
463
|
+
/* swab if needed - note that source buffer will be altered */
|
|
464
|
+
tif->tif_postdecode( tif, (uint8*) data, cc );
|
|
465
|
+
|
|
466
|
+
if (!isFillOrder(tif, td->td_fillorder) &&
|
|
467
|
+
(tif->tif_flags & TIFF_NOBITREV) == 0)
|
|
468
|
+
TIFFReverseBits((uint8*) data, cc);
|
|
469
|
+
|
|
470
|
+
if (cc > 0 &&
|
|
471
|
+
!TIFFAppendToStrip(tif, tile, (uint8*) data, cc))
|
|
472
|
+
return ((tmsize_t) -1);
|
|
473
|
+
return (cc);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
sample = (uint16)(tile/td->td_stripsperimage);
|
|
477
|
+
if (!(*tif->tif_preencode)(tif, sample))
|
|
478
|
+
return ((tmsize_t)(-1));
|
|
479
|
+
/* swab if needed - note that source buffer will be altered */
|
|
480
|
+
tif->tif_postdecode( tif, (uint8*) data, cc );
|
|
481
|
+
|
|
482
|
+
if (!(*tif->tif_encodetile)(tif, (uint8*) data, cc, sample))
|
|
483
|
+
return ((tmsize_t) -1);
|
|
484
|
+
if (!(*tif->tif_postencode)(tif))
|
|
485
|
+
return ((tmsize_t)(-1));
|
|
486
|
+
if (!isFillOrder(tif, td->td_fillorder) &&
|
|
487
|
+
(tif->tif_flags & TIFF_NOBITREV) == 0)
|
|
488
|
+
TIFFReverseBits((uint8*)tif->tif_rawdata, tif->tif_rawcc);
|
|
489
|
+
if (tif->tif_rawcc > 0 && !TIFFAppendToStrip(tif, tile,
|
|
490
|
+
tif->tif_rawdata, tif->tif_rawcc))
|
|
491
|
+
return ((tmsize_t)(-1));
|
|
492
|
+
tif->tif_rawcc = 0;
|
|
493
|
+
tif->tif_rawcp = tif->tif_rawdata;
|
|
494
|
+
return (cc);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/*
|
|
498
|
+
* Write the supplied data to the specified strip.
|
|
499
|
+
* There must be space for the data; we don't check
|
|
500
|
+
* if strips overlap!
|
|
501
|
+
*
|
|
502
|
+
* NB: Image length must be setup before writing; this
|
|
503
|
+
* interface does not support automatically growing
|
|
504
|
+
* the image on each write (as TIFFWriteScanline does).
|
|
505
|
+
*/
|
|
506
|
+
tmsize_t
|
|
507
|
+
TIFFWriteRawTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc)
|
|
508
|
+
{
|
|
509
|
+
static const char module[] = "TIFFWriteRawTile";
|
|
510
|
+
|
|
511
|
+
if (!WRITECHECKTILES(tif, module))
|
|
512
|
+
return ((tmsize_t)(-1));
|
|
513
|
+
if (tile >= tif->tif_dir.td_nstrips) {
|
|
514
|
+
TIFFErrorExt(tif->tif_clientdata, module, "Tile %lu out of range, max %lu",
|
|
515
|
+
(unsigned long) tile,
|
|
516
|
+
(unsigned long) tif->tif_dir.td_nstrips);
|
|
517
|
+
return ((tmsize_t)(-1));
|
|
518
|
+
}
|
|
519
|
+
return (TIFFAppendToStrip(tif, tile, (uint8*) data, cc) ?
|
|
520
|
+
cc : (tmsize_t)(-1));
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
#define isUnspecified(tif, f) \
|
|
524
|
+
(TIFFFieldSet(tif,f) && (tif)->tif_dir.td_imagelength == 0)
|
|
525
|
+
|
|
526
|
+
int
|
|
527
|
+
TIFFSetupStrips(TIFF* tif)
|
|
528
|
+
{
|
|
529
|
+
TIFFDirectory* td = &tif->tif_dir;
|
|
530
|
+
|
|
531
|
+
if (isTiled(tif))
|
|
532
|
+
td->td_stripsperimage =
|
|
533
|
+
isUnspecified(tif, FIELD_TILEDIMENSIONS) ?
|
|
534
|
+
td->td_samplesperpixel : TIFFNumberOfTiles(tif);
|
|
535
|
+
else
|
|
536
|
+
td->td_stripsperimage =
|
|
537
|
+
isUnspecified(tif, FIELD_ROWSPERSTRIP) ?
|
|
538
|
+
td->td_samplesperpixel : TIFFNumberOfStrips(tif);
|
|
539
|
+
td->td_nstrips = td->td_stripsperimage;
|
|
540
|
+
if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
|
|
541
|
+
td->td_stripsperimage /= td->td_samplesperpixel;
|
|
542
|
+
td->td_stripoffset = (uint64 *)
|
|
543
|
+
_TIFFmalloc(td->td_nstrips * sizeof (uint64));
|
|
544
|
+
td->td_stripbytecount = (uint64 *)
|
|
545
|
+
_TIFFmalloc(td->td_nstrips * sizeof (uint64));
|
|
546
|
+
if (td->td_stripoffset == NULL || td->td_stripbytecount == NULL)
|
|
547
|
+
return (0);
|
|
548
|
+
/*
|
|
549
|
+
* Place data at the end-of-file
|
|
550
|
+
* (by setting offsets to zero).
|
|
551
|
+
*/
|
|
552
|
+
_TIFFmemset(td->td_stripoffset, 0, td->td_nstrips*sizeof (uint64));
|
|
553
|
+
_TIFFmemset(td->td_stripbytecount, 0, td->td_nstrips*sizeof (uint64));
|
|
554
|
+
TIFFSetFieldBit(tif, FIELD_STRIPOFFSETS);
|
|
555
|
+
TIFFSetFieldBit(tif, FIELD_STRIPBYTECOUNTS);
|
|
556
|
+
return (1);
|
|
557
|
+
}
|
|
558
|
+
#undef isUnspecified
|
|
559
|
+
|
|
560
|
+
/*
|
|
561
|
+
* Verify file is writable and that the directory
|
|
562
|
+
* information is setup properly. In doing the latter
|
|
563
|
+
* we also "freeze" the state of the directory so
|
|
564
|
+
* that important information is not changed.
|
|
565
|
+
*/
|
|
566
|
+
int
|
|
567
|
+
TIFFWriteCheck(TIFF* tif, int tiles, const char* module)
|
|
568
|
+
{
|
|
569
|
+
if (tif->tif_mode == O_RDONLY) {
|
|
570
|
+
TIFFErrorExt(tif->tif_clientdata, module, "File not open for writing");
|
|
571
|
+
return (0);
|
|
572
|
+
}
|
|
573
|
+
if (tiles ^ isTiled(tif)) {
|
|
574
|
+
TIFFErrorExt(tif->tif_clientdata, module, tiles ?
|
|
575
|
+
"Can not write tiles to a stripped image" :
|
|
576
|
+
"Can not write scanlines to a tiled image");
|
|
577
|
+
return (0);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
_TIFFFillStriles( tif );
|
|
581
|
+
|
|
582
|
+
/*
|
|
583
|
+
* On the first write verify all the required information
|
|
584
|
+
* has been setup and initialize any data structures that
|
|
585
|
+
* had to wait until directory information was set.
|
|
586
|
+
* Note that a lot of our work is assumed to remain valid
|
|
587
|
+
* because we disallow any of the important parameters
|
|
588
|
+
* from changing after we start writing (i.e. once
|
|
589
|
+
* TIFF_BEENWRITING is set, TIFFSetField will only allow
|
|
590
|
+
* the image's length to be changed).
|
|
591
|
+
*/
|
|
592
|
+
if (!TIFFFieldSet(tif, FIELD_IMAGEDIMENSIONS)) {
|
|
593
|
+
TIFFErrorExt(tif->tif_clientdata, module,
|
|
594
|
+
"Must set \"ImageWidth\" before writing data");
|
|
595
|
+
return (0);
|
|
596
|
+
}
|
|
597
|
+
if (tif->tif_dir.td_samplesperpixel == 1) {
|
|
598
|
+
/*
|
|
599
|
+
* Planarconfiguration is irrelevant in case of single band
|
|
600
|
+
* images and need not be included. We will set it anyway,
|
|
601
|
+
* because this field is used in other parts of library even
|
|
602
|
+
* in the single band case.
|
|
603
|
+
*/
|
|
604
|
+
if (!TIFFFieldSet(tif, FIELD_PLANARCONFIG))
|
|
605
|
+
tif->tif_dir.td_planarconfig = PLANARCONFIG_CONTIG;
|
|
606
|
+
} else {
|
|
607
|
+
if (!TIFFFieldSet(tif, FIELD_PLANARCONFIG)) {
|
|
608
|
+
TIFFErrorExt(tif->tif_clientdata, module,
|
|
609
|
+
"Must set \"PlanarConfiguration\" before writing data");
|
|
610
|
+
return (0);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
if (tif->tif_dir.td_stripoffset == NULL && !TIFFSetupStrips(tif)) {
|
|
614
|
+
tif->tif_dir.td_nstrips = 0;
|
|
615
|
+
TIFFErrorExt(tif->tif_clientdata, module, "No space for %s arrays",
|
|
616
|
+
isTiled(tif) ? "tile" : "strip");
|
|
617
|
+
return (0);
|
|
618
|
+
}
|
|
619
|
+
if (isTiled(tif))
|
|
620
|
+
{
|
|
621
|
+
tif->tif_tilesize = TIFFTileSize(tif);
|
|
622
|
+
if (tif->tif_tilesize == 0)
|
|
623
|
+
return (0);
|
|
624
|
+
}
|
|
625
|
+
else
|
|
626
|
+
tif->tif_tilesize = (tmsize_t)(-1);
|
|
627
|
+
tif->tif_scanlinesize = TIFFScanlineSize(tif);
|
|
628
|
+
if (tif->tif_scanlinesize == 0)
|
|
629
|
+
return (0);
|
|
630
|
+
tif->tif_flags |= TIFF_BEENWRITING;
|
|
631
|
+
return (1);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/*
|
|
635
|
+
* Setup the raw data buffer used for encoding.
|
|
636
|
+
*/
|
|
637
|
+
int
|
|
638
|
+
TIFFWriteBufferSetup(TIFF* tif, void* bp, tmsize_t size)
|
|
639
|
+
{
|
|
640
|
+
static const char module[] = "TIFFWriteBufferSetup";
|
|
641
|
+
|
|
642
|
+
if (tif->tif_rawdata) {
|
|
643
|
+
if (tif->tif_flags & TIFF_MYBUFFER) {
|
|
644
|
+
_TIFFfree(tif->tif_rawdata);
|
|
645
|
+
tif->tif_flags &= ~TIFF_MYBUFFER;
|
|
646
|
+
}
|
|
647
|
+
tif->tif_rawdata = NULL;
|
|
648
|
+
}
|
|
649
|
+
if (size == (tmsize_t)(-1)) {
|
|
650
|
+
size = (isTiled(tif) ?
|
|
651
|
+
tif->tif_tilesize : TIFFStripSize(tif));
|
|
652
|
+
/*
|
|
653
|
+
* Make raw data buffer at least 8K
|
|
654
|
+
*/
|
|
655
|
+
if (size < 8*1024)
|
|
656
|
+
size = 8*1024;
|
|
657
|
+
bp = NULL; /* NB: force malloc */
|
|
658
|
+
}
|
|
659
|
+
if (bp == NULL) {
|
|
660
|
+
bp = _TIFFmalloc(size);
|
|
661
|
+
if (bp == NULL) {
|
|
662
|
+
TIFFErrorExt(tif->tif_clientdata, module, "No space for output buffer");
|
|
663
|
+
return (0);
|
|
664
|
+
}
|
|
665
|
+
tif->tif_flags |= TIFF_MYBUFFER;
|
|
666
|
+
} else
|
|
667
|
+
tif->tif_flags &= ~TIFF_MYBUFFER;
|
|
668
|
+
tif->tif_rawdata = (uint8*) bp;
|
|
669
|
+
tif->tif_rawdatasize = size;
|
|
670
|
+
tif->tif_rawcc = 0;
|
|
671
|
+
tif->tif_rawcp = tif->tif_rawdata;
|
|
672
|
+
tif->tif_flags |= TIFF_BUFFERSETUP;
|
|
673
|
+
return (1);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/*
|
|
677
|
+
* Grow the strip data structures by delta strips.
|
|
678
|
+
*/
|
|
679
|
+
static int
|
|
680
|
+
TIFFGrowStrips(TIFF* tif, uint32 delta, const char* module)
|
|
681
|
+
{
|
|
682
|
+
TIFFDirectory *td = &tif->tif_dir;
|
|
683
|
+
uint64* new_stripoffset;
|
|
684
|
+
uint64* new_stripbytecount;
|
|
685
|
+
|
|
686
|
+
assert(td->td_planarconfig == PLANARCONFIG_CONTIG);
|
|
687
|
+
new_stripoffset = (uint64*)_TIFFrealloc(td->td_stripoffset,
|
|
688
|
+
(td->td_nstrips + delta) * sizeof (uint64));
|
|
689
|
+
new_stripbytecount = (uint64*)_TIFFrealloc(td->td_stripbytecount,
|
|
690
|
+
(td->td_nstrips + delta) * sizeof (uint64));
|
|
691
|
+
if (new_stripoffset == NULL || new_stripbytecount == NULL) {
|
|
692
|
+
if (new_stripoffset)
|
|
693
|
+
_TIFFfree(new_stripoffset);
|
|
694
|
+
if (new_stripbytecount)
|
|
695
|
+
_TIFFfree(new_stripbytecount);
|
|
696
|
+
td->td_nstrips = 0;
|
|
697
|
+
TIFFErrorExt(tif->tif_clientdata, module, "No space to expand strip arrays");
|
|
698
|
+
return (0);
|
|
699
|
+
}
|
|
700
|
+
td->td_stripoffset = new_stripoffset;
|
|
701
|
+
td->td_stripbytecount = new_stripbytecount;
|
|
702
|
+
_TIFFmemset(td->td_stripoffset + td->td_nstrips,
|
|
703
|
+
0, delta*sizeof (uint64));
|
|
704
|
+
_TIFFmemset(td->td_stripbytecount + td->td_nstrips,
|
|
705
|
+
0, delta*sizeof (uint64));
|
|
706
|
+
td->td_nstrips += delta;
|
|
707
|
+
tif->tif_flags |= TIFF_DIRTYDIRECT;
|
|
708
|
+
|
|
709
|
+
return (1);
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
/*
|
|
713
|
+
* Append the data to the specified strip.
|
|
714
|
+
*/
|
|
715
|
+
static int
|
|
716
|
+
TIFFAppendToStrip(TIFF* tif, uint32 strip, uint8* data, tmsize_t cc)
|
|
717
|
+
{
|
|
718
|
+
static const char module[] = "TIFFAppendToStrip";
|
|
719
|
+
TIFFDirectory *td = &tif->tif_dir;
|
|
720
|
+
uint64 m;
|
|
721
|
+
int64 old_byte_count = -1;
|
|
722
|
+
|
|
723
|
+
if (td->td_stripoffset[strip] == 0 || tif->tif_curoff == 0) {
|
|
724
|
+
assert(td->td_nstrips > 0);
|
|
725
|
+
|
|
726
|
+
if( td->td_stripbytecount[strip] != 0
|
|
727
|
+
&& td->td_stripoffset[strip] != 0
|
|
728
|
+
&& td->td_stripbytecount[strip] >= (uint64) cc )
|
|
729
|
+
{
|
|
730
|
+
/*
|
|
731
|
+
* There is already tile data on disk, and the new tile
|
|
732
|
+
* data we have will fit in the same space. The only
|
|
733
|
+
* aspect of this that is risky is that there could be
|
|
734
|
+
* more data to append to this strip before we are done
|
|
735
|
+
* depending on how we are getting called.
|
|
736
|
+
*/
|
|
737
|
+
if (!SeekOK(tif, td->td_stripoffset[strip])) {
|
|
738
|
+
TIFFErrorExt(tif->tif_clientdata, module,
|
|
739
|
+
"Seek error at scanline %lu",
|
|
740
|
+
(unsigned long)tif->tif_row);
|
|
741
|
+
return (0);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
else
|
|
745
|
+
{
|
|
746
|
+
/*
|
|
747
|
+
* Seek to end of file, and set that as our location to
|
|
748
|
+
* write this strip.
|
|
749
|
+
*/
|
|
750
|
+
td->td_stripoffset[strip] = TIFFSeekFile(tif, 0, SEEK_END);
|
|
751
|
+
tif->tif_flags |= TIFF_DIRTYSTRIP;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
tif->tif_curoff = td->td_stripoffset[strip];
|
|
755
|
+
|
|
756
|
+
/*
|
|
757
|
+
* We are starting a fresh strip/tile, so set the size to zero.
|
|
758
|
+
*/
|
|
759
|
+
old_byte_count = td->td_stripbytecount[strip];
|
|
760
|
+
td->td_stripbytecount[strip] = 0;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
m = tif->tif_curoff+cc;
|
|
764
|
+
if (!(tif->tif_flags&TIFF_BIGTIFF))
|
|
765
|
+
m = (uint32)m;
|
|
766
|
+
if ((m<tif->tif_curoff)||(m<(uint64)cc))
|
|
767
|
+
{
|
|
768
|
+
TIFFErrorExt(tif->tif_clientdata, module, "Maximum TIFF file size exceeded");
|
|
769
|
+
return (0);
|
|
770
|
+
}
|
|
771
|
+
if (!WriteOK(tif, data, cc)) {
|
|
772
|
+
TIFFErrorExt(tif->tif_clientdata, module, "Write error at scanline %lu",
|
|
773
|
+
(unsigned long) tif->tif_row);
|
|
774
|
+
return (0);
|
|
775
|
+
}
|
|
776
|
+
tif->tif_curoff = m;
|
|
777
|
+
td->td_stripbytecount[strip] += cc;
|
|
778
|
+
|
|
779
|
+
if( (int64) td->td_stripbytecount[strip] != old_byte_count )
|
|
780
|
+
tif->tif_flags |= TIFF_DIRTYSTRIP;
|
|
781
|
+
|
|
782
|
+
return (1);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
/*
|
|
786
|
+
* Internal version of TIFFFlushData that can be
|
|
787
|
+
* called by ``encodestrip routines'' w/o concern
|
|
788
|
+
* for infinite recursion.
|
|
789
|
+
*/
|
|
790
|
+
int
|
|
791
|
+
TIFFFlushData1(TIFF* tif)
|
|
792
|
+
{
|
|
793
|
+
if (tif->tif_rawcc > 0 && tif->tif_flags & TIFF_BUF4WRITE ) {
|
|
794
|
+
if (!isFillOrder(tif, tif->tif_dir.td_fillorder) &&
|
|
795
|
+
(tif->tif_flags & TIFF_NOBITREV) == 0)
|
|
796
|
+
TIFFReverseBits((uint8*)tif->tif_rawdata,
|
|
797
|
+
tif->tif_rawcc);
|
|
798
|
+
if (!TIFFAppendToStrip(tif,
|
|
799
|
+
isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip,
|
|
800
|
+
tif->tif_rawdata, tif->tif_rawcc))
|
|
801
|
+
{
|
|
802
|
+
/* We update those variables even in case of error since there's */
|
|
803
|
+
/* code that doesn't really check the return code of this */
|
|
804
|
+
/* function */
|
|
805
|
+
tif->tif_rawcc = 0;
|
|
806
|
+
tif->tif_rawcp = tif->tif_rawdata;
|
|
807
|
+
return (0);
|
|
808
|
+
}
|
|
809
|
+
tif->tif_rawcc = 0;
|
|
810
|
+
tif->tif_rawcp = tif->tif_rawdata;
|
|
811
|
+
}
|
|
812
|
+
return (1);
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
/*
|
|
816
|
+
* Set the current write offset. This should only be
|
|
817
|
+
* used to set the offset to a known previous location
|
|
818
|
+
* (very carefully), or to 0 so that the next write gets
|
|
819
|
+
* appended to the end of the file.
|
|
820
|
+
*/
|
|
821
|
+
void
|
|
822
|
+
TIFFSetWriteOffset(TIFF* tif, toff_t off)
|
|
823
|
+
{
|
|
824
|
+
tif->tif_curoff = off;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
/* vim: set ts=8 sts=8 sw=8 noet: */
|
|
828
|
+
/*
|
|
829
|
+
* Local Variables:
|
|
830
|
+
* mode: c
|
|
831
|
+
* c-basic-offset: 8
|
|
832
|
+
* fill-column: 78
|
|
833
|
+
* End:
|
|
834
|
+
*/
|