uploads: fix corrupted image detection.

* Fix corrupted image detection. We were shelling out to vips and trying
  to grep for error messages, but the error message for jpeg files changed.
  Now we load the file in ruby vips, which raises an error on failure.

* Don't attempt to redownload corrupted images. If a download completes
  without any errors yet the downloaded file is corrupt, then something is
  wrong at the source and redownloading is unlikely to help. Let the
  upload fail and the user retry if necessary.

* Validate that all uploads are uncorrupted, including files uploaded
  from a computer, not just files uploaded from a source.
This commit is contained in:
evazion
2020-04-13 14:05:21 -05:00
parent cc31eeafa4
commit dc6575dc76
7 changed files with 48 additions and 56 deletions

BIN
test/files/test-corrupt.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
test/files/test-corrupt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 B