fix(image processing): process only authorized image and pdf types
This commit is contained in:
parent
e6845cd94d
commit
4dc13cc56c
2 changed files with 4 additions and 1 deletions
|
@ -20,6 +20,7 @@ module AttachmentImageProcessorConcern
|
|||
return if blob.nil?
|
||||
return if blob.attachments.size != 1
|
||||
return if blob.attachments.last.record_type == "Export"
|
||||
return if !blob.content_type.in?(PROCESSABLE_TYPES)
|
||||
|
||||
ImageProcessorJob.perform_later(blob)
|
||||
end
|
||||
|
|
|
@ -21,7 +21,9 @@ RARE_IMAGE_TYPES = [
|
|||
'image/tiff' # multimedia x 3985
|
||||
]
|
||||
|
||||
AUTHORIZED_CONTENT_TYPES = AUTHORIZED_IMAGE_TYPES + AUTHORIZED_PDF_TYPES + [
|
||||
PROCESSABLE_TYPES = AUTHORIZED_IMAGE_TYPES + AUTHORIZED_PDF_TYPES
|
||||
|
||||
AUTHORIZED_CONTENT_TYPES = PROCESSABLE_TYPES + [
|
||||
# multimedia
|
||||
'video/mp4', # multimedia x 2075
|
||||
'video/quicktime', # multimedia x 486
|
||||
|
|
Loading…
Reference in a new issue