c# - How to insert any amount of metadata into a jpeg? -


i want able write huge amount of metadata jpeg .net fighting me. i'm point wonder if easier modify bytes myself. there's no image.metadata.comment = "my comment";, can't find projects (see answer), microsoft's documentation confusing, stackoverflow post led this article when end find out doesn't show how write metadata, , this code john p works if try add lot of characters error system.io.fileformatexception: commit unsuccessful because metadata changed..

so pretty nothing working @ all. want add comment, of length, jpeg. if jpeg 1.3mb want able add comment long jpeg becomes 10mb.

you don't type of metadata you're trying write. question sounds though you're writing large strings jpeg comment section.

jpeg files list of segments. these segments have type identifier (a single byte) , length (two bytes). means longest segment can 65535 bytes in length.

you can store comments in own segment, so-called com segment.

if comment longer 65535 bytes, can store multiple com segments in file. reader supposed concatenate these final comment.

some discussion here.

as how in c#, i'm not aware of library supports this. wrote , maintain metadataextractor .net , java, name suggests it's reading, not writing, metadata.

however container format jpeg not complicated. shouldn't complicated write own code injects com segments file , copies other segments in verbatim.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -