Skip to content

Commit

Permalink
debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
toy committed May 10, 2024
1 parent b476b0d commit 7e14fcd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
gem install bundler || gem install bundler --version '< 2.4'
bundle install
- run: bundle exec bin/image_optim --info
- run: bundle exec rspec
- run: bundle exec rspec --example jhead
# windows:
# runs-on: windows-latest
# strategy:
Expand Down
2 changes: 1 addition & 1 deletion lib/image_optim/worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def run_command(cmd_args, options)
{'PATH' => @image_optim.env_path},
*%W[nice -n #{@image_optim.nice}],
*cmd_args,
options.merge(out: Path::NULL, err: Path::NULL),
options,
]
Cmd.run(*args)
end
Expand Down
3 changes: 3 additions & 0 deletions lib/image_optim/worker/jhead.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def optimize(src, dst, options = {})

def oriented?(image)
exif = EXIFR::JPEG.new(image.to_s)
p exif
p exif.orientation
p exif.orientation.to_i
ORIENTED.include?(exif.orientation.to_i)
end
end
Expand Down
3 changes: 2 additions & 1 deletion spec/image_optim_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ def temp_copy(image)
ImageOptim::Worker.klasses.each do |worker_klass|
describe "#{worker_klass.bin_sym} worker" do
it 'optimizes at least one test image' do
options = isolated_options_base.merge(worker_klass.bin_sym => true)
options = isolated_options_base.merge(worker_klass.bin_sym => true, verbose: true)

image_optim = ImageOptim.new(options)
if Array(worker_klass.init(image_optim)).empty?
image_optim = ImageOptim.new(options.merge(allow_lossy: true))
end

expect(test_images.any? do |original|
puts "#{'#' * 10} #{original}"
image_optim.optimize_image(temp_copy(original))
end).to be true
end
Expand Down

0 comments on commit 7e14fcd

Please sign in to comment.