After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 172845 - one pixel cropped off at left when rendering subtitles
one pixel cropped off at left when rendering subtitles
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins
git master
Other Linux
: Normal normal
: 0.8.9
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-04-06 18:59 UTC by Michaël Arnauts
Modified: 2005-04-29 09:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (176.02 KB, image/png)
2005-04-06 19:00 UTC, Michaël Arnauts
  Details
possible fix (818 bytes, patch)
2005-04-07 11:25 UTC, Ronald Bultje
none Details | Review
screenshot (notice the W of "Wie") (206.81 KB, image/png)
2005-04-07 11:37 UTC, Michaël Arnauts
  Details
more (1.09 KB, patch)
2005-04-07 13:58 UTC, Ronald Bultje
none Details | Review
screenshot (173.80 KB, image/png)
2005-04-07 14:05 UTC, Michaël Arnauts
  Details
new patch (1.60 KB, patch)
2005-04-08 17:49 UTC, Ronald Bultje
committed Details | Review
screenshot (124.88 KB, image/png)
2005-04-08 18:42 UTC, Michaël Arnauts
  Details
screenshot (92.75 KB, image/png)
2005-04-08 18:46 UTC, Michaël Arnauts
  Details
that's here (73.22 KB, image/png)
2005-04-09 08:48 UTC, Ronald Bultje
  Details
more (65.25 KB, image/png)
2005-04-09 10:06 UTC, Ronald Bultje
  Details
shot (90.40 KB, image/png)
2005-04-09 10:42 UTC, Michaël Arnauts
  Details
fix (695 bytes, patch)
2005-04-29 09:39 UTC, Ronald Bultje
none Details | Review

Description Michaël Arnauts 2005-04-06 18:59:29 UTC
I just compiled the latest gst-plugins & co + totem, and the subtitle selection
is working nicely, except that the bottom part of the images is cropped off...

I guess the box where the subtitles are rendered is to small or something like
that...

I will attach a screenshot what will make it clear.
Comment 1 Michaël Arnauts 2005-04-06 19:00:00 UTC
Created attachment 39765 [details]
screenshot
Comment 2 Ronald Bultje 2005-04-07 11:25:03 UTC
Created attachment 39795 [details] [review]
possible fix

This may fix it (subtitle show fine here with the patch). Does it fix it for
you?
Comment 3 Michaël Arnauts 2005-04-07 11:36:50 UTC
This fixes the height, great!
But when looking clearly, i noticed that the sub-box should also be a bit wider,
i will post a screenshot to make it clear.

You can see that the first char of the sub it a bit chopped of (the W of Wie).
Comment 4 Michaël Arnauts 2005-04-07 11:37:24 UTC
Created attachment 39796 [details]
screenshot (notice the W of "Wie")
Comment 5 Ronald Bultje 2005-04-07 13:58:36 UTC
Created attachment 39801 [details] [review]
more

This better?
Comment 6 Michaël Arnauts 2005-04-07 14:05:43 UTC
Created attachment 39802 [details]
screenshot

that doesn't look good... You can also see some gray pixels between the
chars...
Comment 7 Ronald Bultje 2005-04-07 15:13:13 UTC
Awesome! Er...
Comment 8 Ronald Bultje 2005-04-08 17:05:25 UTC
A closer look tells me it's not the counting that is wrong. I can reproduce this
very reliably with the capital 'J' in bitstream vera sans.
Comment 9 Ronald Bultje 2005-04-08 17:49:36 UTC
Created attachment 39842 [details] [review]
new patch

This is the first patch, which removes a one-pixel border in the bitmap (which
cuts off one pixel off the text), and adds another when rendering (because
pango screws up internally). I think this fixes the bug.

Dave, can you explain the goal of the bitmap_x0 code?
Comment 10 Michaël Arnauts 2005-04-08 18:42:10 UTC
Created attachment 39844 [details]
screenshot

Hmm, this is better then the 2nd patch (the one that caused the garble), but
there are still some lost pixels (as you said, it is visible with a J at the
beginning, and i noticed it is be visible with a ? at the end).
Comment 11 Michaël Arnauts 2005-04-08 18:46:01 UTC
Created attachment 39845 [details]
screenshot

hmm, sorry, the J at the beginning is good, Sans' J is just tin... But the ? is
clearly missing a row of pixels... Perhaps some hardcoded +1 somewhere?

(discovered the totem's screenshot function :) )
Comment 12 Ronald Bultje 2005-04-08 19:12:09 UTC
Yours is indeed missing a pixel, but I cannot reproduce it. My question mark
looks fine. What font did you select?
Comment 13 Michaël Arnauts 2005-04-08 19:13:38 UTC
Sans Bold, 16pixels
Comment 14 Ronald Bultje 2005-04-09 08:48:49 UTC
Created attachment 39862 [details]
that's here

This is how it looks for me, perfect if you ask me... Weird.
Comment 15 Michaël Arnauts 2005-04-09 09:44:56 UTC
Hmm, and that is Sans Bold, 16 pixels? Strange... since the J in your screenshot
is much wider...
Comment 16 Ronald Bultje 2005-04-09 10:06:15 UTC
Created attachment 39865 [details]
more

Yes. Sans is a meta-font, so the actual chosen font probably differs. Your J
looks a lot like the bitstream vera J, while mine looks more like helvetica or
so. Here's a screenshot of Bitstream Vera Sans, Bold, 16px. Still good. Can you
try to figure out which font it uses for you?
Comment 17 Michaël Arnauts 2005-04-09 10:42:40 UTC
Created attachment 39866 [details]
shot

Hmmm, even your bitstream vera sans bold is a different font as my bitstream
vera sans bold... I've tried the same text, and it is clearly that your font is
more bold as mine...

Maybe it's usefull to know that i've installed the msttcorefonts?
Comment 18 Michaël Arnauts 2005-04-09 10:46:26 UTC
Ow, forgot to add that the chopped of pixels happens with almost all my fonts...
Comment 19 Ronald Bultje 2005-04-09 16:30:22 UTC
We found that the 1 as x-offset in the pango_render_layout causes this. However,
for me, removing that causes the 1-pixel-off problem on the left side (with both
pango 1.8.0 and 1.8.1 on Fedora; Michael uses 1.8.1/Ubuntu). Don't know how to
fix it...
Comment 20 Luca Ognibene 2005-04-29 09:06:36 UTC
I have the same problem as in comment 11 (one pixel cropped on the right). 
Test pipeline:
gst-launch-0.8 videotestsrc !
video/x-raw-yuv,width=640,height=480,framerate=25.0 ! textoverlay text="CIAO" !
ffmpegcolorspace ! ximagesink

If i remove the 1px as x-offset as in comment 19 all is fine. 
I'm using debian sarge, pango 1.8.1
Comment 21 Ronald Bultje 2005-04-29 09:39:45 UTC
Created attachment 45817 [details] [review]
fix

Thanks to the pango developers (Sven Neumann on IRC) for helping me. ;).