diff --git a/app/models/billboard.rb b/app/models/billboard.rb index 187f33dd3..7e3c330e2 100644 --- a/app/models/billboard.rb +++ b/app/models/billboard.rb @@ -220,14 +220,14 @@ class Billboard < ApplicationRecord extracted_process_markdown else # raw self.processed_html = Html::Parser.new(body_markdown) - .prefix_all_images(width: 880, quality: 95, synchronous_detail_detection: true).html + .prefix_all_images(width: 880, quality: 100, synchronous_detail_detection: true).html end end def extracted_process_markdown renderer = ContentRenderer.new(body_markdown || "", source: self) self.processed_html = renderer.process(prefix_images_options: { width: prefix_width, - quality: 95, + quality: 100, synchronous_detail_detection: true }).processed_html self.processed_html = processed_html.delete("\n") end diff --git a/spec/models/billboard_spec.rb b/spec/models/billboard_spec.rb index 4be71535d..3d5bb1a19 100644 --- a/spec/models/billboard_spec.rb +++ b/spec/models/billboard_spec.rb @@ -196,7 +196,7 @@ RSpec.describe Billboard do options = { http_header: { "User-Agent" => "DEV(local) (http://forem.test)" }, timeout: 10 } expect(FastImage).to have_received(:size).with(image_url, options) # width is billboard.prefix_width - expect(Images::Optimizer).to have_received(:call).with(image_url, width: Billboard::POST_WIDTH, quality: 95) + expect(Images::Optimizer).to have_received(:call).with(image_url, width: Billboard::POST_WIDTH, quality: 100) # Images::Optimizer.call(source, width: width) end @@ -206,7 +206,7 @@ RSpec.describe Billboard do allow(Images::Optimizer).to receive(:call).and_return(image_url) image_md = "![Image description](#{image_url})

Hello hey Hey hey

" create(:billboard, body_markdown: image_md, placement_area: "post_sidebar") - expect(Images::Optimizer).to have_received(:call).with(image_url, width: Billboard::SIDEBAR_WIDTH, quality: 95) + expect(Images::Optimizer).to have_received(:call).with(image_url, width: Billboard::SIDEBAR_WIDTH, quality: 100) end it "uses post width for feed location" do @@ -215,7 +215,7 @@ RSpec.describe Billboard do allow(Images::Optimizer).to receive(:call).and_return(image_url) image_md = "![Image description](#{image_url})

Hello hey Hey hey

" create(:billboard, body_markdown: image_md, placement_area: "feed_second") - expect(Images::Optimizer).to have_received(:call).with(image_url, width: Billboard::POST_WIDTH, quality: 95) + expect(Images::Optimizer).to have_received(:call).with(image_url, width: Billboard::POST_WIDTH, quality: 100) end it "keeps the same processed_html if markdown was not changed" do