#42218 [Com]: ImageTTFBBox & any2eucjp

2007-10-03 Thread super at superduper dot org
 ID:   42218
 Comment by:   super at superduper dot org
 Reported By:  fernando at barnatech dot com
 Status:   Feedback
 Bug Type: GD related
 Operating System: Suse 10.2
 PHP Version:  5.2.4RC1
 Assigned To:  pajoye
 New Comment:

Hey! 

I'm sorry, i always found compiling the php module with all the
dependencies a pain, which is why I'm using Xampp. 

I'm being pretty busy at the moment and don't have time for setting up
the build environment and testing it out. As I said - I got around the
issue by using ini_set( ... ) with mbstring compiled in on two different
servers (with and without jis comiled into gd).

Maybe there is someone who test compiles php everyday that could try it
out with the different settings. 

If you would like to have the code used for testing please let me know.


Previous Comments:


[2007-10-03 09:22:33] [EMAIL PROTECTED]

There is no fallback ot UTF-8. It accepts UTF-8 by default. The problem
about JIS is when you pass a non UTF-8 string, it can be seen as JIS
enconded string.

About the mbstring issues, I have no idea how it works and how it
affects the input parameters. It is something happening before we got
the hand in the gd function.

Please try using:

- Without mbstring, with jis enabled
- Without mbstring, without jis

It will help us (you and us) to figure out what break your config.



[2007-10-02 23:33:41] super at superduper dot org

Hey! 

I could fix the problem (on my host) by forcing an internal encoding. 
ini_set( "mbstring.internal_encoding", "UTF-8" );

Is it possible that gd fails just because there is no default encoding
set? 

Can anyone verify this? 

p.s.
So here's what i think is happening: 
I have two machines (see my previous post), it works on one machine
because the mbstring.internal_encoding is not set and gd has no japenese
support built in. Thus php and gd will fall back to unicode. 

On the other machine mbstring.internal_encoding isn't set either, but
this time gd has japanese support built in. As no encoding is set php
falls back to unicode while gd falls back to japanese, resulting in
incompatible encodings. The rest is history. 

Well... just some wild imaginations of someone who's never taken a look
at the sourcecode...



[2007-10-02 22:30:08] super at superduper dot org

Hello! 

I'm in an interresting situation where I have to configurations - one
in which the problem occurs, one in which works perfectly fine. 

I can't really tell the difference between the configurations, so i
just post the most important phpinfo() elements here and i hope it
helps. 

Both versions of php aren't recent. As it works in the older one
(5.2.2) and doesn't in the newer one i suspect it is more of a
configuration issue. 


-- WORKING CONFIGURATION - 
os x 10.4, xampp server, php 5.2.2
configure string: 
'./configure' '--prefix=/Applications/xampp/xamppfiles'
'--program-suffix=-5.2.2'
'--libdir=/Applications/xampp/xamppfiles/lib/php/php5'
'--includedir=/Applications/xampp/xamppfiles/include/php/php5'
'--with-apxs2=/Applications/xampp/xamppfiles/bin/apxs'
'--with-config-file-path=/Applications/xampp/etc'
'--with-mysql=/Applications/xampp/xamppfiles' '--disable-debug'
'--enable-bcmath' '--enable-calendar' '--enable-ctype' '--enable-dbase'
'--enable-discard-path' '--enable-exif' '--enable-filepro'
'--enable-force-cgi-redirect' '--enable-ftp' '--enable-gd-imgstrttf'
'--enable-gd-native-ttf' '--with-ttf' '--enable-magic-quotes'
'--enable-memory-limit' '--enable-safe-mode' '--enable-shmop'
'--enable-sigchild' '--enable-sysvsem' '--enable-sysvshm'
'--enable-track-vars' '--enable-trans-sid' '--enable-wddx' '--enable-yp'
'--with-ftp' '--with-ncurses=/Applications/xampp/xamppfiles'
'--with-gdbm=/Applications/xampp/xamppfiles'
'--with-jpeg-dir=/Applications/xampp/xamppfiles'
'--with-png-dir=/Applications/xampp/xamppfiles'
'--with-freetype-dir=/Applications/xampp/xamppfiles' '--without-xpm'
'--with-zlib=yes' '--with-zlib-dir=/Applications/xampp/xamppfiles'
'--with-openssl=/Applications/xampp/xamppfiles'
'--with-expat-dir=/Applications/xampp/xamppfiles'
'--enable-xslt=/Applications/xampp/xamppfiles'
'--with-xsl=/Applications/xampp/xamppfiles'
'--with-dom=/Applications/xampp/xamppfiles'
'--with-ldap=/Applications/xampp/xamppfiles' '--with-gd'
'--with-mysql-sock=/Applications/xampp/xamppfiles/var/mysql/mysql.sock'
'--with-mcrypt=/Applications/xampp/xamppfiles'
'--with-mhash=/Applications/xampp/xamppfiles' '--enable-sockets'
'--with-curl=/Applications/xampp/xamppfiles' '--enable-mbregex'
'--enable-zend-multibyte' '--with-zip=/Applications/xampp/xamppfiles'
'--enable-exif' '--with-sqlite'
'--with-libxml-dir=/Applications/xampp/xamppfiles' '--enable-soap'
'--enable-pcntl' '--enable-dbx'
'--with-mysqli=/A

