Skip to content

update: log errors on bad graphics, and then ignore the file

Hans-Christoph Steiner requested to merge eighthave/fdroidserver:master into master

Python PIL is not so tolerant, so bad EXIF causes crashes. An app added a corrupt featureGraphic.png. This was breaking fdroid update runs. This makes it so that any image that Python PIL/Pillow can't process is just skipped with an error message.

@CiaranG @IzzySoft

https://jenkins.debian.net/job/reproducible_fdroid_test/259/console

  File "/var/lib/jenkins/userContent/reproducible/reproducible_fdroid_build_apps/fdroidserver/update.py", line 2088, in main
    insert_localized_app_metadata(apps)
  File "/var/lib/jenkins/userContent/reproducible/reproducible_fdroid_build_apps/fdroidserver/update.py", line 978, in insert_localized_app_metadata
    _strip_and_copy_image(os.path.join(root, f), destdir)
  File "/var/lib/jenkins/userContent/reproducible/reproducible_fdroid_build_apps/fdroidserver/update.py", line 754, in _strip_and_copy_image
    in_image = Image.open(fp)
  File "/usr/lib/python3/dist-packages/PIL/Image.py", line 2687, in open
    % (filename if filename else fp))
OSError: cannot identify image file <_io.BufferedReader name='build/org.sw24softwares.starkeverben/fastlane/metadata/android/en-US/images/featureGraphic.png'>

Merge request reports