2
1
Fork
You've already forked phomemo-printer
0

Image cut off at bottom #4

Open
opened 2025年07月15日 18:15:14 +02:00 by mindthump · 3 comments
mindthump commented 2025年07月15日 18:15:14 +02:00 (Migrated from git.brainbaking.com)
Copy link

I was able to print JPGs when I adjusted the code as per Issue 2, but I find that the image gets cut off at the bottom. While I can pad the image as a workaround, it would be good to get the whole thing. I suspect this might be a PIL problem.
I understand you (wgroeneveld) don't have the bandwidth to work on this, but perhaps someone has solved the problem... Thanks to all involved!

I was able to print JPGs when I adjusted the code as per Issue 2, but I find that the image gets cut off at the bottom. While I can pad the image as a workaround, it would be good to get the whole thing. I suspect this might be a PIL problem. I understand you (wgroeneveld) don't have the bandwidth to work on this, but perhaps someone has solved the problem... Thanks to all involved!

Hi,
I faced the same issue. It's most likely the Python filter not running.
L160 of main.go is a problem as it swallows stderr.
Replaced it with

cmd := exec.Command("/bin/zsh", argstr...)
	output, err := cmd.CombinedOutput()
	if err != nil {
		log.Printf("Python filter error: %s", string(output))
	}

You'll know exactly why the Python command doesn't run.
In my case (MacOS), I passed a few more Python fallback paths in ENV and it works

PATH: "/usr/local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/bin",
PYTHON: "/usr/local/bin/python",
PYTHONPATH: "/opt/homebrew/lib/python3.13/site-packages"
Hi, I faced the same issue. It's most likely the Python filter not running. L160 of `main.go` is a problem as it swallows stderr. Replaced it with ``` cmd := exec.Command("/bin/zsh", argstr...) output, err := cmd.CombinedOutput() if err != nil { log.Printf("Python filter error: %s", string(output)) } ``` You'll know exactly why the Python command doesn't run. In my case (MacOS), I passed a few more Python fallback paths in ENV and it works ``` PATH: "/usr/local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/bin", PYTHON: "/usr/local/bin/python", PYTHONPATH: "/opt/homebrew/lib/python3.13/site-packages" ```

Thank you @truthmonger I expanded the error printing like you suggested.
Last week I also updated the way the Python script is called by first looking for the binary so that might also help: see #2

Cheers!
Doubt it that this fixes the issue of the cut off images though.

Thank you @truthmonger I expanded the error printing like you suggested. Last week I also updated the way the Python script is called by first looking for the binary so that might also help: see https://codeberg.org/wouterg/phomemo-printer/issues/2 Cheers! Doubt it that this fixes the issue of the cut off images though.

Thank you! It worked for me, after struggling a bit the path update solved it. Also, I make sure to send 9:16 aspect ratio images (I'm using the M02)

Thank you! It worked for me, after struggling a bit the path update solved it. Also, I make sure to send 9:16 aspect ratio images (I'm using the M02)
Sign in to join this conversation.
No Branch/Tag specified
main
No results found.
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
wouterg/phomemo-printer#4
Reference in a new issue
wouterg/phomemo-printer
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?