#42218 [Com]: ImageTTFBBox & any2eucjp

2007-10-02 Thread super at superduper dot org
 ID:   42218
 Comment by:   super at superduper dot org
 Reported By:  fernando at barnatech dot com
 Status:   Assigned
 Bug Type: GD related
 Operating System: Suse 10.2
 PHP Version:  5.2.4RC1
 Assigned To:  pajoye
 New Comment:

Hey! 

I could fix the problem (on my host) by forcing an internal encoding. 
ini_set( "mbstring.internal_encoding", "UTF-8" );

Is it possible that gd fails just because there is no default encoding
set? 

Can anyone verify this? 

p.s.
So here's what i think is happening: 
I have two machines (see my previous post), it works on one machine
because the mbstring.internal_encoding is not set and gd has no japenese
support built in. Thus php and gd will fall back to unicode. 

On the other machine mbstring.internal_encoding isn't set either, but
this time gd has japanese support built in. As no encoding is set php
falls back to unicode while gd falls back to japanese, resulting in
incompatible encodings. The rest is history. 

Well... just some wild imaginations of someone who's never taken a look
at the sourcecode...


Previous Comments:


[2007-10-02 22:30:08] super at superduper dot org

Hello! 

I'm in an interresting situation where I have to configurations - one
in which the problem occurs, one in which works perfectly fine. 

I can't really tell the difference between the configurations, so i
just post the most important phpinfo() elements here and i hope it
helps. 

Both versions of php aren't recent. As it works in the older one
(5.2.2) and doesn't in the newer one i suspect it is more of a
configuration issue. 


