473,396 Members | 1,918 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,396 software developers and data experts.

Tiff to JPEG

Hi All,

I'm using the System.Drawing.Image name space to convert images from
one type to another. In this case I am trying to convert a Tiff to a
JPEG. The code is as simple as the next two lines...

System.Drawing.Image image = Image.FromFile( this.importFilePath );
image.Save( exportFilePath, System.Drawing.Imaging.ImageFormat.Jpeg );

The code almost always seems to work, but some times I receive the
following error...

System.ArgumentException: Invalid parameter used.
at System.Drawing.Image.Save(String filename, ImageCodecInfo
encoder, EncoderParameters encoderParams)
at System.Drawing.Image.Save(String filename, ImageFormat format)

I am 100% sure that the file paths are correct. Has anyone dealt with
this error before?

Any suggestions would be great.

Thanks in advance

Nov 16 '05 #1
2 7729
Just a little extra info...

The Tiff is comming from Quark. That's probably the issue. I opened the
file in paint, saved it, and then was able to convert it. Has anyone
had problems converting Quark tiff's to Jpeg's using GDI+? If so, do
you have any better solutions than opening the file in paint and then
saving it again?

Nov 16 '05 #2
Tiff is such a wide spec that many decoders cannot handle all the options.
Do all of your images come from Quark or just this one that's having
problems?

Can you post a small example of a tiff produced by quark? no more than
128*128 if you can.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"ZUP_DUDE" <jp*******@nycap.rr.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Just a little extra info...

The Tiff is comming from Quark. That's probably the issue. I opened the
file in paint, saved it, and then was able to convert it. Has anyone
had problems converting Quark tiff's to Jpeg's using GDI+? If so, do
you have any better solutions than opening the file in paint and then
saving it again?

Nov 16 '05 #3

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

Similar topics

0
by: Nicolas Guilhot | last post by:
Hi all ! I have a multi-page Tiff image file that I want to convert to PDF. To do so I am using iText library. The conversion is working, but the code execution is very different according to...
7
by: Albert Greinöcker | last post by:
hi ng, I have a question concerning image processing in .NET: How can I open a jpeg with a tiff-header in c# (which means the file has the extension .tif, but contains jpeg-compressed data)?...
6
by: usao | last post by:
Does anyone know where I can find C subroutines to read JPEG and/or TIFF files into 2-dimensional C arrays?
3
by: 246C57AE-40DD-4d6b-9E8D-B0F5757BB2A8 | last post by:
Hi. Why can't I read TIFFs compressed by JPEG using GDI+ Image class? I always get out of memory exception. Thanx.
4
by: Pushp | last post by:
Hello friends, Can any body tell me the sample code to convert a Tiff image to a Gif or Jpeg format. The Resolution of picture is a big concern keeping in mind. Hope to get the response...
3
by: T. Davis | last post by:
In C#, I am able to successfully stream a TIFF image that comes from a BLOB field in a database, save it to file, then convert the pages within TIFF file into jpegs (using GDI+) and display on the...
10
by: rtilley | last post by:
Hope it's not inappropriate to post this here. Could someone critique my code? I have no Python programmers in my office to show this to. The script works OK, but should I do it differently? I...
2
by: mndprasad | last post by:
hi all i am doing a project in java where i need to convert 10 jpeg images into a single tiff image..conversion of single jpeg image to single tiff is happening but embedding all the 10 jpeg images...
3
by: GiJeet | last post by:
Hello, we have an app that scans documents into TIFF format and we need to transfer them over the internet. If anyone knows of a SDK we can use that can compress TIFFs on the fly or even if it can...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.