diff --git a/app/controllers/packages_controller.rb b/app/controllers/packages_controller.rb index e461fd0..2d29940 100644 --- a/app/controllers/packages_controller.rb +++ b/app/controllers/packages_controller.rb @@ -296,15 +296,21 @@ class PackagesController < ApplicationController end # Return a 404 if the package has no screenshots or the image was not found - unless @image + if @image + send_file(File.join(@image.simage.storage.directory, @image.simage(size).id), + disposition: 'inline') + else Rails.logger.debug 'no such image -> 404' - screenshot404 if %i[large small].include?(size) - thumbnail404 if size == :thumb - return + case size + when :large + screenshot404 + when :small + screenshot404 + when :thumb + Rails.logger.debug 'thumb404' + thumbnail404 + end end - - send_file(File.join(@image.simage.storage.directory, @image.simage(size).id), - disposition: 'inline') end # Receives a form with a simple text field 'description' so that users can update