media assets: track corrupted files in media metadata.
If a media asset is corrupt, include the error message from libvips or ffmpeg in the "Vips:Error" or "FFmpeg:Error" fields in the media metadata table. Corrupt files can't be uploaded nowadays, but they could be in the past, so we have some old corrupted files that we can't generate thumbnails for. This lets us mark these files in the metadata so they're findable with the tag search `exif:Vips:Error`. Known bug: Vips has a single global error buffer that is shared between threads and that isn't cleared between operations. So we can't reliably get the actual error message because it may pick up errors from other threads, or from previous operations in the same thread.
This commit is contained in:
@@ -89,7 +89,7 @@ class MediaAsset < ApplicationRecord
|
||||
def open_file!(&block)
|
||||
file = storage_service.open(file_path)
|
||||
frame_delays = media_asset.frame_delays if media_asset.is_ugoira?
|
||||
MediaFile.open(file, frame_delays: frame_delays, strict: false, &block)
|
||||
MediaFile.open(file, frame_delays: frame_delays, &block)
|
||||
end
|
||||
|
||||
def convert_file(media_file)
|
||||
|
||||
Reference in New Issue
Block a user