# is GD being actively maintained?

- Thread: https://externals.io/message/62860
- Original archive: https://news-web.php.net/php.internals/62860
- Started by Rasmus Schultz on 2012-09-06T12:07:02+00:00
- Messages: 14
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #62860 — Rasmus Schultz — 2012-09-06T12:07:02+00:00

URL: https://externals.io/message/62860#62860

I opened this bug report 2 years ago:

https://bugs.php.net/bug.php?id=52756

Is GD still actively maintained?

If it isn't, then perhaps it's time to start thinking about switching to a
graphics library that is maintained?

Perhaps something more modern with real drawing capabilities and a better
typographic engine?

Just wondering...

---

## #62861 — Andrew Faulds — 2012-09-06T12:50:53+00:00

URL: https://externals.io/message/62860#62861 · In reply to: #62860

I briefly asked Pierre about a feature in it recently. By the sounds of it, it is being actively maintained, albeit perhaps slowly.
-- 
Sent from my Android phone with K-9 Mail.
Andrew Faulds
http://ajf.me/

Rasmus Schultz <rasmus@mindplay.dk> wrote:

I opened this bug report 2 years ago:

https://bugs.php.net/bug.php?id=52756

Is GD still actively maintained?

If it isn't, then perhaps it's time to start thinking about switching to a
graphics library that is maintained?

Perhaps something more modern with real drawing capabilities and a better
typographic engine?

Just wondering...

---

## #62863 — Alexey Shein — 2012-09-06T13:05:46+00:00

URL: https://externals.io/message/62860#62863 · In reply to: #62860

Hi, Rasmus,

Just wanted to note that I've tested your script from
http://fontjazz.com/metrics/test.php and couldn't reproduce the bug.
I'm on the Ubuntu 12.04 with PHP 5.3.10-1ubuntu3.2 with Suhosin-Patch

Have you tried upgrading your FreeType library and recompiling latest
stable PHP with it?

Good luck.

P.S. I'm not a GD developer.

2012/9/6 Rasmus Schultz <rasmus@mindplay.dk>:
> I opened this bug report 2 years ago:
>
> https://bugs.php.net/bug.php?id=52756
>
> Is GD still actively maintained?
>
> If it isn't, then perhaps it's time to start thinking about switching to a
> graphics library that is maintained?
>
> Perhaps something more modern with real drawing capabilities and a better
> typographic engine?
>
> Just wondering...



-- 
Regards,
Shein Alexey

---

## #62864 — Jannik Zschiesche — 2012-09-06T13:15:10+00:00

URL: https://externals.io/message/62860#62864 · In reply to: #62863

Am Donnerstag, 6. September 2012 um 15:05 schrieb Alexey Shein:
> Hi, Rasmus,
> 
> Just wanted to note that I've tested your script from
> http://fontjazz.com/metrics/test.php and couldn't reproduce the bug.
> I'm on the Ubuntu 12.04 with PHP 5.3.10-1ubuntu3.2 with Suhosin-Patch
> 
> Have you tried upgrading your FreeType library and recompiling latest
> stable PHP with it?
> 
> Good luck.
> 
> P.S. I'm not a GD developer.

Hi Alexey,

