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

Window cropping is off on OS X #39

Open
raine opened this issue Sep 19, 2015 · 4 comments
Open

Window cropping is off on OS X #39

raine opened this issue Sep 19, 2015 · 4 comments

Comments

@raine
Copy link

raine commented Sep 19, 2015

Example frame:

terminal

Perhaps has something to do with having a retina display?

@icholy
Copy link
Owner

icholy commented Dec 1, 2015

Hey, the osx stuff was contributed. But I'm guessing it has something to do with this line

if (sprintf(cmd, "convert %05d_%d.png -background white -quiet -flatten +matte -crop +0+22 -crop +4+0 -crop -4-0 +repage %05d_%d.png", index, delay, index, delay) < 0) {

@DiegoRBaquero
Copy link

Yes, it has to do with retina (2x pixels). Run the recording in a non-retina display.

@icholy icholy added the bug label Jul 7, 2017
@icholy icholy added the osx label Sep 8, 2017
@mscottnelson
Copy link

mscottnelson commented Apr 9, 2020

Also an issue when using eg iTerm2 where the crop size does not match Apple window frame anyway. And, further, if the terminal session exists within a window that contains more than just the single session (for example, a multi-tab session), then the cropping will also fail.

To fix properly, will probably need to make the crop dimensions of the line mentioned by @icholy dependent on the amount of visible characters. This will be terminal emulator specific. Could grab total window height with something like osascript -so -e 'tell app \"%s\" to bounds of current window' | awk 'print {$4-$2}' and compare with number of visible rows for the session, eg tput lines, tput cols or stty size. However, I'm not sure how to go about retrieving the pixel size of the emulated character (even for specifically within iTerm2) to perform the conversion that would calculate the appropriate amount of cropping.

@gpakosz
Copy link

gpakosz commented Jul 30, 2024

I believe all Macs are have retina displays by now

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

No branches or pull requests

5 participants