-
Notifications
You must be signed in to change notification settings - Fork 380
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
max_width / max_heigth only affects image preview but not pdf preview #1197
Comments
Please follow https://yazi-rs.github.io/docs/image-preview#debug-ueberzug to upload these logs |
yazi log 2024-06-24T01:08:56.967402Z WARN yazi_adapter::emulator: [Adapter] No special environment variables detected
at yazi-adapter/src/emulator.rs:70
2024-06-24T01:08:56.967429Z WARN yazi_adapter::emulator: [Adapter] Unknown TERM_PROGRAM:
at yazi-adapter/src/emulator.rs:84
2024-06-24T01:08:56.967431Z WARN yazi_adapter::emulator: [Adapter] Unknown TERM: alacritty
at yazi-adapter/src/emulator.rs:92
2024-06-24T01:08:56.967658Z WARN yazi_adapter::adapter: [Adapter] Could not identify XDG_SESSION_TYPE
at yazi-adapter/src/adapter.rs:101
2024-06-24T01:08:57.049105Z ERROR yazi_scheduler::preload::prework: Preload task `image` returned 2
at yazi-scheduler/src/preload/prework.rs:62
2024-06-24T01:08:57.049409Z ERROR yazi_scheduler::preload::prework: Preload task `image` returned 2
at yazi-scheduler/src/preload/prework.rs:62
2024-06-24T01:08:57.052734Z ERROR yazi_scheduler::preload::prework: Preload task `magick` returned 2
at yazi-scheduler/src/preload/prework.rs:62 Ueberzug++ log _ _ _
| | | | | | _ _
| | | | ___| |__ ___ _ __ _____ _ __ _ _| |_ _| |_
| | | |/ _ \ '_ \ / _ \ '__|_ / | | |/ _` |_ _|_ _|
| |_| | __/ |_) | __/ | / /| |_| | (_| | |_| |_|
\___/ \___|_.__/ \___|_| /___|\__,_|\__, |
__/ |
|___/ v2.9.6
[2024-06-23 22:08:57.037] [terminal] [info] TERM = alacritty
[2024-06-23 22:08:57.038] [terminal] [info] PTY = /dev/pts/1
[2024-06-23 22:08:57.038] [X11] [info] Canvas created
[2024-06-23 22:08:57.038] [main] [info] Listening for commands on socket /tmp/ueberzugpp-475661.socket
[2024-06-23 22:08:57.073] [main] [info] Command received: {"action":"add","identifier":"yazi","max_height":158,"max_width":330,"path":"/tmp/yazi/c88082833bbe31760b746a683471b9e8","x":160,"y":1}
[2024-06-23 22:08:57.103] [opencv] [info] loading file /tmp/yazi/c88082833bbe31760b746a683471b9e8
[2024-06-23 22:08:58.440] [main] [info] Exiting ueberzugpp |
Those are fresh logs with no config, opening yazi right on the pdf that caused the problem. As you can see max_width is send as 330. That same command breaks Ueberzug (A Black frame is render that wont leave until the process is stoped), but changing max_width to 200 fixes it. The problem is that changing the max_width in yazi.toml only affects images, not pdf preview. So the only way I have to shrink the preview to fix it is to change Ueberzug scale. |
I don't see any Ueberzug commands in yazi.log. Are you in debug mode? |
And also upload a gif of the steps of https://yazi-rs.github.io/docs/image-preview#debug-ueberzug and your /tmp/yazi/c88082833bbe31760b746a683471b9e8 file |
Oh, I'm sorry I'll re try in debug mode. |
Yep, I want to see your terminal size and the relative position of ueberzug |
max_width 200 makes Ueberzug not crash but it still looks wrong. |
Run tput cols and tput lines Paste the output here |
yazi log �[2m2024-06-24T01:37:18.970112Z�[0m �[33m WARN�[0m �[1;33myazi_adapter::emulator�[0m�[33m: �[33m[Adapter] No special environment variables detected�[0m
�[2;3mat�[0m yazi-adapter/src/emulator.rs:70
�[2m2024-06-24T01:37:18.970178Z�[0m �[33m WARN�[0m �[1;33myazi_adapter::emulator�[0m�[33m: �[33m[Adapter] Unknown TERM_PROGRAM: �[0m
�[2;3mat�[0m yazi-adapter/src/emulator.rs:84
�[2m2024-06-24T01:37:18.970190Z�[0m �[33m WARN�[0m �[1;33myazi_adapter::emulator�[0m�[33m: �[33m[Adapter] Unknown TERM: alacritty�[0m
�[2;3mat�[0m yazi-adapter/src/emulator.rs:92
�[2m2024-06-24T01:37:18.970503Z�[0m �[33m WARN�[0m �[1;33myazi_adapter::adapter�[0m�[33m: �[33m[Adapter] Could not identify XDG_SESSION_TYPE�[0m
�[2;3mat�[0m yazi-adapter/src/adapter.rs:101
�[2m2024-06-24T01:37:19.039314Z�[0m �[34mDEBUG�[0m �[1;34myazi_adapter::ueberzug�[0m�[34m: �[34mueberzugpp rect before adjustment: Rect { x: 160, y: 1, width: 330, height: 158 }�[0m
�[2;3mat�[0m yazi-adapter/src/ueberzug.rs:99
�[2m2024-06-24T01:37:19.039411Z�[0m �[34mDEBUG�[0m �[1;34myazi_adapter::ueberzug�[0m�[34m: �[34mueberzugpp rect after adjustment: Rect { x: 160, y: 1, width: 330, height: 158 }�[0m
�[2;3mat�[0m yazi-adapter/src/ueberzug.rs:101
�[2m2024-06-24T01:37:19.039457Z�[0m �[34mDEBUG�[0m �[1;34myazi_adapter::ueberzug�[0m�[34m: �[34mueberzugpp command: {"action":"add","identifier":"yazi","x":160,"y":1,"max_width":330,"max_height":158,"path":"/tmp/yazi/c88082833bbe31760b746a683471b9e8"}
�[0m
�[2;3mat�[0m yazi-adapter/src/ueberzug.rs:112
�[2m2024-06-24T01:37:19.131967Z�[0m �[31mERROR�[0m �[1;31myazi_scheduler::preload::prework�[0m�[31m: �[31mPreload task `image` returned 2�[0m
�[2;3mat�[0m yazi-scheduler/src/preload/prework.rs:62
�[2m2024-06-24T01:37:19.132269Z�[0m �[31mERROR�[0m �[1;31myazi_scheduler::preload::prework�[0m�[31m: �[31mPreload task `image` returned 2�[0m
�[2;3mat�[0m yazi-scheduler/src/preload/prework.rs:62
�[2m2024-06-24T01:37:19.144645Z�[0m �[31mERROR�[0m �[1;31myazi_scheduler::preload::prework�[0m�[31m: �[31mPreload task `magick` returned 2�[0m
�[2;3mat�[0m yazi-scheduler/src/preload/prework.rs:62 Ueberzug++ log _ _ _
| | | | | | _ _
| | | | ___| |__ ___ _ __ _____ _ __ _ _| |_ _| |_
| | | |/ _ \ '_ \ / _ \ '__|_ / | | |/ _` |_ _|_ _|
| |_| | __/ |_) | __/ | / /| |_| | (_| | |_| |_|
\___/ \___|_.__/ \___|_| /___|\__,_|\__, |
__/ |
|___/ v2.9.6
[2024-06-23 22:37:19.037] [terminal] [info] TERM = alacritty
[2024-06-23 22:37:19.038] [terminal] [info] PTY = /dev/pts/1
[2024-06-23 22:37:19.038] [terminal] [debug] ioctl sizes: COLS=254 ROWS=66 XPIXEL=2540 YPIXEL=1386
[2024-06-23 22:37:19.038] [terminal] [debug] iterm2 is not supported
[2024-06-23 22:37:19.038] [terminal] [debug] X11 is supported
[2024-06-23 22:37:19.038] [terminal] [debug] Using fallback X11 window id 12582915
[2024-06-23 22:37:19.038] [terminal] [debug] X11 sizes: XPIXEL=2544 YPIXEL=1400
[2024-06-23 22:37:19.038] [terminal] [debug] padding_horiz=2 padding_vert=7
[2024-06-23 22:37:19.038] [terminal] [debug] font_width=10 font_height=21
[2024-06-23 22:37:19.038] [main] [debug] Wayland support not compiled in the binary
[2024-06-23 22:37:19.038] [X11] [info] Canvas created
[2024-06-23 22:37:19.038] [main] [info] Listening for commands on socket /tmp/ueberzugpp-506043.socket
[2024-06-23 22:37:19.073] [main] [info] Command received: {"action":"add","identifier":"yazi","max_height":158,"max_width":330,"path":"/tmp/yazi/c88082833bbe31760b746a683471b9e8","x":160,"y":1}
[2024-06-23 22:37:19.106] [opencv] [info] loading file /tmp/yazi/c88082833bbe31760b746a683471b9e8
[2024-06-23 22:37:19.145] [X11] [debug] Initializing canvas
[2024-06-23 22:37:19.145] [X11] [debug] Created child window 48234496 at (1602,28) with parent 12582915
[2024-06-23 22:37:19.146] [X11] [debug] Received expose event for window 48234496
[2024-06-23 22:37:21.245] [main] [info] Exiting ueberzugpp |
yazi.log with max_width = 200 �[2m2024-06-24T01:42:20.542716Z�[0m �[33m WARN�[0m �[1;33myazi_adapter::emulator�[0m�[33m: �[33m[Adapter] No special environment variables detected�[0m
�[2;3mat�[0m yazi-adapter/src/emulator.rs:70
�[2m2024-06-24T01:42:20.542778Z�[0m �[33m WARN�[0m �[1;33myazi_adapter::emulator�[0m�[33m: �[33m[Adapter] Unknown TERM_PROGRAM: �[0m
�[2;3mat�[0m yazi-adapter/src/emulator.rs:84
�[2m2024-06-24T01:42:20.542790Z�[0m �[33m WARN�[0m �[1;33myazi_adapter::emulator�[0m�[33m: �[33m[Adapter] Unknown TERM: alacritty�[0m
�[2;3mat�[0m yazi-adapter/src/emulator.rs:92
�[2m2024-06-24T01:42:20.543167Z�[0m �[33m WARN�[0m �[1;33myazi_adapter::adapter�[0m�[33m: �[33m[Adapter] Could not identify XDG_SESSION_TYPE�[0m
�[2;3mat�[0m yazi-adapter/src/adapter.rs:101
�[2m2024-06-24T01:42:20.611086Z�[0m �[34mDEBUG�[0m �[1;34myazi_adapter::ueberzug�[0m�[34m: �[34mueberzugpp rect before adjustment: Rect { x: 160, y: 1, width: 330, height: 158 }�[0m
�[2;3mat�[0m yazi-adapter/src/ueberzug.rs:99
�[2m2024-06-24T01:42:20.611206Z�[0m �[34mDEBUG�[0m �[1;34myazi_adapter::ueberzug�[0m�[34m: �[34mueberzugpp rect after adjustment: Rect { x: 160, y: 1, width: 330, height: 158 }�[0m
�[2;3mat�[0m yazi-adapter/src/ueberzug.rs:101
�[2m2024-06-24T01:42:20.611237Z�[0m �[34mDEBUG�[0m �[1;34myazi_adapter::ueberzug�[0m�[34m: �[34mueberzugpp command: {"action":"add","identifier":"yazi","x":160,"y":1,"max_width":330,"max_height":158,"path":"/tmp/yazi/c88082833bbe31760b746a683471b9e8"}
�[0m
�[2;3mat�[0m yazi-adapter/src/ueberzug.rs:112
�[2m2024-06-24T01:42:20.717324Z�[0m �[31mERROR�[0m �[1;31myazi_scheduler::preload::prework�[0m�[31m: �[31mPreload task `image` returned 2�[0m
�[2;3mat�[0m yazi-scheduler/src/preload/prework.rs:62
�[2m2024-06-24T01:42:20.718068Z�[0m �[31mERROR�[0m �[1;31myazi_scheduler::preload::prework�[0m�[31m: �[31mPreload task `image` returned 2�[0m
�[2;3mat�[0m yazi-scheduler/src/preload/prework.rs:62
�[2m2024-06-24T01:42:20.726162Z�[0m �[31mERROR�[0m �[1;31myazi_scheduler::preload::prework�[0m�[31m: �[31mPreload task `magick` returned 2�[0m
�[2;3mat�[0m yazi-scheduler/src/preload/prework.rs:62 ueberzug.log _ _ _
| | | | | | _ _
| | | | ___| |__ ___ _ __ _____ _ __ _ _| |_ _| |_
| | | |/ _ \ '_ \ / _ \ '__|_ / | | |/ _` |_ _|_ _|
| |_| | __/ |_) | __/ | / /| |_| | (_| | |_| |_|
\___/ \___|_.__/ \___|_| /___|\__,_|\__, |
__/ |
|___/ v2.9.6
[2024-06-23 22:42:20.610] [terminal] [info] TERM = alacritty
[2024-06-23 22:42:20.610] [terminal] [info] PTY = /dev/pts/1
[2024-06-23 22:42:20.610] [terminal] [debug] ioctl sizes: COLS=254 ROWS=66 XPIXEL=2540 YPIXEL=1386
[2024-06-23 22:42:20.610] [terminal] [debug] iterm2 is not supported
[2024-06-23 22:42:20.610] [terminal] [debug] X11 is supported
[2024-06-23 22:42:20.610] [terminal] [debug] Using fallback X11 window id 12582915
[2024-06-23 22:42:20.610] [terminal] [debug] X11 sizes: XPIXEL=2544 YPIXEL=1400
[2024-06-23 22:42:20.611] [terminal] [debug] padding_horiz=2 padding_vert=7
[2024-06-23 22:42:20.611] [terminal] [debug] font_width=10 font_height=21
[2024-06-23 22:42:20.611] [main] [debug] Wayland support not compiled in the binary
[2024-06-23 22:42:20.611] [X11] [info] Canvas created
[2024-06-23 22:42:20.611] [main] [info] Listening for commands on socket /tmp/ueberzugpp-509715.socket
[2024-06-23 22:42:20.641] [main] [info] Command received: {"action":"add","identifier":"yazi","max_height":158,"max_width":330,"path":"/tmp/yazi/c88082833bbe31760b746a683471b9e8","x":160,"y":1}
[2024-06-23 22:42:20.672] [opencv] [info] loading file /tmp/yazi/c88082833bbe31760b746a683471b9e8
[2024-06-23 22:42:20.707] [X11] [debug] Initializing canvas
[2024-06-23 22:42:20.707] [X11] [debug] Created child window 56623104 at (1602,28) with parent 12582915
[2024-06-23 22:42:20.708] [X11] [debug] Received expose event for window 56623104
[2024-06-23 22:42:21.712] [main] [info] Exiting ueberzugpp |
tput cols => 254 |
Thanks for the info, I'll make a patch later to try and fix it |
Ok, great. Thanks for the impressively fast responses. |
Should be fixed in #1200, please give it a try to see if it works for you! |
Yes, it is fixed. Thanks for the help. |
I'm going to lock this issue because it has been closed for 30 days. ⏳ |
What system are you running Yazi on?
Linux X11
What terminal are you running Yazi in?
Alacritty
Did you try the latest code to see if this problem got fixed?
Tried, but the problem still
yazi --debug
outputDescribe the bug
I have 1 pdf file that breaks Ueberzug++ when max_width > 200, but for it to fit properly in yazi it needs have max_width = 95.
So I edited mi yazi.toml and set max_width = 200, ran yazi --clear-cache and the error persited. After checking the Ueberzug log I found that the command was still using max_width = 330. I kept reducing max_width with no luck until I max_width =2 with no effect, then I realized that images where scalled down, but pdf preview wasn't. Using ueberzug scale fixes the issue, but I need to set a global 0.6 scalling when most content looked perfect before.
Expected Behavior
I would expect max_width to limit all previewed content's width, not just images.
To Reproduce
I guess the best I can do is to send the pdf that causes the problem.
Beginner's Guide To 3D Art Assets - Buildings.pdf
Configuration
no config
Anything else?
The pdf I attached is the main problem because it brakes Ueberzug, wich I understand isn't a concern here.
But almost all pdfs are out of scale and look wrong on preview and the only solution that works is global scaling.
It would be nice to be able to set the maximum width so that it would make all previews fit the preview panel.
The text was updated successfully, but these errors were encountered: