[Cartoweb-users] one more exportPdf
wochter
wochter at seznam.cz
Fri Oct 12 02:55:48 EDT 2007
hmm, and how to solve this problem?
Summary:
Cartoweb from cvs - last update, php_mapscript ver. 4.10.3
OUTPUTFORMAT
NAME png
DRIVER "GD/PNG"
MIMETYPE "image/png"
IMAGEMODE PC256
EXTENSION "png"
FORMATOPTION "INTERLACE=OFF"
TRANSPARENT ON
END
The PNG file is attached and is in PLTE format, I think...
Have I compile newer version of mapserver or any library?
(gd, gdal, etc...)
Or may be I haven't included any library to myself compiled
php_mapscript.so ?
Oliver Christen wrote / napísal(a):
> all I can tell you is the png generated by mapserver for the mainmap
> using your OUTPUTFORMAT is not valid for fpdf.
> and that pgn, containing the type "IDAT" (because thats is where the
> error happens in fpdf.php), is certainly not generated using the png
> OUTPUTFORMAT you have below, as PC256 will result in a "PLTE" type (see
> png treatment in fpdf.php, you can see the type in the image if you open
> it with a text editor, it is in plain text ).
>
> somehow another OUTPUTFORMAT, with IMAGEMODE RGB, must be defined somewhere
>
> regards
> Oliver
>
>
> I forgot, in mapfile I have this:
>
> OUTPUTFORMAT
> NAME png
> DRIVER "GD/PNG"
> MIMETYPE "image/png"
> IMAGEMODE PC256
> EXTENSION "png"
> FORMATOPTION "INTERLACE=OFF"
> TRANSPARENT ON
> END
>
> Oliver Christen wrote / napísal(a):
>> mmm, the reprojection shouldnt influe on the matter, as long as
>> mapserver generate the image correclty
>>
>> ...[8192][8192][122][0] <- that last zero is what is causing the error
>> you get.
>>
>> when the script try to read the png file, of type "IDAT" (24bit color
>> png), it seems to fail because the image doesnt contain the correct data.
>>
>> the image 470dc21a_1921_7.png was the mainmap ?
>>
>> what OUTPUTFORMAT do you have set for it ?
>> if you try to use "jpeg" (the corresponding OUTPUTFORMAT must be defined
>> in the mapfile), does it work ?
>>
>> regards
>> Oliver
>>
>>
>>
>> one more idea...
>> I use EPSG:2065
>> Never mind?
>>
>> -w-
>>
>>
>> Oliver Christen wrote / napísal(a):
>>> could you try to add a
>>> print('['.$n.']');
>>> after
>>> $n=$this->_freadint($f); (line 1560 in the CW fpdf.php)
>>>
>>> this will create an exception, but it should at least display whats the
>>> value used for $n
>>>
>>> regards
>>> Oliver
>>>
>>> ----- Original Message ----- From: "wochter" <wochter at seznam.cz>
>>> To: "Oliver Christen" <oliver.christen at camptocamp.com>
>>> Sent: Thursday, October 11, 2007 12:06 PM
>>> Subject: Re: [Cartoweb-users] one more exportPdf
>>>
>>>
>>> I tried uninstall package php-fpdf.
>>> Then cartoweb uses fpdf from cartoweb3/include/fpdf/fpdf.php
>>>
>>> and with the same error, but error is in line 1587
>>>
>>>
>>>
>>> Oliver Christen wrote / napísal(a):
>>>> I cant reproduce the problem on the demo on cartoweb.org website.
>>>> can you remind me which version of CW you use? 3.4?
>>>> because I dont see a call to fread at line 1563 in fpdf.php in the
>>>> version I have.
>>>> what so you have at that line ?
>>>>
>>>> regards
>>>> Oliver
>>>>
>>>>
>>>>> Yes, the file is present in directory
>>>>> /var/www/cartoweb3/htdocs/generated/images
>>>>>
>>>>> ls -l :
>>>>> -rw-r--r-- 1 www-data www-data 225079 2007-10-11 11:12
>>>>> 470de8f2_2057_0.png
>>>>>
>>>>> I can see it with gwenview, and is correct :-(
>>>>>
>>>>> wochter
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Oliver Christen wrote / napísal(a):
>>>>>> Hi
>>>>>> it seems fpdf can not read or open a file (470dc21a_1921_7.png in the
>>>>>> backtrace below).
>>>>>> does the file exist in that folder? does it look ok (open it in a
>>>>>> graphic editor)? and are all the rights on the files and folder
>>>>>> correct ?
>>>>>>
>>>>>> regards
>>>>>> Oliver
>>>>>>
>>>>>>>
>>>>>>> Class : CartocommonException
>>>>>>> Message : Error [2, fread() [function.fread]: Length parameter
>>>>>>> must be
>>>>>>> greater than 0, /usr/share/php/fpdf/fpdf.php, 1563]
>>>>>>> Backtrace:
>>>>>>>
>>>>>>> file: UNKNOWN - UNKNOWN
>>>>>>> call: Common::cartowebErrorHandler(2, "fread() [function.fread]:
>>>>>>> Length
>>>>>>> pa...", "/usr/share/php/fpdf/fpdf.php", 1563, Array(13))
>>>>>>>
>>>>>>> file: 1563 - /usr/share/php/fpdf/fpdf.php
>>>>>>> call: fread(Resource(#8080), -2147482907)
>>>>>>>
>>>>>>> file: 912 - /usr/share/php/fpdf/fpdf.php
>>>>>>> call:
>>>>>>> FPDF->_parsepng("/var/www/cartoweb3/htdocs/generated/images/470dc21a_1921_7.png")
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> file: 1027 - /var/www/cartoweb3/plugins/exportPdf/client/CwFpdf.php
>>>>>>> call:
>>>>>>> FPDF->Image("/var/www/cartoweb3/htdocs/generated/images/470dc21a_1921_7.png",
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 20.25, 20.25, 257, 170, "", "")
>>>>>>>
>>>>>>> file: 518 - /var/www/cartoweb3/plugins/exportPdf/client/CwFpdf.php
>>>>>>> call:
>>>>>>> CwFpdf->addImage("/var/www/cartoweb3/htdocs/generated/images/470dc21a_1921_7.png",
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 20.25, 20.25, 257, 170)
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Cartoweb-users mailing list
>>>>> Cartoweb-users at lists.maptools.org
>>>>> http://lists.maptools.org/mailman/listinfo/cartoweb-users
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 470f15c8_1ad2_3.png
Type: image/png
Size: 275059 bytes
Desc: not available
Url : http://lists.maptools.org/pipermail/cartoweb-users/attachments/20071012/f05bd518/470f15c8_1ad2_3-0001.png
More information about the Cartoweb-users
mailing list