From 910f649d70f39c88df3d223384e6b5478b6b76b1 Mon Sep 17 00:00:00 2001 From: Angel Perez Date: Thu, 7 Feb 2019 13:41:39 -0400 Subject: [PATCH] Fix unrecognized image format error when rendering invoice logo 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. --- app/assets/images/logo/solidus_logo.png | Bin 0 -> 3097 bytes app/models/spree/print_invoice_configuration.rb | 3 +-- 2 files changed, 1 insertion(+), 2 deletions(-) create mode 100644 app/assets/images/logo/solidus_logo.png diff --git a/app/assets/images/logo/solidus_logo.png b/app/assets/images/logo/solidus_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..a73a7861a1ad510129374db0170c0d2f57add36b GIT binary patch literal 3097 zcmc&$c{r478=vYZ71hz9(xHhCC1$}4GtH0;8k))4p@=c_Vla!D!JrWdEtX_CZHAd%d3by=+c2k=`P|1q1>~ z*kii1L2nbSx41;Tfbx;sE0;z-2Q3q>^WhhJ+stMD8q0k5|G)xoxbt#Fx zu_!KROPujnUt$TX;myG+i6i|x1sd}^EuHw)SHJP)mT#@Me+4jdM|6bHzj(vH%i?!LnvBJik@Z+>OCuu-zC; zu%Y3Xs(}v@NMtH~O?l`Gia1+;(P6qHetdf`qLZwpBh+{CEmaz^>R~u&lhZ`Yu zVKBroLzFQbhCm)Of+4?QaSXCI4WM(rVJZJ$4StAS8weUx>=_5Js6GJ2n8l!hza);P z{x}w$AM$<0QhpqZ?hmn0aWK%e_Wnn^zp2DCw08VHykg<|_yctD%(KM9jlSuJ2Z7cF znV+yWnxCH^7#JujEcpESvyG)i;_cg^Ar}@G7aQv931)cg5!C4DXnT9x+c$4|dwVCw z#}S&asi`SAMBVPdAwZF}lkROE4EoHvIBkVz3&E^~dnc>(@U z9;YA09Uy%*_oM{xw*N;g$2>_vPdNA7Ye7Rr)Q?8g~C3vljHL8 zvadHMAuje&+JnBnUJOd7r@Q-Ib8}%qer3h0!NEbc7xUTEtgDwV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m8lAN|9eqbve5A`Q|oo+nAxpuQaTS(qkW6^!dF^&B9{xQ3c`~$ zZ~Sie4x}on5U=SoNVyjWUS;1?zVJ!t(Fr-7mT0$AQL95*p~zu<QR*k2;$D>BOiX#d#bmSJee*vi zPo*!Md8V+)yd}d`|II*}rp{L;!3O$8IX6E9A_ zH5kRCp=~-xmcyC{o2_;CKZ#tKHI-2iSlHVJ`1FmvmG_!}#n1V3`mKJx94^QW*juug zkG}j@Hp*$vsc}z)dqu~}=XkeB%QyY`;R}g^sif9>AI(2@Dy?oHp6~D0X9>C zra=6vf?qnHA#izK+p_)k71J(C6P5O9wNCEj)wIf{KI&91ccm4xDhUJm98RgQCTL$- P`&q{u5pkKvoG$zuqW;)a literal 0 HcmV?d00001 diff --git a/app/models/spree/print_invoice_configuration.rb b/app/models/spree/print_invoice_configuration.rb index afd5ebd..454f52b 100644 --- a/app/models/spree/print_invoice_configuration.rb +++ b/app/models/spree/print_invoice_configuration.rb @@ -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' @@ -17,6 +17,5 @@ def increase_invoice_number set_preference(:print_invoice_next_number, current_invoice_number + 1) current_invoice_number end - end end