Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set tags for .jpg files #342

Open
SimonKravis opened this issue Oct 8, 2023 · 2 comments
Open

Cannot set tags for .jpg files #342

SimonKravis opened this issue Oct 8, 2023 · 2 comments

Comments

@SimonKravis
Copy link

SimonKravis commented Oct 8, 2023

Using TagLibSharp 2.3.0 from C# on Windows 11 to set Title metadata for JPG file with code below does not add any metadata
TagLib.File tagFile = TagLib.File.Create(sFile); tagFile.Tag.Title = sTag; tagFile.Save();

File metadata from ExifTool is shown below. A zero size file SetFromImageFails.txt is created in the folder containing the JPG.

C:\Users\simon\Pictures\Test TagLibSharp>exiftool 5a02fc06-23d2-11e8-a6a3-ec086b02610b.jpg
ExifTool Version Number : 12.40
File Name : 5a02fc06-23d2-11e8-a6a3-ec086b02610b.jpg
Directory : .
File Size : 160 KiB
File Modification Date/Time : 2011:07:15 01:17:00+10:00
File Access Date/Time : 2023:10:09 09:19:25+11:00
File Creation Date/Time : 2023:09:05 18:50:46+10:00
File Permissions : -rw-rw-rw-
File Type : JPEG
File Type Extension : jpg
MIME Type : image/jpeg
JFIF Version : 1.01
Resolution Unit : None
X Resolution : 1
Y Resolution : 1
Image Width : 2048
Image Height : 1536
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
Image Size : 2048x1536
Megapixels : 3.1

@Allotrope-
Copy link

I am seeing similar behavior as well. If the metadata on an image is modified manually, it succeeds, but an image with no existing metadata seems to be skipped.

There are no errors when setting the tag or saving the changes.

(The tag output is identical after the 6th line)
example

@roscofil
Copy link

roscofil commented Sep 15, 2024

FWIW: I saw the same issue myself, but it seemed to happen only on "foreign" external images: by this, I mean that I recently grabbed a jpg from the web and this image did not accept keywords tags to be written although no error message was produced.
I then loaded the jpg image in Gimp and overwrote it and then the library sucessfully wrote the keywords...

What would be a good-to-have is a returning msg to the function which writes the tag...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants