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

getMaxImageWidth() isn't respected #639

Closed
szotsaki opened this Issue Jul 21, 2017 · 9 comments

Comments

Projects
None yet
2 participants
@szotsaki

szotsaki commented Jul 21, 2017

I have many wide images in notebooks and when I export to PDF or preview in the preview pane, many of them overflows and a horizontal scrollbar appears:

image

The text breaks into new lines as it should do.

As I saw, the maximum image width is calculated here: https://github.com/pbek/QOwnNotes/blob/develop/src/mainwindow.cpp#L3500

@pbek

This comment has been minimized.

Owner

pbek commented Jul 21, 2017

Can you please explain in more detail and step by step what you did, what happened and what you expected.

@szotsaki

This comment has been minimized.

szotsaki commented Jul 21, 2017

  1. Create a new note and turn on note preview tab.
  2. With a screen capture tool (on Linux Spectacle, on Windows Snipping Tool is good) and grab your entire screen to clipboard.
  3. Paste it into QOwnNotes.

In the preview pane you see that, after inserting the image, the horizontal scrollbar appears and a really wide image got inserted. This is bad because

  • when you read the note on screen half of the image is missing,
  • when you export it to PDF, besides you cannot see the whole image, you cannot scroll right.

As I saw, there is a getMaxImageWidth() function at the above mentioned line, about which I thought that it should shrink the image to right size when previewing or exporting (but not on the disk, permanently).

So, currently there's scrollbar for wide images and the optimal solution would be to shrink the image width to the display area (both in the preview pane and at PDF export time).

@pbek

This comment has been minimized.

Owner

pbek commented Jul 21, 2017

I'm sorry, I just did what you said and the image-width was adapted in the preview to fit it.

@pbek

This comment has been minimized.

Owner

pbek commented Jul 21, 2017

What happens if you resize the preview panel after the note was loaded?

@pbek pbek added this to the 17.07.6 milestone Jul 22, 2017

@pbek

This comment has been minimized.

Owner

pbek commented Jul 22, 2017

I think I found it, do you care to test the latest develop branch or wait until https://ci.appveyor.com/project/pbek/qownnotes/build/windows-b3108/artifacts is prepared and test that?

17.07.6

  • fixed resizing of too large images under Windows in the preview and the
    PDF export
@pbek

This comment has been minimized.

Owner

pbek commented Jul 23, 2017

There now is a new release, could you please test it and report if it works for you?

@szotsaki

This comment has been minimized.

szotsaki commented Jul 24, 2017

Thank you, it's much better now!

  • In the preview plane (I tested now on Windows, but I'll take a test on Linux in two days) it works perfectly.

  • In PDF export, it's definitely better but the page margins are not calculated into image widths, so sometimes images overflow, like this:

    image

    (the gray bar indicates the page right edge and the text margin is where all the text ends above)

@pbek

This comment has been minimized.

Owner

pbek commented Jul 24, 2017

I'll see if we can check the page margins.

@pbek

This comment has been minimized.

Owner

pbek commented Jul 26, 2017

I'm sorry, this is all done automatically by Qt and I haven't found a way to fiddle with it without damaging it any more. If you want to play around with it, you'll find the code in MainWindow::exportNoteAsPDF.

@pbek pbek closed this Jul 26, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment