Comments (4)
According to the documentation, WriteEncodedStrip returns
The number of encoded and written bytes or -1 if an error occurred.
So, if the function returns 0, you can be sure it didn't write any data. In my opinion, this covers the use case you described.
from libtiff.net.
from libtiff.net.
In your first message you were talking about Tiff class from the library. Now you are talking about Copier class from TiffCp utility.
If you think there is an issue in code, then please try to be more specific about where it resides. And please feel free to send us pull requests with fixes.
from libtiff.net.
Apologies, hopefully this clarification will make more sense.
I can reproduce this issue using tiffcp.exe. I have a sample TIFF with 11 pages (unfortunately I cannot share it as it contains client data). Page 3 is JPEG encoded and the other pages use Group4. When TiffCp tries to copy page 3 it reports an error "JPEGLib: Not implemented yet". This then writes out a page with an incomplete directory entry and no image data. My point is, if the code reaches an error like this then I think it should abort the copy rather than write a malformed directory entry to the output tiff.
I debugged the issue and traced through the source code and found it was happening because when the error occurred in WriteEncodedStrip in Tiff.cs (line 5303) instead of returning -1 which would indicate an error it's returning 0 so the calling function thinks nothing has been read and carries on.
As I said I cannot attach the original Tiff but I've attached a zip file containing a dump of the tags from the source Tiff (sample.txt - it's a quite old one created by Imaging for Windows) and also the corrupt Tiff created by TiffCp (sample.tif). As you can see it's creating a header with no StripOffsets or RowsPerStrip.
I hope this makes more sense, thanks for your time and your patience.
Cheers
sample.zip
from libtiff.net.
Related Issues (20)
- "the parameter is incorrect" windows api error HOT 3
- Update the license file, so it integrates with GitHub nicely HOT 2
- EXIF_EXPOSURETIME not working
- Unable to read CMYK 96-bit image
- ComputeTile returns invalid number of tile HOT 1
- Get an error writing Linear DNG (need help) HOT 1
- In there an option to work without impacting on CMYK colors
- Adobe deflate HOT 9
- Having problems injecting TimeStamp into TiffTag.IMAGEDESCRIPTION HOT 1
- GeoTiff Support ? HOT 1
- Does not build on Mac HOT 3
- Hardcoded encoding HOT 3
- how to use libtiff.net to generate a tiff or svs support by openslide HOT 3
- Possible to write to a stream? HOT 1
- Skewed Landscape Images HOT 2
- How to use ReadRGBAImageOriented with Exif Orientation? HOT 1
- Will LibTiff support 32 bit samples RGBA Image? HOT 1
- Create a Svs file (Aperio format) by libtiff.net
- how to write label or marco to tif by libtiff.net
- writeTile
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libtiff.net.