Any body can help me out on this?

TCPDF error: Missing or incorrect image file: /tmp/jpg3ZWIpZ

Always show this error message, how to set up the tcpdf_config.php file to avoid this ?

thanks in advance.

CommentFileSizeAuthor
#11 print_pdf.pages_.inc_.patch1.25 KBjoostvdl

Comments

jcnventura’s picture

Hi,

I have no idea how you can avoid this, but I just wanted to let you know that the module self-configures TCPDF, so nothing you modify in the tcpdf_config.php file makes any difference.

Is this image path in the HTML printer-friendly page?

João

cybershan’s picture

Status: Active » Closed (fixed)

Yes, the image is in the HTML page.

it might be my drupal set up problem..

thanks João.

joostvdl’s picture

Status: Closed (fixed) » Active

I have the same problem here. It has to do with private files setting. In my case I have FCKEditor to place the file. It makes the url then in the form of /system/files/.....

My error is: TCPDF ERROR: Missing or incorrect image file: /customer/www/web88/web/nl/system/files/image/Nieuwsbrief/MOUSAKA.JPG

Witch point in this case to the changed path of the file due to the private option. This problem was also the case with mime mail module.

joostvdl’s picture

jcnventura’s picture

@joostvdl: I see that the path includes "nl".. What is the real path?? Are you by the way using the i18n module?

I am thinking this may be a duplicate of #388396: Remove i18n path suffix from image URLs used by TCPDF.

João

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)
joostvdl’s picture

This seems to be the problem. When I manually remove the country code from the source, the conversion to PDF works fine. The patch provided does not work because the regular expression doesn't find a correct pattern with the country code still in place. So the stripping of the country code has to be done earlier, or the pattern has to be altered so it skips the country code.

jcnventura’s picture

Just a question: which module is adding your country code?

As to the patch, I don't like the fact that it replaces everything (and not only the image paths going to TCPDF), so that's the reason why I haven't committed it yet. The side-effects of that approach are so many that for sure the final patch will be substantially different.

João

joostvdl’s picture

I use FCKEditor to place the images. So that adds the country code to the source.

joostvdl’s picture

Also the function i18n_get_lang does not exist in D6 so the patch doesn't work at all....

joostvdl’s picture

StatusFileSize
new1.25 KB

I have created a patch. Please check it.

jcnventura’s picture

I take it that this is working for you?

Confirming my previous answer in the other issue*, this patch uses a couple of variables defined by the locale module. I don't really like the whole pattern duplication that is going on in the module (makes it harder to maintain), but I think that a simple modification to your patch will maintain the same functionality while eliminating the pattern duplication. I will do that soon.

João

* which is now marked duplicate of this one, as I will be commenting on this one alone.

joostvdl’s picture

Yes this patch works great for me. I'm no php developer so I think that some smart changes are doable for you ;-)

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Fixed

I have just committed some code to remove the country code, similar to joostvdl's patch in #11.
It should be in the dev version in a couple of hours.

João

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.