473,326 Members | 2,081 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,326 software developers and data experts.

Reading jpg EXIF info

I am working on a program the reads the user comment field of a jpg file.
When I read it in using GetPropertyItem to get the property and saving it to
a variable with item=Encoding.UTF8.GetString(PropItem.Value).Trim( ) I get a
string that looks like \0\0\0\0\0\0my text here.

Is there a way for me to strip all of the \0s from the string?

Thanks,

Tim

Oct 24 '07 #1
2 2532
On Oct 24, 1:58 pm, "Tim Kelley" <tkel...@company.comwrote:
I am working on a program the reads the user comment field of a jpg file.
When I read it in using GetPropertyItem to get the property and saving it to
a variable with item=Encoding.UTF8.GetString(PropItem.Value).Trim( ) I get a
string that looks like \0\0\0\0\0\0my text here.

Is there a way for me to strip all of the \0s from the string?

Thanks,

Tim
How about:

item = item.Replace("\0", "");

Oct 24 '07 #2
On Wed, 24 Oct 2007 12:58:32 -0500, "Tim Kelley" <tk*****@company.com>
wrote:
>I am working on a program the reads the user comment field of a jpg file.
When I read it in using GetPropertyItem to get the property and saving it to
a variable with item=Encoding.UTF8.GetString(PropItem.Value).Trim( ) I get a
string that looks like \0\0\0\0\0\0my text here.

Is there a way for me to strip all of the \0s from the string?

Thanks,

Tim

You could use an old fashioned string.Replace to get rid of the "\0"s

--
http://bytes.thinkersroom.com
Oct 24 '07 #3

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

Similar topics

1
by: K | last post by:
I am absolutly exausted to figure this one out. I require the exif module to work under 5.0.1 but apache (2.0.48) just dies with a 1067 failure, I can't find any usable log info apart from the...
5
by: Shawn Wilson | last post by:
I am an ameture digital photographer (along with a newbie developer) and I've an album of my pictures online. I've been building this album to be just how I want it and I've come to one last...
2
by: Vladish | last post by:
Hi all, I wonder, if anybody here has any source code or component, which can read EXIF informations from JPEG pictures. Or some good, easy to understood, description of JPEG files. I didn't...
5
by: TheGanjaMan | last post by:
Hi everyone, I'm trying to write up a simple image stamper application that stamps the Exif date information from the jpegs that I've taken from my digital camera and saves the new file with the...
4
by: Bror Johansson | last post by:
Is there somewhere some Python-module that can be used for adding EXIF-info to JPEG files? (Modules for extraction of EXIF-data are easily found, but lacks - as I see it - capacity to add new...
1
by: Alfonso Acosta | last post by:
Hi all, exif_read_data() doesn't support URLs (http://php.net/manual/en/function.exif-read-data.php ) but I would like to do that with the minimum traffic and overhead possible. A naive...
14
by: Frank | last post by:
I see that ImageFormat includes exif. But I can't find out if I've System.Drawing.Image.FromStream or something like it can read and/or write that format.
2
by: iKER- | last post by:
Hi! I´m working in a program witch need to read Exif data from my Sony Alpha A100 raw (arw extension) pictures. I found a table with keys for read it, but i can´t read. I tried something, but i...
8
by: infoseekar | last post by:
Does anyone know what's the right code to read IPTC metadata. I have the code to read EXIF metadata and it gives me alot of information which I don't need. How do I modify this code so it only...
6
by: Victory | last post by:
Hi, I need to know the compression type of jpeg (jpg) files. I am using the System.Drawing.Imaging and loading the file using an Image object. The next thing i do, is to examine the propertyItems...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.