Exemplo n.º 1
0
        public void Reset(Tag tag)
        {
            unsafe {
                // Free any exsting data so that _initialize will actually set the data
                if (_handle->data != IntPtr.Zero)
                {
                    ExifData.free(_handle->data);
                }
                _handle->data = IntPtr.Zero;
            }

            exif_entry_initialize(handle, tag);

            //FIXME the month string in time fields in libexif ix currently broken so we do our own.
            if (tag == Tag.DateTime ||
                tag == Tag.DateTimeOriginal ||
                tag == Tag.DateTimeDigitized)
            {
                this.SetData(System.DateTime.Now);
            }
        }
Exemplo n.º 2
0
        public void SetData(byte [] data, int size)
        {
            unsafe {
                if (data == null || data.Length == 0)
                {
                    throw new System.Exception("Invalid Length");
                }

                if (_handle->data != IntPtr.Zero)
                {
                    ExifData.free(_handle->data);
                }

                _handle->data = ExifData.malloc((uint)data.Length);
                Marshal.Copy(data, 0, _handle->data, data.Length);

                _handle->size = (uint)data.Length;
                // This needs to be set per type as well but
                // we do it here as well
                _handle->components = (uint)(data.Length / size);
            }
        }