473,394 Members | 1,645 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Breaking multi-page tiffs

Hello all, I have searched all over the net, and tried many different things;
but now I am stumped. I am trying to break multipage tiffs into individual
frames and reformatting them to a different compression style.

The application works great on normal tif files, the problem occurs on some
unusual tif images. For instance: the link provided is an 8 page tif file.
The first 5 pages convert just fine, but pages 6 though 8 throw a Generic
GDI+ exception on the SelectActiveFrame method of the image object. Part of
the problem could be that pages 1-5 are 1bit and pages 6-8 are 8 bit.

I threw together some simple code to demonstrate the issue. I would
appreciate any help. If I can get out the individual pages, I can build the
encoders and handle the process of building a new multipage, this code was
simplified to make it easier to get some help.

Thanks, Dan
//using System.Drawing;
//using System.Drawing.Imaging;
//code start
Image inImg;
inImg = Image.FromFile(@"C:\dlbtemp\F32044996.tif");
for (int i = 0; i < inImg.GetFrameCount(FrameDimension.Page); i++)
{
inImg.SelectActiveFrame(FrameDimension.Page, i);
inImg.Save(@"C:\dlbtemp\F32044996_" + i.ToString() + ".tif",
ImageFormat.Tiff);
}
//code end
//example image: http://www.dbpic.com/pub/F32044996.tif
Oct 9 '08 #1
1 1468
On Thu, 09 Oct 2008 09:07:03 -0700, Dano <po******@newsgroup.nospamwrote:
[...]
The application works great on normal tif files, the problem occurs on
some
unusual tif images. For instance: the link provided is an 8 page tif
file.
The first 5 pages convert just fine, but pages 6 though 8 throw a Generic
GDI+ exception on the SelectActiveFrame method of the image object. Part
of
the problem could be that pages 1-5 are 1bit and pages 6-8 are 8 bit.
Probably is.

What the precise problem might be, I can't say. It could be that .NET
doesn't support mixed-format TIFFs. Or it could just be that particular
8-bit format it doesn't support. Either way, the bottom line is that .NET
has limited support for certain image formats. If it doesn't work and
you're sure the image file itself is valid, then you're pretty much just
stuck. If you can control the input to ensure a file that .NET does
support, then it might be worth figuring out what exactly is bothering
..NET. Otherwise, you probably will have to implement that functionality
yourself. :(

Pete
Oct 9 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: MarionEll | last post by:
--------------------------------------------------------- ************* Call for Participation ************** ************ Late Breaking News ************* *********** Extreme...
1
by: Doug | last post by:
I'm using XSLT to convert an XML document into a text file for processing on our mainframe. I've got everything working fine except for one issue. One of the elements returned can contain a...
0
by: Amy | last post by:
I am looking for an rss feed that contains really important breaking news like "A large Tsunami just hit Asia" or "Terrorists attack the World Trade Center", but is empty if there really isn't...
27
by: The Bicycling Guitarist | last post by:
Hi. I found the following when trying to learn if there is such a thing as a non-breaking hyphen. Apparently Unicode has a ‑ but that is not well-supported, especially in older browsers. Somebody...
22
by: stevenkobes | last post by:
If a word has a hyphen in it, IE will permit a line break at the hyphen, but Firefox/Mozilla won't. Apparently the Firefox behavior is standards-compliant, but it is not what I want. Is there a...
5
by: bobwansink | last post by:
Hi, I'm relatively new to programming and I would like to create a C++ multi user program. It's for a project for school. This means I will have to write a paper about the theory too. Does anyone...
150
by: tony | last post by:
If you have any PHP scripts which will not work in the current releases due to breaks in backwards compatibility then take a look at http://www.tonymarston.net/php-mysql/bc-is-everything.html and...
49
by: elmar | last post by:
Hi Clers, If I look at my ~200000 lines of C code programmed over the past 15 years, there is one annoying thing in this smart language, which somehow reduces the 'beauty' of the source code...
7
by: noridotjabi | last post by:
I'm working on a prompt style thing and I need a way to pass arguments to commands within my program. For example: ::hello -v -r -n If this is entered as one input string, can I (in any...
4
by: Rubin | last post by:
1) I want to show a breaking hyphen in Mozilla 1.5.0.4 How do I do that? "Unicode standard annex #14", <http://www.unicode.org/reports/tr14/>, defines 4 breaking hyphens. <quote> Breaking...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.