473,387 Members | 1,291 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.

Overwriting image metadata

I need to read the metadata of an image, display it on the screen and allow
the user to change it and then re-write the metadata back into the image.
The issue I am having is if I try to rename or delete the existing image
before re-writing the image file I get an error stating that the image is in
use. I am using Image.FromFile() to read the file. I have tried disposing
of the image and running the garbage collector (GC.Collect()), but it still
doesn't work. Is there a way to actually close the file so I can
delete/rename it?

Thanks,

Tim
Jun 27 '08 #1
1 2812
On Mon, 19 May 2008 07:45:13 -0700, Tim Kelley <tk*****@company.comwrote:
I need to read the metadata of an image, display it on the screen and
allow
the user to change it and then re-write the metadata back into the image.
The issue I am having is if I try to rename or delete the existing image
before re-writing the image file I get an error stating that the image
is in
use. I am using Image.FromFile() to read the file. I have tried
disposing
of the image and running the garbage collector (GC.Collect()), but it
still
doesn't work. Is there a way to actually close the file so I can
delete/rename it?
Disposing the Image instance you created using FromFile() should do it.
Can you post a concise-but-complete code sample that demonstrates what you
tried and how it fails to work?

Pete
Jun 27 '08 #2

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

Similar topics

7
by: Phil Powell | last post by:
How do you detect an image MIME type if you know of the image in a directory? For example, I know of: if (is_file("$myImagePath/$myImageName")) { // FIND MIME TYPE BUT HOW I DUNNO } The...
2
by: Travis | last post by:
Hi everyone, I'm using the System.Drawing.Imaging.Bitmap to retrieve and modify the metadata tags (user comments, keywords etc) of JPEGS. I was wondering if changing these tags in any way...
2
by: BluDog | last post by:
Hi Does anyone know how to extract Jpg image metadata from an image? Cheers Blu
0
by: Robert Seidl | last post by:
I saw that VB .Net 2003 has some tools for easily reading metadata information present in some TIFF and JPG files, eg. ---------------------------------------------------------------- .... Dim b...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
4
by: Bruce | last post by:
I have an asp.net page that is dynamically building a table and populating cells with images (typically jpeg) and with associated metadata. How can the asp.net code efficiently determine the...
1
by: Karthik | last post by:
Hi, I have been using GDI+ and Windows Media SDK to get the metadata information for image and audio files respectively. Just incase if someone is not clear as to what I mean by metadata...
1
by: Beagley | last post by:
This error occurs when chaning the "Badge Number" field of my database, the program is taking the photo of the record that is being changed and copies it to the NEXT record in the DataGridView...
3
by: faelnefal | last post by:
does anyone know at what point in an mp3 the image metadata is located? and if you do know, how do you convert the binary data into an image in a picturebox?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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...

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.