TCPDF crashes when generating with an embedded image

TCPDF crashes when generating with an embedded image

autor Brian Etheridge -
Počet odpovědí: 2

My Moodle is trying to generate a PDF but crashes when it has an embedded image.   If I take the image out, it generates perfectly well.  Unfortunately the image is an essential part of the document and I am unable to work around the problem.

I am running TCPDF  5.9.181 and Moodle 2.4.2.

The readme_moodle.txt mentions the removal of a number of directories and I am wondering if this is relevant and that the problem is because the location of the image is being adjusted by Moodle and is inaccessible when required by the generator.

Thanks


Průměr hodnocení: -
V odpovědi na Brian Etheridge

Re: TCPDF crashes when generating with an embedded image

autor Howard Miller -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Particularly helpful Moodlers Obrázek: Peer reviewers Obrázek: Plugin developers

What does "crashes" look like? It's not a term that tells us anything useful...

V odpovědi na Howard Miller

Re: TCPDF crashes when generating with an embedded image

autor Brian Etheridge -

Hi Howard

Yes, sorry, I get:

TCPDF ERROR: [Image] Unable to get image: /path_to_root_directory/path_to_data_directory/temp/files/image_name.png

The path is completely scrambled.  In the PDF view definition within Moodle the embedded image is defined with a full url, however, TCPDF is generating a file system reference.  That would work except that it is messing up the path, by starting with the website root directory and then appending the path to the data directory.

So it looks as thought the problem is the path generation.

The image exists here:

/path_to_data_directory/temp/files/image_name.png

Is this a known issue?