[Fixed]: EXIF and Olympus doesn't work [Fixed]: EXIF and Olympus doesn't work
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[Fixed]: EXIF and Olympus doesn't work

Started by fribse, July 20, 2007, 08:45:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fribse

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

Nibbler


fribse

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.

fribse


Nibbler

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

fribse

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

/Fribse

Joachim Müller

Quote from: GauGau on November 09, 2006, 04:48:36 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.
Quote from: GauGau on September 12, 2006, 08:33:49 AMAs 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.

fribse


vangoga

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) {



                if($bytesofdata<=4) {

                        $data = $value;

                } else {


To



                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

vangoga

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


        $place=8; //current place

        $offset=8;


add

        if( substr($block,0,7)=="OLYMPUS")
        {
            $place+=4;
        }


It will give you right number of items in the MakerNote

Joachim Müller

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

vangoga

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


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);


CalPolyRock

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!

Joachim Müller

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.

CalPolyRock

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

EC

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

Joachim Müller

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

fribert

Oh, and it works on my u770SW as well.