Ok, I guess it was a bit weird to put many things in one patch. Attached are
two new patches based on r4043:
- comments.diff with a few comments and small fixes to
plugins/meta-tiff/tiff-meta.c.
- tiff6.0.diff with the implementation for reading most TIFF6.0 datatypes.
If they are useful (which I assume since there was a fixme saying "Implement
types from TIFF 6.0") they might as well be included now. Then I can rant
about my exposure compensation later :-)
On Thu, Sep 8, 2011 at 21:50, Erik Wognsen <[email protected]> wrote:
> Yes, I think they have in tiff as well (my camera produces .TIF, not .CR2).
> I just wanted to see the number in the thumbnail tooltip with the other Exif
> info.
>
>
>
> On Thu, Sep 8, 2011 at 20:24, Klaus Post <[email protected]> wrote:
>
>> Hi!
>>
>> Cool - what is exposure compensation to be used for? On CR2 images
>> exposure adjustments have already been applied to the RAW data, so there is
>> no need for Rawstudio to actually care about it.
>>
>>
>> Regards, Klaus Post
>>
>> http://www.klauspost.com
>>
>>
>> On Thu, Sep 8, 2011 at 17:05, Erik Wognsen <[email protected]>wrote:
>>
>>> Hi,
>>>
>>> I wanted to see exposure compensation (bias) data along with the other
>>> Exif data in RS and while implementing that I added code for handling some
>>> of the unimplemented TIFF6.0 data types. I've attached a patch based on
>>> r4025. I have not tried the data types beside the SRATIONAL type I needed
>>> for exposure compensation and I have certainly not tested anything
>>> rigorously.
>>>
>>> The exposure compensation is only implemented in the meta-tiff plugin and
>>> I have only tested with files from my Canon 1Ds mk1. If there are raw files
>>> taken with exposure compensation available for other cameras and it's a
>>> feature you think should be in RS, I can look at implementing it for other
>>> meta plugins, cameras and what not, but I'm new to this project and would
>>> probably need a little guidance :-)
>>>
>>> Regards,
>>> Erik Wognsen
>>>
>>> _______________________________________________
>>> Rawstudio-dev mailing list
>>> [email protected]
>>> http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-dev
>>>
>>>
>>
>> _______________________________________________
>> Rawstudio-dev mailing list
>> [email protected]
>> http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-dev
>>
>>
>
Index: plugins/meta-tiff/tiff-meta.c
===================================================================
110a111
> // why not use raw_get_rational from librawstudio/rs-rawfile.c in here? -erw, 2011-09-07
158c159
< ifd->value_rational = get_rational(rawfile, ifd->value_offset);
---
> ifd->value_rational = get_rational(rawfile, ifd->value_offset);
291c292
< case 0x4001: /* white balance for mulpiple Canon cameras */
---
> case 0x4001: /* white balance for multiple Canon cameras */
1392a1394
> // Is it on purpose not to check idf.count here when it is done in the other cases? -erw, 2011-09-07
Index: plugins/meta-tiff/tiff-meta.c
===================================================================
51a52
> gchar value_char;
52a54
> gshort value_short;
53a56
> gint value_int;
54a58,60
> gdouble value_srational;
> gfloat value_float;
> gdouble value_double;
121a128,144
> /**
> * Get a TIFF_FIELD_TYPE_SRATIONAL value from a TIFF file
> */
> static gfloat
> get_srational(RAWFILE *rawfile, guint offset)
> {
> gint int1=0, int2=1;
> if (!raw_get_int(rawfile, offset, &int1))
> return 0;
> if (!raw_get_int(rawfile, offset+4, &int2))
> return 0;
>
> if (int2 == 0)
> return 0;
> return ((gdouble) int1) / ((gdouble) int2);
> }
>
148a172
> /* case TIFF_FIELD_TYPE_ASCII: TODO? */
160a185,209
> case TIFF_FIELD_TYPE_SBYTE:
> raw_get_char(rawfile, offset+8, &ifd->value_char);
> ifd->value = ifd->value_char;
> break;
> /* case TIFF_FIELD_TYPE_UNDEFINED: TODO? */
> case TIFF_FIELD_TYPE_SSHORT:
> raw_get_short(rawfile, offset+8, &ifd->value_short);
> ifd->value = ifd->value_short;
> break;
> case TIFF_FIELD_TYPE_SLONG:
> raw_get_int(rawfile, offset+8, &ifd->value_int);
> ifd->value = ifd->value_int;
> break;
> case TIFF_FIELD_TYPE_SRATIONAL:
> ifd->value_srational = get_srational(rawfile, ifd->value_offset);
> ifd->value = ifd->value_srational;
> break;
> case TIFF_FIELD_TYPE_FLOAT:
> raw_get_float(rawfile, offset+8, &ifd->value_float);
> ifd->value = ifd->value_float;
> break;
> case TIFF_FIELD_TYPE_DOUBLE:
> raw_get_double(rawfile, offset+8, &ifd->value_double);
> ifd->value = ifd->value_double;
> break;
162d210
< /* FIXME: Implement types from TIFF 6.0 */
Index: librawstudio/rs-rawfile.c
===================================================================
74a75,86
> raw_get_int(RAWFILE *rawfile, guint pos, gint *target)
> {
> if((rawfile->base+pos+4)>rawfile->size)
> return(FALSE);
> if (rawfile->byteorder == cpuorder)
> *target = *(gint *)(rawfile->map+pos+rawfile->base);
> else
> *target = ENDIANSWAP4(*(gint *)(rawfile->map+pos+rawfile->base));
> return(TRUE);
> }
>
> gboolean
127d138
<
135a147,158
> raw_get_double(RAWFILE *rawfile, guint pos, gdouble *target)
> {
> if((rawfile->base+pos+8)>rawfile->size)
> return(FALSE);
> if (rawfile->byteorder == cpuorder)
> *target = *(gdouble *)(rawfile->map+rawfile->base+pos);
> else
> *target = (gdouble) (ENDIANSWAP8(*(gint64 *)(rawfile->map+rawfile->base+pos)));
> return(TRUE);
> }
>
> gboolean
141a165,174
> return(TRUE);
> }
>
> gboolean
> raw_get_char(RAWFILE *rawfile, guint pos, gchar *target)
> {
> if((rawfile->base+pos+1)>rawfile->size)
> return(FALSE);
>
> *target = *(gchar *)(rawfile->map+rawfile->base+pos);
Index: librawstudio/rs-rawfile.h
===================================================================
22,23c22,24
< #define ENDIANSWAP4(a) (((a) & 0x000000FF) << 24 | ((a) & 0x0000FF00) << 8 | ((a) & 0x00FF0000) >> 8) | (((a) & 0xFF000000) >> 24)
< #define ENDIANSWAP2(a) (((a) & 0x00FF) << 8) | (((a) & 0xFF00) >> 8)
---
> #define ENDIANSWAP8(a) (((a) & 0x00000000000000FF) << 56 | ((a) & 0x000000000000FF00) << 40 | ((a) & 0x0000000000FF0000) << 24 | ((a) & 0x00000000FF000000) << 8 | ((a) & 0x000000FF00000000) >> 8 | ((a) & 0x0000FF0000000000) >> 24 | ((a) & 0x00FF000000000000) >> 40 | ((a) & 0xFF00000000000000) >> 56)
> #define ENDIANSWAP4(a) (((a) & 0x000000FF) << 24 | ((a) & 0x0000FF00) << 8 | ((a) & 0x00FF0000) >> 8 | ((a) & 0xFF000000) >> 24)
> #define ENDIANSWAP2(a) (((a) & 0x00FF) << 8 | ((a) & 0xFF00) >> 8)
31a33
> gboolean raw_get_int(RAWFILE *rawfile, guint pos, gint *target);
36a39
> gboolean raw_get_double(RAWFILE *rawfile, guint pos, gdouble *target);
37a41
> gboolean raw_get_char(RAWFILE *rawfile, guint pos, gchar *target);
_______________________________________________
Rawstudio-dev mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-dev