Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: [Fixed]: EXIF and Olympus doesn't work  (Read 36128 times)

0 Members and 1 Guest are viewing this topic.

fribse

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
[Fixed]: EXIF and Olympus doesn't work
« on: July 20, 2007, 08:45:37 pm »

Hi all

I've just gotten my new Olympus mju 770 SW which I brought with me to Egypt, and took a lot of very nice underwater pictures.
So I hurried and uploaded them to my gallery, much to my dismay I wasn't able to view any of my new pictures, though it worked with pictures from the old camera, so it had to be only the olympus maker that made problems.

I found a 'solution' of sorts in the forums, telling me to turn of exif, I wouldn't call it 'solved' but a very poor workaround.
One of the very few cool things that CPG has over a lot of other galleries are the EXIF extraction, so it would be a shame to miss out on it.

So, please please get it fixed!

BR
Fribse
« Last Edit: October 18, 2008, 05:10:07 pm by Joachim Müller »
Logged

Nibbler

  • Guest
Re: EXIF and Olympus doesn't work
« Reply #1 on: July 20, 2007, 10:59:35 pm »

How about an image to test with?
Logged

fribse

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: EXIF and Olympus doesn't work
« Reply #2 on: July 20, 2007, 11:10:58 pm »

Yes, of course, sorry.
It's a bit too big for posting here, so I've put it directly on my homepage: http://www.fribert.dk/2007-07-16_17-51-33.JPG

If there is anything else I can do, don't hesitate to ask, though from tomorrow I'll be offline for a week.
Logged

fribse

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: EXIF and Olympus doesn't work
« Reply #3 on: July 31, 2007, 11:17:05 am »

No news about this issue?
Logged

Nibbler

  • Guest
Re: EXIF and Olympus doesn't work
« Reply #4 on: July 31, 2007, 11:20:50 am »

I took a look but it's beyond me to come up with a fix.
Logged

fribse

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: EXIF and Olympus doesn't work
« Reply #5 on: August 01, 2007, 07:24:14 am »

Ok, is there a bug system I should report it to? Or have you already done that?

/Fribse
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: EXIF and Olympus doesn't work
« Reply #6 on: August 01, 2007, 08:56:18 am »

http://forum.coppermine-gallery.net/index.php?topic=34936.msg178752#msg178752
http://forum.coppermine-gallery.net/index.php?topic=32767.0 (German thread)

The EXIF library used with Coppermine is outdated and doesn't get developed any longer. Therefor, there may be issues with particular EXIF fields and the content in it. There may be issues with different EXIF flavors by different camera vendors. Hard to recommend anything, sorry.
As explained above: EXIF is in no way a standard. All camera vendors have their own flavor of Exif. Coppermine only supports some Exif-tags, but not all of them. There's little we could do. In fact, the Exif feature comes as-is.
None of the devs is an exif-expert, so we're simply not capable to come up with a revised exif library. I'm sorry, but you'll have to live with this I'm afraid, or use another application.
Logged

fribse

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: EXIF and Olympus doesn't work
« Reply #7 on: August 01, 2007, 09:09:32 am »

Ahh, darned  :'(
Logged

vangoga

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 4
Re: EXIF and Olympus doesn't work
« Reply #8 on: January 18, 2008, 07:15:58 pm »

I had the similar problem with OLYMPUS E-3 camera pictures.

I did some debuging and found out, that there are some problems with reading EXIF tag called MakersNote

It is parsed in include file include\makers\olympus.php

If you change part of code in function
function parseOlympus($block,&$result,$seek, $globalOffset) {


Code: [Select]
                if($bytesofdata<=4) {

                        $data = $value;

                } else {

To

Code: [Select]

                if($bytesofdata<=4) {

                        $data = $value;

                } else if($bytesofdata<100000) {

It will stop failing.

Anyway, it looks like OLYMPUS have changed MakersNote format in new cameras, and current code is not able to identify none of tags in MakersNote

I am not sure how my changes will affect pictures from old cameras, but shouldn't much.

Regards
Logged

vangoga

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 4
Re: EXIF and Olympus doesn't work
« Reply #9 on: January 18, 2008, 08:17:48 pm »

Ignore my previous post :)

I have found real solution finally :)

This is code sample i used make proper fix:
http://libexif.sourceforge.net/internals/exif-mnote-data-olympus_8c-source.html

It looks like there are two versions of Olympus MakerNote V1 and V2

After

Code: [Select]
        $place=8; //current place

        $offset=8;

add
Code: [Select]
        if( substr($block,0,7)=="OLYMPUS")
        {
            $place+=4;
        }

It will give you right number of items in the MakerNote
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: EXIF and Olympus doesn't work
« Reply #10 on: January 19, 2008, 01:29:30 pm »

Thanks for sharing your fix. Moving thread to bugs board to make sure that this gets looked into.
Logged

vangoga

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 4
Re: EXIF and Olympus doesn't work
« Reply #11 on: January 22, 2008, 02:40:23 pm »

There was some additional issues with OLYMPUS images, with correct byte order

Code: [Select]
function parseOlympus($block, &$result,$seek, $globalOffset) {


       /*
        * Olympus headers start with "OLYMP" and need to have at least
        * a size of 22 bytes (6 for 'OLYMP', 2 other bytes, 2 for the
        * number of entries, and 12 for one entry.
        *
        * Nikon headers start with "Nikon" (6 bytes including '\0'),
        * version number (1 or 2).
        *
        * Version 1 continues with 0, 1, 0, number_of_tags,
        * or just with number_of_tags (models D1H, D1X...).
        *
        * Version 2 continues with an unknown byte (0 or 10),
        * two unknown bytes (0), "MM" or "II", another byte 0 and
        * lastly 0x2A.
        */

        if($result['Endien']=="Intel") $intel=1;

        else $intel=0;



        $model = $result['IFD0']['Model'];



        $place=8; //current place

        $offset=8;

        if( substr($block,0,7)=="OLYMPUS")
        {
            if( substr($block,8,2)=="II")
                $intel=1;
            elseif( substr($block,8,2)=="MM")
                $intel=0;

            $place+=4;
        }



                //Get number of tags (2 bytes)

        $place+=2;

        if($intel==1) $num = intel2Moto($num);

Logged

CalPolyRock

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: EXIF and Olympus doesn't work
« Reply #12 on: April 16, 2008, 08:27:04 am »

This fix worked perfectly.  I own a new Olympus Stylus 850 SW camera and I was getting a 500 error on any images from this camera (obviously containing the new EXIF format).

Please include this because it will effect many more people.  Every time I do a Coppermine update for security patches (seems to be often these days), I need to manually make this change or be aware of this file. 

Also, if anyone uploads images from their newer Olympus camera, they'll get 500 error pages when trying to view the image.  I'm surprised this easy patch has not already been applied to the main branch.

Thanks!
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: EXIF and Olympus doesn't work
« Reply #13 on: April 16, 2008, 09:13:32 am »

I have applied your suggested changes and cleaned up the code a bit. The changes went into the SVN, please check out SVN: coppermine/trunk/cpg1.4.x/include/makers/olympus.php Revision 4391 and confirm that it works as expected (I don't have an Olympus camera, so I can't test for myself). Please report if this works.
Logged

CalPolyRock

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: EXIF and Olympus doesn't work
« Reply #14 on: April 18, 2008, 06:06:12 am »

It appears to work.  I uploaded your modded file to my coppermine server and everything seemed ok.  For future reference, here an Olympus photo is attached for testing.
Thanks
 -Ryan
Logged

EC

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
    • Fotonicamente
Re: EXIF and Olympus doesn't work
« Reply #15 on: July 28, 2008, 01:59:57 pm »

I had the same problem, used the new version of olympus.php and my problem solved. Now it seems to work also for exif data on olympus pictures!
thanks a lot
elena
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: EXIF and Olympus doesn't work
« Reply #16 on: July 28, 2008, 04:55:05 pm »

OK, thanks for your reports. The changes should be in cpg1.4.19 once it gets released.
Logged

fribert

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: [Fixed]: EXIF and Olympus doesn't work
« Reply #17 on: April 06, 2009, 01:00:18 pm »

Oh, and it works on my u770SW as well.
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 18 queries.