Skip to content

Commit

Permalink
♻️ fix typos & bump minimagick (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianMindee authored Oct 29, 2024
1 parent 1660d46 commit 92a4881
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/mindee/image/image_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def self.resize_image(image, width, height)

# Compresses the quality of the provided MiniMagick image.
# @param image [MiniMagick::Image] MiniMagick image handle.
# @param quality [Integer] Quality to apply to the image. This is independent from a JPG's base quality.
# @param quality [Integer] Quality to apply to the image. This is independent of a JPG's base quality.
def self.compress_image_quality(image, quality)
image.quality quality.to_s
end
Expand Down
2 changes: 1 addition & 1 deletion lib/mindee/pdf/pdf_tools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def self.stream_has_text?(stream)
data = stream.data
return false if data.nil? || data.empty?

text_operators = ['Tc', 'Tw', 'Th', 'TL', 'Tf', 'Tfs', 'Tk', 'Tr', 'Tm', 'T*', 'Tj', 'TJ', "'", '"']
text_operators = ['Tc', 'Tw', 'Th', 'TL', 'Tf', 'Tk', 'Tr', 'Tm', 'T*', 'Tj', 'TJ', "'", '"']
text_operators.any? { |op| data.include?(op) }
end

Expand Down
2 changes: 1 addition & 1 deletion mindee.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
spec.required_ruby_version = Gem::Requirement.new('>= 2.6')

spec.add_runtime_dependency 'marcel', '~> 1.0.2'
spec.add_runtime_dependency 'mini_magick', '~> 4.13.0'
spec.add_runtime_dependency 'mini_magick', '>=4', '< 6'
spec.add_runtime_dependency 'origamindee', '~> 3.1.0'
spec.add_runtime_dependency 'pdf-reader', '~> 2.12.0'

Expand Down
5 changes: 3 additions & 2 deletions spec/input/sources_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@

output_files = [
"#{output_dir}/compress100.jpg",
"#{output_dir}/compress75.jpg",
"#{output_dir}/compress85.jpg",
"#{output_dir}/compress50.jpg",
"#{output_dir}/compress10.jpg",
"#{output_dir}/compress1.jpg",
Expand All @@ -144,7 +144,7 @@

after(:each) do
FileUtils.rm_f("#{output_dir}/compress100.jpg")
FileUtils.rm_f("#{output_dir}/compress75.jpg")
FileUtils.rm_f("#{output_dir}/compress85.jpg")
FileUtils.rm_f("#{output_dir}/compress50.jpg")
FileUtils.rm_f("#{output_dir}/compress10.jpg")
FileUtils.rm_f("#{output_dir}/compress1.jpg")
Expand Down Expand Up @@ -210,6 +210,7 @@
FileUtils.rm_f("#{output_dir}/compress_indirect.pdf")
end
end

describe 'source text PDF compression' do
it 'should compress if forced' do
input_file_path = "#{DATA_DIR}/file_types/pdf/multipage.pdf"
Expand Down

0 comments on commit 92a4881

Please sign in to comment.