-- WORKING CONFIGURATION - 
os x 10.4, xampp server, php 5.2.2
configure string: 
'./configure' '--prefix=/Applications/xampp/xamppfiles'
'--program-suffix=-5.2.2'
'--libdir=/Applications/xampp/xamppfiles/lib/php/php5'
'--includedir=/Applications/xampp/xamppfiles/include/php/php5'
'--with-apxs2=/Applications/xampp/xamppfiles/bin/apxs'
'--with-config-file-path=/Applications/xampp/etc'
'--with-mysql=/Applications/xampp/xamppfiles' '--disable-debug'
'--enable-bcmath' '--enable-calendar' '--enable-ctype' '--enable-dbase'
'--enable-discard-path' '--enable-exif' '--enable-filepro'
'--enable-force-cgi-redirect' '--enable-ftp' '--enable-gd-imgstrttf'
'--enable-gd-native-ttf' '--with-ttf' '--enable-magic-quotes'
'--enable-memory-limit' '--enable-safe-mode' '--enable-shmop'
'--enable-sigchild' '--enable-sysvsem' '--enable-sysvshm'
'--enable-track-vars' '--enable-trans-sid' '--enable-wddx' '--enable-yp'
'--with-ftp' '--with-ncurses=/Applications/xampp/xamppfiles'
'--with-gdbm=/Applications/xampp/xamppfiles'
'--with-jpeg-dir=/Applications/xampp/xamppfiles'
'--with-png-dir=/Applications/xampp/xamppfiles'
'--with-freetype-dir=/Applications/xampp/xamppfiles' '--without-xpm'
'--with-zlib=yes' '--with-zlib-dir=/Applications/xampp/xamppfiles'
'--with-openssl=/Applications/xampp/xamppfiles'
'--with-expat-dir=/Applications/xampp/xamppfiles'
'--enable-xslt=/Applications/xampp/xamppfiles'
'--with-xsl=/Applications/xampp/xamppfiles'
'--with-dom=/Applications/xampp/xamppfiles'
'--with-ldap=/Applications/xampp/xamppfiles' '--with-gd'
'--with-mysql-sock=/Applications/xampp/xamppfiles/var/mysql/mysql.sock'
'--with-mcrypt=/Applications/xampp/xamppfiles'
'--with-mhash=/Applications/xampp/xamppfiles' '--enable-sockets'
'--with-curl=/Applications/xampp/xamppfiles' '--enable-mbregex'
'--enable-zend-multibyte' '--with-zip=/Applications/xampp/xamppfiles'
'--enable-exif' '--with-sqlite'
'--with-libxml-dir=/Applications/xampp/xamppfiles' '--enable-soap'
'--enable-pcntl' '--enable-dbx'
'--with-mysqli=/Applications/xampp/xamppfiles/bin/mysql_config'
'--with-bz2=/Applications/xampp/xamppfiles'
'--with-ming=shared,/Applications/xampp/xamppfiles'
'--with-pear=/Applications/xampp/xamppfiles/lib/php/pear'
'--with-mssql=/Applications/xampp/xamppfiles'
'--with-imap-dir=/Applications/xampp/xamppfiles'
'--with-imap=/Applications/xampp/xamppfiles' '--enable-mbstring=all'
'--with-pgsql=shared,/usr'
'--with-gettext=/Applications/xampp/xamppfiles'


mbstring config: 
mbstring
Multibyte Support   enabled
Multibyte string engine libmbfl
Multibyte (japanese) regex support  enabled
Multibyte regex (oniguruma) version 4.4.4
Multibyte regex (oniguruma) backtrack check On

Directive   Local Value Master Value
mbstring.detect_order   no valueno value
mbstring.encoding_translation   Off Off
mbstring.func_overload  0   0
mbstring.http_input passpass
mbstring.http_outputpasspass
mbstring.internal_encoding  no valueno value
mbstring.language   neutral neutral
mbstring.script_encodingno valueno value
mbstring.strict_detection   Off Off
mbstring.substitute_character   no valueno value



--- BROKEN CONFIGURATION (my webhost)-
some linux, php 5.2.3

configure string:

#42218 [Com]: ImageTTFBBox & any2eucjp

2007-10-02 Thread super at superduper dot org
 ID:   42218
 Comment by:   super at superduper dot org
 Reported By:  fernando at barnatech dot com
 Status:   Assigned
 Bug Type: GD related
 Operating System: Suse 10.2
 PHP Version:  5.2.4RC1
 Assigned To:  pajoye
 New Comment:

Hello! 

I'm in an interresting situation where I have to configurations - one
in which the problem occurs, one in which works perfectly fine. 

I can't really tell the difference between the configurations, so i
just post the most important phpinfo() elements here and i hope it
helps. 

Both versions of php aren't recent. As it works in the older one
(5.2.2) and doesn't in the newer one i suspect it is more of a
configuration issue. 


