Commit Graph

13 Commits

Author SHA1 Message Date
evazion
a6994cd4d7 media file: fix exception on empty files.
This may happen if a user uploads from a source that returns an error
HTTP response with no data.
2020-06-22 18:49:36 -05:00
evazion
45064853de uploads: move thumbnail generation code to MediaFile.
* Move image thumbnail generation code to MediaFile::Image.
* Move video thumbnail generation code to MediaFile::Video.
* Move ugoira->webm conversion code to MediaFile::Ugoira.

This separates thumbnail generation from the upload process so that it's
possible to generate thumbnails outside of uploads.
2020-05-18 04:19:04 -05:00
evazion
dc6575dc76 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.
2020-04-13 15:30:17 -05:00
Albert Yi
12b88f7f97 fixes #3960 2018-10-17 15:37:47 -07:00
Albert Yi
fdd7582fb0 add support for upload preprocessing 2018-06-14 17:52:41 -07:00
evazion
01eda51020 tests: add webm/mp4 upload tests. 2018-04-06 19:56:17 -05:00
evazion
dc9b7e5bda Fix #3582: Switch from ImageMagick to libvips 2018-03-28 17:15:57 -05:00
Type-kun
9147a1b178 Update APNGInspector class and add tests (fixes #2237) 2016-09-18 14:13:11 +05:00
r888888888
177ef0ebcc fixes #2307 2014-11-19 17:17:26 -08:00
r888888888
b945c757c8 fixes #1905 2013-08-05 15:43:55 -07:00
r888888888
c520c7f03c fixes #1847 2013-07-11 15:50:51 -07:00
albert
fa062caea9 added test for transparent image resizer 2011-09-16 15:25:18 -04:00
albert
39424ca52b added full pending post unit test 2010-02-09 00:44:01 -05:00