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

How to extract image from Tiff file and redirect it on any other file?

Hi,

I am facing one problem related to reading of TIFF Image data. I need its image part and put it in any other file. I have used ofstream for new file opening and data redirection.

ofstream filestr;
filestr.open("tempfile", ios::out);

filestr << ImagePart;

filestr.close();

Later this ImagePart is getting converted into raw XL data.

When i execute my program then it gives corrupted data in new file. I would be highly grateful to you if anybody can tell me root cause problem.

1) Should i open file in binary mode?
2) filestream may cause any problem?
3) I suspect that i can not use IO stream because no char * data.

Thanks
Saurabh
May 1 '07 #1
3 3470
gpraghuram
1,275 Expert 1GB
HI,
1) Should i open file in binary mode?
Yes you have to open the file in binary mode
2) filestream may cause any problem?
No
3) I suspect that i can not use IO stream because no char * data.
Yes ur guess is right

Thanks
Raghuram
May 1 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
3) I suspect that i can not use IO stream because no char * data.
Yes ur guess is right
IO stream is not the issue. It's the << operator. Don't use it on a binary file. Use filestr.write() instead.

<< is a function call to an operator<<(ostream&, char*). That function assumes you have char data.
May 1 '07 #3
Hello All,

Thanks for your kind support and Help. My code is working fine now.

Saurabh
May 2 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

17
by: PyPK | last post by:
Hi I am looking for a simple tiff Image reader/writer in python.Can anyone point me to the right one.
2
by: Becker | last post by:
I have a two page TIFF document. I simply want to create an array of image and put the two pages of this multipage tiff in this array for some further processing on seperate "images." The...
3
by: CD | last post by:
An application is logging faxes sent in SQL2000 image column type. I have found code on the net but what it is doing is prompting to save to local which is fine for single page image. Not good...
3
by: Andres Corrada-Emmanuel | last post by:
Hello, I have installed PIL 1.1.5 on Windows with Python 2.4. I'm unable to open .tiff images that I can open and view using Windows Explorer. In other words, this simple test fails: import...
1
by: Stedak | last post by:
I have the following class I use to save Tiff's. The problem I have with it is that the final size of the images are very large. If we scan directly to a file the final tiff may be 600-900 kb.s but...
7
by: Ben | last post by:
Hi We are looking for a component that offers that offers the below for Tiff files: Image clean-up (deskew, despeckle) Printing capabilities from VB The ability to add text to image, e.g....
10
by: =?Utf-8?B?UmludSBHb3BhbGFrcmlzaG5hIFBpbGxhaQ==?= | last post by:
Hi, Please help me to write a dll in C# , that will read each pages of a tiff image from a file and a memory stream object ( need two ways) and creatre a new tiff image object.The dll should...
14
by: Steve K. | last post by:
I have a method that I use to get a System.Drawing.Image from a file without keeping a handle on the file open (so I can delete the file). Here is the code: <code> public static Image...
5
by: Steve | last post by:
Hi all Does anybody please know a way to extract an Image from a pdf file and save it as a TIFF? I have used a scanner to scan documents which are then placed on a server, but I need to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.