473,507 Members | 3,112 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

EXIF GetString and foreign characters

I'm trying to read the exif info in a JPG image file. Reading the
ImageDescription field (270) that contains "abcæåø" only reads the
first 3 characters "abc". The field was written with ACDSee photo
manager.

// using the GetString method

propItem = img.GetPropertyItem(270);
img_desc = Encoding.UTF8.GetString(propItem.Value);

// result : img_desc = "abc"

// BitConverter reads the correct acsii values!!

acsii_values = BitConverter.ToString(propItem.Value);

// result : acsii_values = "61-62-63-E6-E5-F8-00"

Why does GetString not get the foreign charaters "E6-E5-F8"?

Apr 6 '07 #1
1 1349
On 6 Apr., 14:19, mikfr...@gmail.com wrote:
I'm trying to read the exif info in a JPG image file. Reading the
ImageDescription field (270) that contains "abcæåø" only reads the
first 3 characters "abc". The field was written with ACDSee photo
manager.

// using the GetString method

propItem = img.GetPropertyItem(270);
img_desc = Encoding.UTF8.GetString(propItem.Value);

// result : img_desc = "abc"

// BitConverter reads the correct acsii values!!

acsii_values = BitConverter.ToString(propItem.Value);

// result : acsii_values = "61-62-63-E6-E5-F8-00"

Why does GetString not get the foreign charaters "E6-E5-F8"?
The field was written in iso8859-1. This fixed the problem:

Encoding iso = Encoding.GetEncoding("iso8859-1");
img_desc = iso.GetString(propItem.Value);

I guess there is no method to detect which encoding is used in the
EXIF field.

Apr 7 '07 #2

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

Similar topics

4
9395
by: Jan Schmidt | last post by:
Hi NG, i created my own Picture Gallery, which reads the EXIF Data of each Picture before displaying on website. I'd like to give my users the ability to alter some opened EXIF Values. It would...
0
1884
by: leo | last post by:
hi there i'm using gene cash's EXIF.py module to find out the shoting time of an jpeg image. this module works usually like a beauty, but some images raise an exception: Traceback (most...
0
1445
by: Joaquin Corchero | last post by:
Hi, I have this code which it should change the EXIF file properties of images, but there is something that doesn't work, any ideas??? Private Sub ShowBitMapProp(ByVal sFile As String) Dim...
4
1803
by: FayeC | last post by:
I have tried to use a php code (found it online) to create a gallery but I am wondering if thereare any other PHP options besides using EXIF. The reason is that the images I am using for the...
5
4714
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...
1
4935
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
5193
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.
3
2085
by: =?Utf-8?B?R2VyaGFyZA==?= | last post by:
I get an error on a .net 2.0 page when I use foreign characters, such as ç or ã. Setting validateRequest=false handles this, but is there a way to keep validateRequest=true but allow foreign...
3
8874
by: sam | last post by:
same as subject?
0
7221
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
7313
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
7372
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...
1
7029
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
5619
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,...
1
5039
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...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1537
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
411
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...

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.