473,387 Members | 3,810 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,387 software developers and data experts.

Howto SET image metadata (Tiff, geotiff, exif tags)

I saw that VB .Net 2003 has some tools for easily reading metadata
information present in some TIFF and JPG files, eg.
----------------------------------------------------------------
....
Dim b As New Bitmap(OpenFileDialog1.FileName)
For Each p As System.Drawing.Imaging.PropertyItem In b.PropertyItems
' do something with
' p.Id
' p.Len
' p.Type
' p.Value
Next
----------------------------------------------------------------

And this works nicely, you can google for some code on the web that parses
out EXIF tags, TIFF tags etc.

Now how about WRITING tags ? Much messier !
Acc to docs, there is no constructor for the PropertyItem class, so where do
you get an instance ?
Microsofts answer: you STEAL it. From an existing tag:

----------------------------------------------------------------
....
Dim b As New Bitmap(OpenFileDialog1.FileName)

Dim prop As System.Drawing.Imaging.PropertyItem = image.PropertyItems(0) '
steal this instance
Dim bvalue() As Byte = {0, 1, 2, 3}
prop.Id = 34264 '//set the id (Tag Number)
prop.Len = 4 'set the length
prop.Type = 2'//set the type (datatype)
prop.Value = bvalue '//set the value
image.SetPropertyItem(prop) '//apply the property to the image
----------------------------------------------------------------

I assume this will add rather than replace the existing (stolen)
propertyitem, as long as a different Id is used.
But what if I start with an image from scratch, eg.
----------------------------------------------------------------
Dim image As New Bitmap(200, 200,
System.Drawing.Imaging.PixelFormat.Format32bppPArg b)
....draw stuff into image
....now how to add a PropertyItem to image ????
----------------------------------------------------------------
I need to add GeoTIFF tags to bitmaps created from scratch in VB .net
....whats the recommended route ?

Thanks in advance
Robert
Nov 21 '05 #1
0 8340

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

Similar topics

1
by: Phil Powell | last post by:
PHP 4.3.2 with --enable-exif I have the following class: <?php class ThumbGenerator extends MethodGeneratorForActionPerformer { function ThumbGenerator() { // CONSTRUCTOR
0
by: Weasel | last post by:
Does anyone know about a free API to insert textual data (like EXIF) into JPEG's and/or TIFF's? I've looked around but haven't found anything worth using. Most of the things I've found are,...
4
by: tvmaly | last post by:
Does anyone know if it is possible to determine if an image is horizontal/vertical and color or black & white using the python image library? I have been searching this news group and the...
0
by: Bruce | last post by:
Hi All, I was hoping to be able to determine what format image I had loaded using code similar to that listed below. And this does seem to work for all by the Exif format files which are...
6
by: Michael | last post by:
I'm trying to use the Bitmap class's Save Method to save a Bitmap as a GIF. My code runs fine, and converts the image, but the quality is not anywhere close to as good. I know that GIF quality is...
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....
2
by: Jack | last post by:
Hello, I need to check TIFF or JPG file to get the DPI they were scanned in at 200, 300, etc. Any help would be great. Thanks in advance for any help, Jack
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...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.