I just tested it on PHP 5.4.4 on OSX and I can confirm, that the issue is still present.
(used font: Open Sans Regular/Bold/Italic, screenshots: http://min.us/mM2c5yyBU )


Cheers
Jannik Zschiesche

---

## #62865 — Alexey Shein — 2012-09-06T13:31:55+00:00

URL: https://externals.io/message/62860#62865 · In reply to: #62864

2012/9/6 Jannik Zschiesche <hello@apfelbox.net>:
> Am Donnerstag, 6. September 2012 um 15:05 schrieb Alexey Shein:
>
> Hi, Rasmus,
>
> Just wanted to note that I've tested your script from
> http://fontjazz.com/metrics/test.php and couldn't reproduce the bug.
> I'm on the Ubuntu 12.04 with PHP 5.3.10-1ubuntu3.2 with Suhosin-Patch
>
> Have you tried upgrading your FreeType library and recompiling latest
> stable PHP with it?
>
> Good luck.
>
> P.S. I'm not a GD developer.
>
>
> Hi Alexey,
>
> I just tested it on PHP 5.4.4 on OSX and I can confirm, that the issue is
> still present.
> (used font: Open Sans Regular/Bold/Italic, screenshots:
> http://min.us/mM2c5yyBU )
>

Here is mine with georgiai.ttf
http://minus.com/mbcHodY8D8

-- 
Regards,
Shein Alexey

---

## #62866 — Tom Boutell — 2012-09-06T13:32:30+00:00

URL: https://externals.io/message/62860#62866 · In reply to: #62864

The good news is that gd is pretty moribund, there isn't a lot to
maintain. But things do come up.

libgd.org has been displaying the same "oops crap something happened"
notice for... three years? At least? If there is no momentum to fix
that, as the original developer of gd I would be willing to restore
the classic gd documentation there and continue linking to the
bitbucket project.


> Am Donnerstag, 6. September 2012 um 15:05 schrieb Alexey Shein:
> > […]
>
> Hi Alexey,
>
> I just tested it on PHP 5.4.4 on OSX and I can confirm, that the issue is still present.
> (used font: Open Sans Regular/Bold/Italic, screenshots: http://min.us/mM2c5yyBU )
>
>
> Cheers
> Jannik Zschiesche



-- 
Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com

---

## #62872 — Pierre Joye — 2012-09-06T16:43:01+00:00

URL: https://externals.io/message/62860#62872 · In reply to: #62860

hi Rasmus,


> I opened this bug report 2 years ago:
>
> https://bugs.php.net/bug.php?id=52756
>
> Is GD still actively maintained?

yes. Slowly but yes, we will finally merge 2.1 in 5.5 too.


> Perhaps something more modern with real drawing capabilities and a better
> typographic engine?

there is gd/pango available too, it allows to replace freetype
functions transparently. Pango is much better for rendering. Not sure
if the bug you refer to is a freetype bug or something else tho'.

Cheers,
-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

---

## #62873 — Pierre Joye — 2012-09-06T16:43:50+00:00

URL: https://externals.io/message/62860#62873 · In reply to: #62866

> libgd.org has been displaying the same "oops crap something happened"
> notice for... three years? At least? If there is no momentum to fix
> that, as the original developer of gd I would be willing to restore
> the classic gd documentation there and continue linking to the
> bitbucket project.

Yes, it annoys me that the redirect stopped to work, and yes, for too
long :) The bitbucket page should show up :)

-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

---

## #62889 — Rasmus Schultz — 2012-09-07T01:09:26+00:00

URL: https://externals.io/message/62860#62889 · In reply to: #62864

Jannik,

Thank you - this confirms I'm not crazy, or at least it's evidence to
support that theory ;-)

It may be OS specific - perhaps the Windows and OSX binaries are built
against a different build (or configuration) of FreeType?

Or it could be specific to 32 or 64 bit builds.

I have never built PHP (or any other C project since 15 years ago in
school) so I really have no way to take this any further...

Thanks!


On Thu, Sep 6, 2012 at 9:15 AM, Jannik Zschiesche <hello@apfelbox.net>wrote:

>
> Hi Alexey,
>
> I just tested it on PHP 5.4.4 on OSX and I can confirm, that the issue is
> still present.
> (used font: Open Sans Regular/Bold/Italic, screenshots:
> http://min.us/mM2c5yyBU )
>
>
> Cheers
> Jannik Zschiesche

---

## #62891 — Pierre Joye — 2012-09-07T05:12:16+00:00

URL: https://externals.io/message/62860#62891 · In reply to: #62889

> Jannik,
>
> Thank you - this confirms I'm not crazy, or at least it's evidence to
> support that theory ;-)
>
> It may be OS specific - perhaps the Windows and OSX binaries are built
> against a different build (or configuration) of FreeType?

It can depend on three things:

- bug in gd (bbox  or offset calculation)
- freetype version
- freetype options (some options, not always enabled, strongly affects
rendering)

cheers,
-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

---

## #62893 — Lester Caine — 2012-09-07T06:51:59+00:00

URL: https://externals.io/message/62860#62893 · In reply to: #62889

Rasmus Schultz wrote:
> Thank you - this confirms I'm not crazy, or at least it's evidence to
> support that theory;-)
>
> It may be OS specific - perhaps the Windows and OSX binaries are built
> against a different build (or configuration) of FreeType?

