I'm uploading image to server and then processing the image. Funny thing is, after uploading the image image keywords are missing. Although other image properties are there.
There is no issue with parsing the tags, so please ignore below code snippet.
using (var xmp = Xmp.FromFile(workingFilePath, XmpFileMode.ReadOnly))
{
var iptc = new Iptc(xmp);
var Keywords = iptc.Keywords;
}
Note: I'm using FineUploader to upload image.
FineUploader configuration -
var manualUploader = new qq.FineUploader({
element: document.getElementById('fine-uploader-manual-trigger'),
template: 'qq-template-manual-trigger',
request: {
endpoint: '/image/uploadimage',
params: {
datestamp: datetimeStamp
}
},
callbacks: {
},
autoUpload: false,
multiple: true
});
qq(document.getElementById("trigger-upload")).attach("click", function () {
manualUploader.uploadStoredFiles();
});
Fineuploader log -
[Fine Uploader 5.10.1] Received 1 files.
[Fine Uploader 5.10.1] Attempting to validate image.
[Fine Uploader 5.10.1] Generating new thumbnail for 0
[Fine Uploader 5.10.1] Attempting to draw client-side image preview.
[Fine Uploader 5.10.1] Attempting to determine if _DSE8404.jpg can be rendered in this browser
[Fine Uploader 5.10.1] First pass: check type attribute of blob object.
[Fine Uploader 5.10.1] Second pass: check for magic bytes in file header.
[Fine Uploader 5.10.1] '_DSE8404.jpg' is able to be rendered in this browser
[Fine Uploader 5.10.1] Moving forward with EXIF header parsing for '_DSE8404.jpg'
[Fine Uploader 5.10.1] EXIF Byte order is little endian
[Fine Uploader 5.10.1] Found 10 APP1 directory entries
[Fine Uploader 5.10.1] Successfully parsed some EXIF tags
[Fine Uploader 5.10.1] Sending simple upload request for 0
[Fine Uploader 5.10.1] xhr - server response received for 0
Edit : Looks like I found the issue. There are some Icelandic character in tags. Thats making the problem. Anyone know how to solve this!
Latest Edit If those tags have been added from Adobe Photoshop Lightroom then facing the issue. But if the same tags are added from windows machine by updating properties, it works!
There could be two causes of your problem :
At some point you are rewriting your picture, probably with a class that either does not properly handle tags or strip them out because of its configuration.
If you just save the exact binary content you receive from the client you will also retrieve your original tags, provided your image file is formatted the way you expect it to be.
If your image file is stored differently from what you expect, the tags may not be retrieved depending on the way you are extracting them.
For instance, JPG/JPEG
tags can be stored in various manner (XMP beeing one).
Check the following link for more details. You will see there are other way to store tags (such as EXIF
, Extended XMP
, QVCI
, FLIR
).
To retrieve these tags you will have to parse them according to the way they are embedded in your image file.
From the server-side code you posted, you only seems to parse XMP tags. Depending on the software used to encode the original image, tags may be stored in an alternative format.
Although it look obvious, my advise would be :
JPEG
files can be really difficult to handle properly because of the various ways they may be stored.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With