The good news is that this is an exception, you can catch it in order to 
prevent a script from exiting with a fatal error

I was occasionally having the same error, so I encased the code in a 
try/catch blocks

try{
                $this->fnSaveExif($intResourceId, $this->strTempFilePath);
            }
            catch(PelException $e)
            {
                $arrStack = $e->getTrace();
                $strMessage = LF.'Error message: 
'.LF.$e->getMessage().LF.'file: '.$e->getFile().LF.'line: 
'.$e->getLine().LF.'stack: '.print_r($arrStack, true).LF;
                $this->objLogger->log($strMessage);
                // return false;
            }

This way if one of the images is having this problem it will not kill 
the whole script.



SourceForge.net wrote:

>Bugs item #1730993, was opened at 2007-06-04 20:26
>Message generated for change (Comment added) made by lsolesen
>You can respond by visiting: 
>https://sourceforge.net/tracker/?func=detail&atid=650322&aid=1730993&group_id=108380
>
>Please note that this message will contain a full copy of the comment thread,
>including the initial issue submission, for this request,
>not just the latest update.
>Category: Parsing
>Group: PEL Version 0.9.x
>Status: Open
>Resolution: None
>Priority: 5
>Private: No
>Submitted By: jackchen (jackiechen858)
>Assigned to: Nobody/Anonymous (nobody)
>Summary: Fatal error when handling Exif
>
>Initial Comment:
>
>Hi,
>
>I am using the following code to add exif data on a image:
>
>         require_once('PelJpeg.php');
>         $jpeg = new PelJpeg($tmpfile);
>         $exif = $jpeg->getExif();
>         if ( $exif != null )
>         {
>            $jpeg1 = new PelJpeg($bigfile);
>            $jpeg1->setExif( $exif);
>            file_put_contents($bigfile, $jpeg1->getBytes());
>         }
>
>It works for most images, but when I try to load exif data from the attached 
>image:
>
>
>the Pel library threw out a fatal error:
>
>br />
><b>Fatal error</b>:  Uncaught exception 'PelDataWindowWindowException' with 
>message 'Window [1002, 712] does not fit in window [0, 712]' in 
>/websites/docs/newtest/php_inc/PelDataWindow.php:175
>Stack trace:
>#0 /websites/docs/newtest/php_inc/PelDataWindow.php(222): 
>PelDataWindow->setWindowStart(1002)
>#1 /websites/docs/newtest/php_inc/PelIfd.php(530): 
>PelDataWindow->getClone(1002, -290)
>#2 /websites/docs/newtest/php_inc/PelIfd.php(248): 
>PelIfd->safeSetThumbnail(Object(PelDataWindow), 1002, 14812)
>#3 /websites/docs/newtest/php_inc/PelTiff.php(164): 
>PelIfd->load(Object(PelDataWindow), 8)
>#4 /websites/docs/newtest/php_inc/PelExif.php(121): 
>PelTiff->load(Object(PelDataWindow))
>#5 /websites/docs/newtest/php_inc/PelJpeg.php(244): 
>PelExif->load(Object(PelDataWindow))
>#6 /websites/docs/newtest/php_inc/PelJpeg.php(315): 
>PelJpeg->load(Object(PelDataWindow))
>#7 /websites/docs/newtest/php_inc/PelJpeg.php(163): P in 
><b>/websites/docs/newtest/php_inc/PelDataWindow.php</b> on line <b>175</b><br 
>/>
>~
>
>----------------------------------------------------------------------
>
>  
>
>>Comment By: Lars Olesen (lsolesen)
>>    
>>
>Date: 2008-04-23 14:25
>
>Message:
>Logged In: YES 
>user_id=1766074
>Originator: NO
>
>Hi jackiechen858,
>
>Could you confirm that the image works with other Exif readers?
>
>----------------------------------------------------------------------
>
>Comment By: Martin Geisler (mgeisler)
>Date: 2007-10-22 06:03
>
>Message:
>Logged In: YES 
>user_id=1264592
>Originator: NO
>
>I have not yet tried your test image with PEL, but please tell me: does
>the image work with other Exif readers? That is always nice to know before
>starting to debug PEL... :-)
>
>----------------------------------------------------------------------
>
>Comment By: jackchen (jackiechen858)
>Date: 2007-06-04 20:27
>
>Message:
>Logged In: YES 
>user_id=1808100
>Originator: YES
>
>forgot to mention I amd using pel-0.9.1 
>
>----------------------------------------------------------------------
>
>You can respond by visiting: 
>https://sourceforge.net/tracker/?func=detail&atid=650322&aid=1730993&group_id=108380
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
>Don't miss this year's exciting event. There's still time to save $100. 
>Use priority code J8TL2D2. 
>http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
>_______________________________________________
>PEL-devel mailing list
>PEL-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/pel-devel
>
>
>
>  
>


-- 

Open Source ALL content management
with streaming video
http://wiki.sharedlog.com



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
PEL-devel mailing list
PEL-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pel-devel

Reply via email to