Discussion:
Error using quickplot - TCPDF ERROR: [Image] Unable to get image:
(too old to reply)
JamesDudden
2015-02-06 10:52:12 UTC
Permalink
Hi,
I have run in to a problem that only happens when I turn on too many layers
i.e. there is always a tipping point where it works then I switch on more
layers and then it stops working. I am using MG Open Source 2.5 on Windows
Server 2008 with a .NET build. The map has many linked layers including
SHP, TIFF and MS Access.

The error is as follows:

TCPDF ERROR: [Image] Unable to get image:
http://localhost/mapguide/fusion/widgets/QuickPlot/GeneratePicture.php?session_id=4d63d044-adec-11e4-8000-001e6779bb86_en_MTI3LjAuMC4x0AFC0AFB0AFA&map_name=SolarMap_Print54d499ac870fe&print_size=1163.6,802.9&print_dpi=96&box=-320022.97641722555,6718419.613604725,-174572.97641722555,6718419.613604725,-174572.97641722555,6818782.113604725,-320022.97641722555,6818782.113604725&normalized_box=-320022.97641722555,6718419.613604725,-174572.97641722555,6718419.613604725,-174572.97641722555,6818782.113604725,-320022.97641722555,6818782.113604725&scale_denominator=125000&rotation=0


I found this old thread
(http://osgeo-org.1560.x6.nabble.com/TCPDF-ERROR-Image-Unable-to-get-image-td5098056.html)
that has the same issue and as per the thread copying the url from the error
into the address bar works but unfortunately this is not a great solution
for my client who needs the title/sub title you get with the proper
quickplot route plus the option to save as a PDF.

Any help is greatly appreciated





-----
RegardsJD
Software-Matters
Dorset
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Error-using-quickplot-TCPDF-ERROR-Image-Unable-to-get-image-tp5185933.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
Jackie Ng
2015-02-06 11:12:11 UTC
Permalink
If you get that error, it would be generally be because GeneratePicture.php
threw some sort of error causing an exception message to be returned instead
of an image. TCPDF tries to process that exception message as an image and
throws the aforementioned error as a result.

You should see what the GeneratePicture.php url is being generated by
PlotAsPDF.php and load that raw URL to see what kind of error
GeneratePicture.php is throwing back.

- Jackie



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Error-using-quickplot-TCPDF-ERROR-Image-Unable-to-get-image-tp5185933p5185937.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
JamesDudden
2015-02-06 11:19:54 UTC
Permalink
Are you saying copy the URL from the error and load that into the browser?
If so I have done this and the image appears ok...



-----
RegardsJD
Software-Matters
Dorset
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Error-using-quickplot-TCPDF-ERROR-Image-Unable-to-get-image-tp5185933p5185942.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
Jackie Ng
2015-02-06 11:43:04 UTC
Permalink
If this is consistently reproducible, what happens if you save that
GeneratePicture.php as an image, serve it as a static image file from the
same web server and as a test modify PlotAsPDF.php to replace the
GeneratePicture.php url with a url to your saved image, does TCPDF still
throw the error when pointing to the static image?

- Jackie



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Error-using-quickplot-TCPDF-ERROR-Image-Unable-to-get-image-tp5185933p5185947.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
JamesDudden
2015-02-06 12:49:58 UTC
Permalink
Ok, so I ran the test that you described and it worked. What do you think
this means?



-----
RegardsJD
Software-Matters
Dorset
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Error-using-quickplot-TCPDF-ERROR-Image-Unable-to-get-image-tp5185933p5185962.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
Jackie Ng
2015-02-06 13:21:29 UTC
Permalink
I'm thinking that TCPDF has issues with that particular image, and not the
source it came from.

I don't know how old that copy of TCPDF is, does replacing that copy with
the latest version (whatever it is right now) change things?

- Jackie



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Error-using-quickplot-TCPDF-ERROR-Image-Unable-to-get-image-tp5185933p5185974.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
JamesDudden
2015-02-06 15:10:11 UTC
Permalink
I downloaded the latest copy and there are a lot of files in a zipped folder
so not sure which bits I should and shouldn't be replacing but I tried just
replacing the tcpdf.php file and that produced a different error as below.
I will have another play on Monday and get back to you. Thanks

PHP Warning: require_once(C:\Program
Files\OSGeo\MapGuide\Web\www\fusion\lib\tcpdf/tcpdf_autoconfig.php)
[function.require-once]: failed to open stream: No such file or directory in
C:\Program Files\OSGeo\MapGuide\Web\www\fusion\lib\tcpdf\tcpdf.php on line
111 PHP Fatal error: require_once() [function.require]: Failed opening
required 'C:\Program
Files\OSGeo\MapGuide\Web\www\fusion\lib\tcpdf/tcpdf_autoconfig.php'
(include_path='.;C:\php\pear') in C:\Program
Files\OSGeo\MapGuide\Web\www\fusion\lib\tcpdf\tcpdf.php on line 111



-----
RegardsJD
Software-Matters
Dorset
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Error-using-quickplot-TCPDF-ERROR-Image-Unable-to-get-image-tp5185933p5185994.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
GordonL
2015-02-06 20:12:41 UTC
Permalink
I have a few tricks I usually use to get the Quick Plot working:

1. Ensure the TCPDF folder is has "Modify" granted to IUSR or "Everyone".
2. Change your HOSTS file to make sure the server "knows" its name for
example my server is called www.mapguide.ca but in my hosts file I have to
put 127.0.0.1 www.mapguide.ca
3. Sometimes I have to force the port 80 in the PlotAsPDF.php and comment
out those line in the ELSE for if("80" === $port) -- around line 177.

The first item I have to do constantly on most installs (MapGuide 2.6 and
AIMS 2015)





--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Error-using-quickplot-TCPDF-ERROR-Image-Unable-to-get-image-tp5185933p5186058.html
Sent from the MapGuide Users mailing list archive at Nabble.com.

Loading...