Closed Intelligent2013 closed 2 years ago
I think this may be an image processing problem after the incorporation of pngcheck. Ping @opoudjis .
Some investigation - see https://github.com/metanorma/metanorma-iso/issues/796#issuecomment-1245306704.
The paths in the src
should be relative, not absolute.
(https://github.com/metanorma/metanorma-cli/issues/255)
For instance, in the presentation XML generated on Ubuntu (found in /home/testuser/iso-19135/sources/iso-19135-2021/
), instead of
<image src="/home/testuser/iso-19135/sources/iso-19135-2021/images/lutaml/lutaml20220913-4327-zyjutc.png"
expected:
<image src="./images/lutaml/lutaml20220913-4327-zyjutc.png"
I think I know what happened with images prefix: D:/ not being recognised as an absolute path in metanorma-utils.
It used to, and I have no idea what changed.
What changed is @ronaldtse taking it upon himself to refactor metanorma-utils in https://github.com/metanorma/metanorma-utils/commit/aee97aca2b89e749d5dcc48c421fdb79be7b70ed , and introducing several bugs in the process, including this.
@ronaldtse I have enough to do already without you disrupting functioning code. You also committed that code without giving me the opportunity to review it. This is not acceptable, and I will revert any future commits you make to Metanorma code if you have not first discussed them with me. Only PRs are acceptable.
@opoudjis with latest metanorma-utils commit '3803557a36d3...' I get the error:
Fatal Error: undefined local variable or method `uri' for Metanorma::Utils:Module
warn "Image specified at `#{uri}` does not exist."
^^^
Did you mean? URI
C:/tools/ruby31/lib/ruby/gems/3.1.0/bundler/gems/metanorma-utils-3803557a36d3/lib/utils/image.rb:140:in `datauri1': undefined local variable or method `uri' for Metanorma::Utils:Module (NameError)
warn "Image specified at `#{uri}` does not exist."\r
Did you mean? URI
from C:/tools/ruby31/lib/ruby/gems/3.1.0/bundler/gems/metanorma-utils-3803557a36d3/lib/utils/image.rb:135:in `datauri'
from C:/tools/ruby31/lib/ruby/gems/3.1.0/bundler/gems/metanorma-standoc-35e26a016582/lib/metanorma/standoc/cleanup_image.rb:67:in `block in img_cleanup'
The problem with the latest crash is @opoudjis artificially split a method that is not supposed to be split: https://github.com/metanorma/metanorma-utils/commit/7f20637a2be8853e449aa3703646285584f6b2a5#diff-365195b15b8cb4ad83fe5e25c64e72b0206de119661460ea4a5ad8752e345a5aR138-R142
That these "method splits" should not happen and is representative of poor practice.
That these "method splits" should not happen and is representative of poor practice.
I'm not the one who decided 10 lines per method is good practice.
Hotfix metanorma-utils released, @Intelligent2013
@opoudjis the current behavior you committed does not generate datauri for an absolute file path. See the correct fix at https://github.com/metanorma/metanorma-utils/pull/24 with specs.
Source ticket: https://github.com/metanorma/metanorma-iso/issues/796 I'm trying to generate presentation XML for the document https://github.com/metanorma/iso-19135
bundle exec metanorma -t iso -x presentation document.adoc
ended with createddocument.xml.abort
and error:The file
D:/Work/Metanorma/repositories/iso-19135/sources/iso-19135-2021/images/lutaml/lutaml20220913-7144-9w030j.png
physically is present on the disk, but there is a strange prefiximages/
beforeD:/Work
.It seems this issue occurs on Win platform only: https://github.com/metanorma/iso-19135/actions/runs/3040514350/jobs/4896647319