#include <libexif/fuji/exif-mnote-data-fuji.h>
#include <libexif/olympus/exif-mnote-data-olympus.h>
#include <libexif/pentax/exif-mnote-data-pentax.h>
-#include <libexif/samsung/exif-mnote-data-samsung.h>
#include <stdlib.h>
#include <stdio.h>
return (d && d->priv) ? d->priv->md : NULL;
}
-ExifByteOrder
-exif_data_get_data_order (ExifData *d)
-{
- return (d && d->priv) ? d->priv->order : -1;
-}
-
ExifData *
exif_data_new (void)
{
ExifData *
exif_data_new_from_data (const unsigned char *data, unsigned int size)
{
- ExifData *edata;
+ ExifData *edata = NULL;
edata = exif_data_new ();
exif_data_load_data (edata, data, size);
EXIF_DATA_TYPE_MAKER_NOTE_PENTAX = 3,
EXIF_DATA_TYPE_MAKER_NOTE_NIKON = 4,
EXIF_DATA_TYPE_MAKER_NOTE_CASIO = 5,
- EXIF_DATA_TYPE_MAKER_NOTE_FUJI = 6,
- EXIF_DATA_TYPE_MAKER_NOTE_SAMSUNG = 7
+ EXIF_DATA_TYPE_MAKER_NOTE_FUJI = 6
} ExifDataTypeMakerNote;
/*! If MakerNote is recognized, load it.
} else if ((mnoteid = exif_mnote_data_pentax_identify (data, e)) != 0) {
exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
"ExifData", "Pentax MakerNote variant type %d", mnoteid);
- data->priv->md = exif_mnote_data_pentax_new (data->priv->mem);
- } else if ((mnoteid = exif_mnote_data_samsung_identify (data, e)) != 0) {
- exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG,
- "ExifData", "Samsung MakerNote variant type %d", mnoteid);
- data->priv->md = exif_mnote_data_samsung_new (data->priv->mem);
+ data->priv->md = exif_mnote_data_pentax_new (data->priv->mem);
}
+
/*
* If we are able to interpret the maker note, do so.
*/
{
return (d && d->priv) ? d->priv->data_type : EXIF_DATA_TYPE_UNKNOWN;
}
-
-/* Used for making maker note data structure from external sources */
-int
-exif_data_mnote_data_new(ExifData *d, Manufacturer maker, ExifDataOption o)
-{
- ExifMnoteData *md;
- ExifMem *mem;
-
- if(!d) return 0;
-
- md = d->priv->md;
- mem = d->priv->mem;
-
- switch(maker){
- case MAKER_CANON:
- md = exif_mnote_data_canon_new(mem, o);
- break;
- case MAKER_FUJI:
- md = exif_mnote_data_fuji_new(mem);
- break;
- case MAKER_OLYMPUS:
- case MAKER_NIKON:
- md = exif_mnote_data_olympus_new(mem);
- break;
- case MAKER_PENTAX:
- case MAKER_CASIO:
- md = exif_mnote_data_pentax_new(mem);
- break;
- case MAKER_SAMSUNG:
- md = exif_mnote_data_samsung_new(mem);
- break;
- default:
- break;
- }
- if(!md)
- return 0;
- else{
- d->priv->md = md;
- return 1;
- }
-}
-
-int
-exif_data_mnote_set_mem_for_adding_entry(ExifMnoteData *md, Manufacturer maker)
-{
- ExifMem *mem;
- unsigned int count;
- ExifMnoteDataSamsung *mds;
-
- if(!md) return 0;
-
- mem = md->mem;
-
- switch(maker){
- case MAKER_CANON:
- break;
- case MAKER_FUJI:
- break;
- case MAKER_OLYMPUS:
- case MAKER_NIKON:
- break;
- case MAKER_PENTAX:
- case MAKER_CASIO:
- break;
- case MAKER_SAMSUNG:
- mds = (ExifMnoteDataSamsung *) md;
- count = ++(mds->count);
- if(count == 1) {
- mds->entries = exif_mem_alloc(mem, sizeof(MnoteSamsungEntry) * count);
- if(!mds->entries) {
- EXIF_LOG_NO_MEMORY(md->log, "ExifMnoteSamsung", count);
- mds->count--;
- return 0;
- }
- }
- else {
- MnoteSamsungEntry **e;
- e = exif_mem_realloc(mem, mds->entries, sizeof(MnoteSamsungEntry) * count);
- if(!e) {
- EXIF_LOG_NO_MEMORY(md->log, "ExifMnoteSamsung", count);
- mds->count--;
- return 0;
- }
- mds->entries = e;
- }
- mds->entries[count-1].format = 0;
- break;
- default:
- return 0;
- }
- return 1;
-}
-
-int
-exif_data_mnote_set_add_entry (ExifMnoteData* md, Manufacturer maker, int tag, ExifFormat fmt, int components, int id)
-{
- int count;
- ExifMnoteDataSamsung *mds;
-
- if(!md) return 0;
-
- switch(maker){
- case MAKER_CANON:
- break;
- case MAKER_FUJI:
- break;
- case MAKER_OLYMPUS:
- case MAKER_NIKON:
- break;
- case MAKER_PENTAX:
- case MAKER_CASIO:
- break;
- case MAKER_SAMSUNG:
- mds = (ExifMnoteDataSamsung *) md;
- count = mds->count;
- mds->entries[count-1].tag = tag;
- mds->entries[count-1].format = fmt;
- mds->entries[count-1].components = components;
- mds->entries[count-1].size = exif_format_get_size(fmt*components);
- mds->entries[count-1].data = exif_mem_alloc(md->mem, mds->entries[count-1].size);
- mnote_samsung_entry_set_value_by_index(&mds->entries[count-1], id);
- break;
- default:
- return 0;
- }
- return 1;
-}
-
-int
-exif_data_mnote_set_add_entry_subtag(ExifMnoteData* md, Manufacturer maker, int tag, ExifFormat fmt, int components, int subtag1, int id1, int subtag2, int id2, int val)
-{
- int count;
- ExifMnoteDataSamsung *mds;
-
- if(!md) return 0;
-
- switch(maker){
- case MAKER_CANON:
- break;
- case MAKER_FUJI:
- break;
- case MAKER_OLYMPUS:
- case MAKER_NIKON:
- break;
- case MAKER_PENTAX:
- case MAKER_CASIO:
- break;
- case MAKER_SAMSUNG:
- mds = (ExifMnoteDataSamsung *) md;
- count = mds->count;
- mds->entries[count-1].tag = tag;
- mds->entries[count-1].format = fmt;
- mds->entries[count-1].components = components;
- mds->entries[count-1].size = exif_format_get_size(fmt*components);
- mds->entries[count-1].data = exif_mem_alloc(md->mem, mds->entries[count-1].size);
- mnote_samsung_entry_set_value_by_subtag(&mds->entries[count-1], subtag1, id1, subtag2, id2, val);
- break;
- default:
- return 0;
- }
- return 1;
-}
-
-int
-exif_data_mnote_set_add_entry_string(ExifMnoteData* md, Manufacturer maker, int tag, ExifFormat fmt, int components, const char* string)
-{
- int count;
- ExifMnoteDataSamsung *mds;
-
- if(!md) return 0;
-
- switch(maker){
- case MAKER_CANON:
- break;
- case MAKER_FUJI:
- break;
- case MAKER_OLYMPUS:
- case MAKER_NIKON:
- break;
- case MAKER_PENTAX:
- case MAKER_CASIO:
- break;
- case MAKER_SAMSUNG:
- mds = (ExifMnoteDataSamsung *) md;
- count = mds->count;
- mds->entries[count-1].tag = tag;
- mds->entries[count-1].format = fmt;
- mds->entries[count-1].components = components;
- mds->entries[count-1].size = exif_format_get_size(fmt*components);
- mds->entries[count-1].data = exif_mem_alloc(md->mem, mds->entries[count-1].size);
- mnote_samsung_entry_set_value_by_string(&mds->entries[count-1], string, components);
- break;
- default:
- return 0;
- }
- return 1;
-}