Skip to content

Commit

Permalink
Fix unrecognized image format error when rendering invoice logo
Browse files Browse the repository at this point in the history
solidusio/solidus#2995 replaced Solidus' .png logo with a .svg version,
a format that Prawn does not support. This patch re-introduces the former
logo and uses it if no custom configuration is provided.
  • Loading branch information
aitbw committed Feb 7, 2019
1 parent 1204e9a commit 910f649
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Binary file added app/assets/images/logo/solidus_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions app/models/spree/print_invoice_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Spree
class PrintInvoiceConfiguration < Preferences::Configuration

preference :print_invoice_next_number, :integer, :default => nil
preference :print_invoice_logo_path, :string, :default => Spree::Config[:admin_interface_logo]
preference :print_invoice_logo_path, :string, :default => Spree::Config[:admin_interface_logo].end_with?('.svg') ? 'logo/solidus_logo.png' : Spree::Config[:admin_interface_logo]
preference :print_invoice_logo_scale, :integer, :default => 50
preference :print_invoice_font_face, :string, :default => 'Helvetica'
preference :print_buttons, :string, :default => 'invoice'
Expand All @@ -17,6 +17,5 @@ def increase_invoice_number
set_preference(:print_invoice_next_number, current_invoice_number + 1)
current_invoice_number
end

end
end

0 comments on commit 910f649

Please sign in to comment.