Rasmus
Something that is also worth bearing in mind is that even in native 
applications, fonts behave a little strange at times. Certainly in windows we 
used to have fun between different versions of windows rendering text in 
slightly different sizes, and today I have to ask some customers to change fonts 
where they have picked up some nice new fancy one, but on Linux it wraps at 
different places to Windows or Mac. I certainly remember having to 'adjust' box 
sizes on native applications so that the W98 app displayed the same on W2k.

While it would be nice to accurately render a pdf document to a printer, there 
is no accurate base to a browser window so we live with things being a little 
random when rendered, and often a browser will 'scale' fonts differently when 
you zoom them. So personally I just live with the fact that infrastructure is 
not as good as perhaps we would like?

It IS some time since I bothered looking at similar problems myself - probably 
1990's :) - but I think I'm right in saying that 'italic' is handled in a couple 
of different ways? One provides a separate rendering of the italic font, while 
the other simply allows the perpendicular font to be rendered at a variable 
angle. Looking at the 'faulty' image I would suspect that the metrics are for 
the perpendicular case, push the characters back to vertical and they will drop 
back in the box. At least if I was going to look at the problem, that is were I 
would start ... I doubt that this is purely a PHP bug though?

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

---

## #62894 — Pierre Joye — 2012-09-07T09:22:51+00:00

URL: https://externals.io/message/62860#62894 · In reply to: #62893

hi Lester,


> Rasmus Schultz wrote:
> > […]
>
>
> Rasmus
> Something that is also worth bearing in mind is that even in native
> applications, fonts behave a little strange at times. Certainly in windows
> we used to have fun between different versions of windows rendering text in
> slightly different sizes, and today I have to ask some customers to change
> fonts where they have picked up some nice new fancy one, but on Linux it
> wraps at different places to Windows or Mac. I certainly remember having to
> 'adjust' box sizes on native applications so that the W98 app displayed the
> same on W2k.

As this is true, it is unrelated to GD. GD uses Freetype on all
supported platforms.

> While it would be nice to accurately render a pdf document to a printer,
> there is no accurate base to a browser window so we live with things being a
> little random when rendered, and often a browser will 'scale' fonts
> differently when you zoom them. So personally I just live with the fact that
> infrastructure is not as good as perhaps we would like?

Unrelated, PDF texts are vectors, GD renders on bitmap directly.

> I doubt that this is purely a PHP bug though?

Please see my other reply for the actual possible causes.

Cheers,
-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

---

## #62895 — Rasmus Schultz — 2012-09-07T15:46:14+00:00

URL: https://externals.io/message/62860#62895 · In reply to: #62891

Good point - the bug could actually be in the rendering, rather than in the
bounding box calculation.

We could determine which is the case, by running the exact same script with
the exact same font, on a system where the bug is present, and on another
system where it's not.

Then overlay the resulting images in photoshop:

- if the type aligns, and the red lines do not, the bug is in the bounding
box computation.

- if the type does not align, the bug is either in the type rendering, or
in both (less likely) the rendering and bounding box computation.

That should narrow it down some?




> 
> > […]
>
> It can depend on three things:
>
> - bug in gd (bbox  or offset calculation)
> - freetype version
> - freetype options (some options, not always enabled, strongly affects
> rendering)
>
> cheers,
> --
> Pierre
>
> @pierrejoye | http://blog.thepimp.net | http://www.libgd.org

---

## #65034 — Jan Ehrhardt — 2013-01-18T21:47:05+00:00

URL: https://externals.io/message/62860#65034 · In reply to: #62872

Pierre Joye in php.internals (Thu, 6 Sep 2012 18:43:01 +0200):
>
> > […]

Hmmm. I see it is still open.

> > […]
>
>yes. Slowly but yes, we will finally merge 2.1 in 5.5 too.

Related, but no real bug: libjpeg 9.0 is released. It compiles fine into
php_gd2.dll, but reports an unknown version. This is due to
ext/gd/libgd/gd_jpeg.c, which only knows versions 6b, 7 and 8. A simple
check for JPEG_LIB_VERSION == 90 would be enough for the moment, but
wouldn't it be better to report the JPEG_LIB_VERSION it self? 62, 70,
80, 90 or whatever...

Jan