-- WORKING CONFIGURATION - 
os x 10.4, xampp server, php 5.2.2
configure string: 
'./configure' '--prefix=/Applications/xampp/xamppfiles'
'--program-suffix=-5.2.2'
'--libdir=/Applications/xampp/xamppfiles/lib/php/php5'
'--includedir=/Applications/xampp/xamppfiles/include/php/php5'
'--with-apxs2=/Applications/xampp/xamppfiles/bin/apxs'
'--with-config-file-path=/Applications/xampp/etc'
'--with-mysql=/Applications/xampp/xamppfiles' '--disable-debug'
'--enable-bcmath' '--enable-calendar' '--enable-ctype' '--enable-dbase'
'--enable-discard-path' '--enable-exif' '--enable-filepro'
'--enable-force-cgi-redirect' '--enable-ftp' '--enable-gd-imgstrttf'
'--enable-gd-native-ttf' '--with-ttf' '--enable-magic-quotes'
'--enable-memory-limit' '--enable-safe-mode' '--enable-shmop'
'--enable-sigchild' '--enable-sysvsem' '--enable-sysvshm'
'--enable-track-vars' '--enable-trans-sid' '--enable-wddx' '--enable-yp'
'--with-ftp' '--with-ncurses=/Applications/xampp/xamppfiles'
'--with-gdbm=/Applications/xampp/xamppfiles'
'--with-jpeg-dir=/Applications/xampp/xamppfiles'
'--with-png-dir=/Applications/xampp/xamppfiles'
'--with-freetype-dir=/Applications/xampp/xamppfiles' '--without-xpm'
'--with-zlib=yes' '--with-zlib-dir=/Applications/xampp/xamppfiles'
'--with-openssl=/Applications/xampp/xamppfiles'
'--with-expat-dir=/Applications/xampp/xamppfiles'
'--enable-xslt=/Applications/xampp/xamppfiles'
'--with-xsl=/Applications/xampp/xamppfiles'
'--with-dom=/Applications/xampp/xamppfiles'
'--with-ldap=/Applications/xampp/xamppfiles' '--with-gd'
'--with-mysql-sock=/Applications/xampp/xamppfiles/var/mysql/mysql.sock'
'--with-mcrypt=/Applications/xampp/xamppfiles'
'--with-mhash=/Applications/xampp/xamppfiles' '--enable-sockets'
'--with-curl=/Applications/xampp/xamppfiles' '--enable-mbregex'
'--enable-zend-multibyte' '--with-zip=/Applications/xampp/xamppfiles'
'--enable-exif' '--with-sqlite'
'--with-libxml-dir=/Applications/xampp/xamppfiles' '--enable-soap'
'--enable-pcntl' '--enable-dbx'
'--with-mysqli=/Applications/xampp/xamppfiles/bin/mysql_config'
'--with-bz2=/Applications/xampp/xamppfiles'
'--with-ming=shared,/Applications/xampp/xamppfiles'
'--with-pear=/Applications/xampp/xamppfiles/lib/php/pear'
'--with-mssql=/Applications/xampp/xamppfiles'
'--with-imap-dir=/Applications/xampp/xamppfiles'
'--with-imap=/Applications/xampp/xamppfiles' '--enable-mbstring=all'
'--with-pgsql=shared,/usr'
'--with-gettext=/Applications/xampp/xamppfiles'


mbstring config: 
mbstring
Multibyte Support   enabled
Multibyte string engine libmbfl
Multibyte (japanese) regex support  enabled
Multibyte regex (oniguruma) version 4.4.4
Multibyte regex (oniguruma) backtrack check On

Directive   Local Value Master Value
mbstring.detect_order   no valueno value
mbstring.encoding_translation   Off Off
mbstring.func_overload  0   0
mbstring.http_input passpass
mbstring.http_outputpasspass
mbstring.internal_encoding  no valueno value
mbstring.language   neutral neutral
mbstring.script_encodingno valueno value
mbstring.strict_detection   Off Off
mbstring.substitute_character   no valueno value



--- BROKEN CONFIGURATION (my webhost)-
some linux, php 5.2.3

configure string: 
 Command './configure' '--with-apxs2=/usr/local/apache/bin/apxs'
