Skip to content

Commit

Permalink
Use #image_resize from vectory metanorma/vectory#28
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeymorozov committed Jan 17, 2024
1 parent d4310c4 commit b34aa28
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Encoding.default_internal = Encoding::UTF_8
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}" }

gem "vectory", github: "metanorma/vectory", branch: "image-resize"

gemspec

eval_gemfile("Gemfile.devel") rescue nil
1 change: 1 addition & 0 deletions html2doc.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Gem::Specification.new do |spec|
spec.add_dependency "thread_safe"
spec.add_dependency "uuidtools"
spec.add_dependency "unitsml"
spec.add_dependency "vectory", "~> 0.6"

spec.add_development_dependency "debug"
spec.add_development_dependency "equivalent-xml", "~> 0.6"
Expand Down
5 changes: 3 additions & 2 deletions lib/html2doc/mime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require "mime/types"
require "image_size"
require "fileutils"
require "vectory"

class Html2Doc
def mime_preamble(boundary, filename, result)
Expand Down Expand Up @@ -98,9 +99,9 @@ def image_cleanup(docxml, dir, localdir)
local_filename = rename_image(i, dir, localdir)
i["width"], i["height"] =
if landscape?(i)
Metanorma::Utils.image_resize(i, local_filename, maxwidth, maxheight)
Vectory.image_resize(i, local_filename, maxwidth, maxheight)
else
Metanorma::Utils.image_resize(i, local_filename, maxheight, maxwidth)
Vectory.image_resize(i, local_filename, maxheight, maxwidth)
end
end
docxml
Expand Down

0 comments on commit b34aa28

Please sign in to comment.