Search…

X3 Photo Gallery Support Forums

Search…
 
docau
Topic Author
Posts: 1
Joined: 16 Jul 2022, 15:42

Crash with photos taken on the equator

17 Jul 2022, 11:12

After uploading a number of photos the entire X3 web interface stopped working.

Stack trace is below, which seems to be caused by images with either empty or zero EXIF location data (or, I guess, any photo taken legitimately exactly on the equator!)

Two photos that triggered it :
C:\tmp>exiftool.exe -GPSLatitude cheetah_5163808330_o.jpg
GPS Latitude                    :

C:\tmp>exiftool.exe -GPSLatitude crw_22791_9361229609_o.jpg
GPS Latitude                    : 0 deg 0' 0.00" N


The issue is in gps2Num(), specifically :
    return floatval($parts[0]) / floatval($parts[1]);


Stack trace :
Code
Fatal error: Uncaught DivisionByZeroError: Division by zero in /var/www/html/app/extensions/exif_reader.php:147
Stack trace:
#0 /var/www/html/app/extensions/exif_reader.php(126): KEHA76_Exif_Reader->gps2Num('0/0')
#1 /var/www/html/app/extensions/exif_reader.php(64): KEHA76_Exif_Reader->get_image_location(Array)
#2 /var/www/html/app/asset-types/image.inc.php(21): KEHA76_Exif_Reader->getDetails('./content/index...')
#3 /var/www/html/app/asset-types/image.inc.php(9): Image->set_extended_data('./content/index...')
#4 /var/www/html/app/asset-types/asset-factory.inc.php(45): Image->__construct('./content/index...')
#5 /var/www/html/app/asset-types/asset-factory.inc.php(63): AssetFactory::create('./content/index...')
#6 /var/www/html/app/extensions/twig-extensions.inc.php(261): AssetFactory::get('./content/index...')
#7 /var/www/html/app/templates/19/f0/e818066baf93d82ea80a3558020c38fae78b140dc449a0485e3dfecc68bd.php(64): X3_Twig_Extension->sortby(Array, 'name', false)
#8 /var/www/html/app/parsers/Twig/Template.php(276): __TwigTemplate_19f0e818066baf93d82ea80a3558020c38fae78b140dc449a0485e3dfecc68bd->doDisplay(Array, Array)
#9 /var/www/html/app/parsers/Twig/Template.php(250): Twig_Template->displayWithErrorHandling(Array, Array)
#10 /var/www/html/app/templates/cc/29/202264ab201d0d43a63882c31b1c06ae7e7992a5c371c52f885633d0acfa.php(285): Twig_Template->display(Array)
#11 /var/www/html/app/parsers/Twig/Template.php(276): __TwigTemplate_cc29202264ab201d0d43a63882c31b1c06ae7e7992a5c371c52f885633d0acfa->doDisplay(Array, Array)
#12 /var/www/html/app/parsers/Twig/Template.php(250): Twig_Template->displayWithErrorHandling(Array, Array)
#13 /var/www/html/app/parsers/Twig/Template.php(261): Twig_Template->display(Array)
#14 /var/www/html/app/parsers/Twig/Environment.php(292): Twig_Template->render(Array)
#15 /var/www/html/app/parsers/template-parser.inc.php(27): Twig_Environment->render('page.html', Array)
#16 /var/www/html/app/asset-types/page.inc.php(55): TemplateParser::parse(Array, 'page.html')
#17 /var/www/html/app/cache.inc.php(111): Page->parse_template()
#18 /var/www/html/app/x3.inc.php(163): Cache->create('index', './content/index', true, true)
#19 /var/www/html/app/x3.inc.php(244): X3->render('./content/index', './app/twig/page...')
#20 /var/www/html/app/x3.inc.php(368): X3->create_page('./content/index')
#21 /var/www/html/index.php(28): X3->__construct(Array)
#22 {main}
  thrown in /var/www/html/app/extensions/exif_reader.php on line 147
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13399
Joined: 30 Sep 2006, 03:37

Re: Crash with photos taken on the equator

17 Jul 2022, 23:13

Right. Could you send me a sample photo karl AT photo.gallery please? Also, what PHP version are you using? I will diagnose.