'--prefix=/imports/php5' '--with-config-file-path=/imports/php5/'
'--with-openssl=/usr/local/ssl' '--with-dom' '--with-iconv'
'--with-curl' '--with-mysql=/usr/local' '--with-gettext'
'--enable-mbstring' '--with-xml' '--enable-track-vars' '--enable-exif'
'--with-jpeg-dir' '--with-zlib' '--with-zlib-dir' '--with-png-dir'
'--with-gd' '--with-gettext' '--with-freetype-dir' '--with-xpm-dir'
'--enable-gd-native-ttf' '--enable-gd-jis-conv' '--with-mhash'
'--enable-ftp' '--with-pear' '--with-pspell'
'--with-mysqli=/usr/local/bin/mysql_config' '--with-ldap'
'--with-ldap-sasl' '--with-imap=../imap-2004g'
'--with-imap-ssl=/usr/local/ssl' '--with-libxml' '--with-xsl'
'--with-libexpat-dir=/usr' '--with-mcrypt' '--enable-bcmath'
'--with-mime-magic' '--enable-calendar' '--with-pdo-mysql'
'--enable-sockets' '--enable-soap' '--with-tidy'

mbstring
Multibyte Support   enabled
Multibyte string engine 

#42218 [Com]: ImageTTFBBox & any2eucjp

2007-08-13 Thread grzegorz at inventor dot com dot pl
 ID:   42218
 Comment by:   grzegorz at inventor dot com dot pl
 Reported By:  fernando at barnatech dot com
 Status:   Feedback
 Bug Type: GD related
 Operating System: Suse 10.2
 PHP Version:  5.2.4RC1
 Assigned To:  pajoye
 New Comment:

I experienced the same problem as described above. 
source file encoding: UTF-8
PHP version: 5.2.2
GD Version: bundled (2.0.34 compatible)
OS: Sabayon Linux

I recompiled PHP with japanese support disabled and it seems to make 
problem go away.


Previous Comments:


[2007-08-09 07:59:47] fernando at barnatech dot com

I'll ask to the sysadmin team for a recompilation without japanese
support and then for a test repetition. It can last for days, I think.
I'll tell you the progress, if there's some.



[2007-08-09 07:47:24] [EMAIL PROTECTED]

About the install, on windows you don't have to install anything. You
can run php directly from the uncompressed directory, using the console
(cmd).

"By the way, may he bug disappear if PHP-GD is recompiled without
japanese support? The "any2eucjp()" in the error suggests it."

Yes, if you don't need japanese, disable it. I suspect a conflict
between the encoding.



[2007-08-09 07:42:48] fernando at barnatech dot com

The code encoding is UTF-8 as I told. We carefully use UTF-8 for code
in the IDE, for data in the DBMS and for output in the webserver.

I think a test is not so easy to perform in my job environment. Usually
I have no direct access to installation privileges, further than limited
ones in the development servers. No access to clients administration, no
PHP installation, recompilation or direct reconfiguration without an
administrative permission, etc. I promise you it's not so easy.

Working with PHP 5.2.0 right now. The bug is there too, of course.

By the way, may he bug disappear if PHP-GD is recompiled without
japanese support? The "any2eucjp()" in the error suggests it.



[2007-08-08 13:36:21] [EMAIL PROTECTED]

"I have no spare machines right now (resources fly here)."

Fetch a snapshot (windows for example), uncompress it and execute your
script using it. That's all I need :)

"I think I don't understand exactly what are you asking about
encoding.
For me, encoding is the charset used with data, or code, or HTML
output.
But it seems it's not what you're asking."

Which enconding do you use in your script files, iso-, UTF-8, etc.
Your editor should be able to tell you that. That determines what you
actually pass to the imagettf function (UTF-8 is the safest way).



[2007-08-08 08:02:32] fernando at barnatech dot com

Strange, as I pasted directly that phpinfo() output. I had installed
the 5.2.4RC1 version on a dev webserver over a previously PHP version
test, but I'm afraid I can't do it again. It was a development
environment I set up when I found this bug in our stable dev version
5.2.0, just to test if it had been corrected in 5.2.4RC1, as a prior
step before reporting it here. But since yesterday that server doesn't
exist anymore, and I have no spare machines right now (resources fly
here).

I think I don't understand exactly what are you asking about encoding.
For me, encoding is the charset used with data, or code, or HTML output.
But it seems it's not what you're asking. I don't manage font charsets,
if it helps.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/42218

-- 
Edit this bug report at http://bugs.php.net/?id=42218&edit=1