Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--crop not working as expected on latest versions #1759

Closed
2 tasks done
rosseljost opened this issue May 29, 2024 · 10 comments
Closed
2 tasks done

--crop not working as expected on latest versions #1759

rosseljost opened this issue May 29, 2024 · 10 comments

Comments

@rosseljost
Copy link

Preflight Checklist

You must agree to search and the code of conduct. You must fill in this entire template. If you delete part/all or miss parts out your issue will be closed.

Describe the bug
The --crop parameter does not actually crop the image to the smallest dimensions, depending on the version.
I noticed the bug in 24.4.8 and a different wrong behavior in 24.4.0, 24.2.5 works as expected.

  • 24.4.0 seems to use the page size from the drawio file
  • 24.4.8 looks like an A4/letter page

To Reproduce
Steps to reproduce the behavior:

  1. Export confidentiality.drawio (not actually an SVG, just renamed the .drawio XML file so that I can upload it) using
    drawio -x -e -o "confidentiality.pdf" -f pdf --crop -t "confidentiality.drawio"
    
  2. Compare the resulting PDF on different version.

Expected behavior
The behavior from 24.2.5

Screenshots
My results:

  1. confidentiality_24.2.5.pdf
  2. confidentiality_24.4.0.pdf
  3. confidentiality_24.4.8.pdf

draw.io version (In the Help->About menu of the draw.io editor):

  • at least draw.io version 24.4.0 and 24.4.8, but possibly more

Desktop (please complete the following information):

@alderg
Copy link
Contributor

alderg commented May 29, 2024

I checked your test case on v24.4.8 with macOS and Windows and those are working. Are you sure you are using v24.4.8? (Check with draw.io --version)

@XoMEX
Copy link

XoMEX commented May 29, 2024

Can reproduce on Arch (https://aur.archlinux.org/packages/drawio-desktop version 24.4.8-2; drawio --version reports it as 24.4.8)

@rosseljost
Copy link
Author

this is what I did to get the files in the original issue:

drawio -x -e -o "confidentiality_$(drawio -V).pdf" -f pdf --crop -t "confidentiality.drawio"

while switching between cached (i.e. previously built) versions of drawio using my package manager.

I just asked a colleague of mine to run that command. He could not reproduce on NixOS using version 24.4.0

@davidjgraph
Copy link
Contributor

I cannot repeat on the .deb build on an ubuntu flavour. The question is whether the problem is with arch linux specifically, or with the arch linux build.

But given none of us run arch linux and we have never had anything to do with the arch linux build, I think this would be better directed at whoever authors the arch build.

@davidjgraph davidjgraph closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2024
@dvalter
Copy link
Contributor

dvalter commented May 29, 2024

@davidjgraph I was able to reproduce this by running on v24.4.8

yarn install
yarn run sync
yarn run release-linux

After unpacking from release .deb and from dist/linux-unpacked/resources/, the only substantial difference is drawio/src/main/webapp/js/app.min.js.

Looks like it has not been updated in open source drawio since v24.3.1 and this it what makes source-based builds broken.

@davidjgraph
Copy link
Contributor

https://github.com/jgraph/drawio-desktop shows the correct submodule. Are you sure submodules are being recursively pulled on updates?

@davidjgraph
Copy link
Contributor

OK, no, you're right. There's an update problem with that file. Amazing nobody else noticed :D.

@dvalter
Copy link
Contributor

dvalter commented May 29, 2024

They are. However that won't help without rebuilding app.min.js from up-to-date source.

I've added ant app to the AUR PKGBUILD and it has seemingly fixed the issue.

As for your packages, Github CI workflows use the private drawio-dev rather than the public drawio repo, and it likely makes all the difference.

@davidjgraph
Copy link
Contributor

OK, thanks for the investgations, we'll get the public repo fixed.

@davidjgraph
Copy link
Contributor

OK, deploy process fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants