473,770 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 SelectActiveFra me 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\F3 2044996.tif");
for (int i = 0; i < inImg.GetFrameC ount(FrameDimen sion.Page); i++)
{
inImg.SelectAct iveFrame(FrameD imension.Page, i);
inImg.Save(@"C: \dlbtemp\F32044 996_" + i.ToString() + ".tif",
ImageFormat.Tif f);
}
//code end
//example image: http://www.dbpic.com/pub/F32044996.tif
Oct 9 '08 #1
1 1477
On Thu, 09 Oct 2008 09:07:03 -0700, Dano <po******@newsg roup.nospamwrot e:
[...]
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 SelectActiveFra me 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
2271
by: MarionEll | last post by:
--------------------------------------------------------- ************* Call for Participation ************** ************ Late Breaking News ************* *********** Extreme Markup Languages 2003 ************ --------------------------------------------------------- The regular (peer reviewed) part of the Extreme 2003 program has been scheduled. As usual, we have reserved a few slots on the Extreme program for...
1
1637
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 large amount of data (2K+) in size. Here's an example: <jurisdictionssearched display="yes">Alaska Courts,Arizona Corrections,Arizona Courts,Arkansas Courts,California Court Index,Connecticut Corrections,Connecticut Courts,Connecticut Traffic
0
1164
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 anything that important going on. All the rss feeds I've looked at contain quite a few entries as breaking news or top headlines, none of which seem really that urgent. Does anyone know of a good feed, or can point me to a more appropriate place...
27
31424
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 somewhere said: Alternately, you can use CSS to declare a class having: ..nowrap { white-space:nowrap } .... and then wrap the compound word in a <span class=nowrap></span> tag (or any other suitable inline tag). You can also try {...
22
8015
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 way to denote a hyphen in HTML, that the line can be broken after? I've read some stuff about soft hyphens and non-breaking hyphens, but those seem like the opposite of what I'm looking for. I want a normal hyphen, that always appears, and I...
5
5767
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 know a good place to start looking for some theory on the subject of multi user applications? I know only bits and pieces, like about transactions, but a compendium of possible approches to multi user programming would be very appreciated!
150
6582
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 see if you agree with my opinion or not. Tony Marston http://www.tonymarston.net
49
2809
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 ;-): char *cp; void *vp; void **vpp;
7
3274
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 simple way) break it apart so I have something like: str = "hello" str = "-v"
4
4558
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 hyphens establish explicit break opportunities immediately after each occurrence.
0
9617
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10099
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10036
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9904
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7451
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.