Hi all!
Thanks for this great module, nice work...

I can't solve this problem: when I try to use printPDF on nodes with images loaded by imagefield/filefield, I get this error 'TCPDF ERROR: [Image] No such file or directory'.
In fact the url is wrong!

Could someone help me? I've to fix it... :D
Thank you!

Comments

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

Can you tell me what is the correct URL to the image and what is the URL that the system is using?

João

m4t’s picture

Sure!

This is the wrong one: /var/www/vhosts/magicnet.it/subdomains/demo/httpdocs/sites/default/files/giardinoboboli1.jpg?1238514810
And this is the correct url for FTP program: /httpdocs/sites/default/files/giardinoboboli1.jpg

marklein’s picture

I have the same problem.

jcnventura’s picture

Are you guys using the private filesystem option?

João

m4t’s picture

No, I'm not using private folders.
My settings for 'files' folder are: 775

jcnventura’s picture

Actually, I am more interested in knowing what is the File system path setting in admin/settings/file-system. Can you tell me that?

João

m4t’s picture

Folder: sites/default/files

Temp folder: /tmp

Settings: public download method

jcnventura’s picture

Title: Problem with PrintPDF: No such file or directory » TCPDF problem with images with a numerical query

Looking again at your reply in #2, it's obvious that I've been asking the wrong questions.. What's that number after the file extension and what is it doing there??

João

boabjohn’s picture

G'Day João,

Thanks for pointing me over to this issue. Not sure I can assist though, since I have no idea where the post-pended "?xxxx" is coming from.

The file itself has no such number. The clue must be in the "?" yes? Some process is trying to create an executable URL?

Here is a page that fails (with ordinary jpg images, no spaces, numbers in the filenames, called in through a view):
http://ruralpracticechange.boab.info/presentations

TCPDF ERROR: [Image] No such file or directory in /home/boab-info/htdocs/drupal/sites/ruralpracticechange.boab.info/files/00-intro-title-campbell-sm.jpg?1229090688

Weirdly, something I have never noticed, if I simply right click and view properties for the images on this page, they have the mysterious "?xxx" suffix.

On the server, both of these paths resolve:
http://ruralpracticechange.boab.info/sites/ruralpracticechange.boab.info...
http://ruralpracticechange.boab.info/sites/ruralpracticechange.boab.info...

This must be the View or something to do with the rich text editor and how it is handling thumbnails?

I looked on the server but there is no trace of the suffix. If I knew how to look in the database I might be able to search for one of the suffix terms and back track from there...

Another line of thought:

The images are in the node's teaser. They are called through the View as "image linked to node"

In the example above, the node is:
http://ruralpracticechange.boab.info/pannell-1

I created a CCK field called Teaser, and Teaser Image.

Teaser Image uses a CCK imagefield widget

I have the latest version installed: ImageField 6.x-3.0-rc1

Not sure if that helps unravel the mystery. Thanks for your insights and suggestions!

JB

jcnventura’s picture

There's some new interesting information coming from #441740: Images are shown as link in printer friendly page:

Hi,

Thanks for the URL.. I think you can turn off public access.. Next time, it might be better to send me the link via PM, if public access is an issue.

The problem with the images is really strange.. On one hand, there's the filename.jpg?0123456 problem reported in #420460: problem with images with a numerical query.

On the other hand, something is doing a redirect from:

http://example.com/sites/default/files/filename.jpg?1236009707

to

http://example.com/sites/all/modules/filefield/icons/protocons/16x16/mim...

when being accessed inside the print node..

This is a problem originating in the filefield module for sure, so I am going to mark this issue as duplicate and you can follow the progress in #420460: problem with images with a numerical query..

João

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Fixed

I've just committed some code to CVS which should fix this issue. Please wait until tomorrow and try the dev version.

castawaybcn’s picture

I have a similar issue with the images provided by the Brilliant Gallery module. The error I get is:
TCPDF ERROR: [Image] No such file or directory in /my_site_path/sites/all/modules/brilliant_gallery/image.php?imgp=L2hvbWUvcG9ybWVkaWEvcHVibGljX2h0bWwvaWJhY2Evc2l0ZXMvZGVmYXVsdC9maWxlcy9nYWxlcmllcy90ZXJyYXNzYS92aXNpdGVzLzA5MDUwNi9GdXN0YV9kZV9QaV9JcGUuSlBH&imgw=100&imgh=67

Any ideas?

EDIT:
sorry, I just realized this issue was closed, on top of that I am using 6.x-1.6, João, should I just delete this and open a new issue?

jcnventura’s picture

Yes, please open a new issue.

Unfortunately the fix committed for this one only looks for numbers after the query, so it will do nothing in your case.. I have to try to come up with a different pattern to remove the extra stuff from the URL.

João

Status: Fixed » Closed (fixed)

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

d.sibaud’s picture

Title: TCPDF problem with images with a numerical query » problem with images with a numerical query
Version: 6.x-1.4 » 6.x-1.9
Status: Closed (fixed) » Active

I'm experiencing the same issue with imagefield images and dompdf 6.x:

[__construct file:///var/www/www.nerodisole.it/sites/www.nerodisole.it/themes/nds/logo.png]resolve_url(file:///var/www/www.nerodisole.it/sites/www.nerodisole.it/themes/nds/logo.png,http://,www.nerodisole.it,/it/content/)()/tmp/ca_dompdf_img_V88KlO
[resolve_url file:///var/www/www.nerodisole.it/sites/www.nerodisole.it/themes/nds/logo.png||/tmp/ca_dompdf_img_V88KlO.png|png][__construct file:///var/www/www.nerodisole.it/sites/www.nerodisole.it/files/prodotti/epinephelusgoreensis_0.jpg?1308064144]resolve_url(file:///var/www/www.nerodisole.it/sites/www.nerodisole.it/files/prodotti/epinephelusgoreensis_0.jpg?1308064144,http://,www.nerodisole.it,/it/content/)()/tmp/ca_dompdf_img_1bMYMJ
[resolve_url file:///var/www/www.nerodisole.it/sites/www.nerodisole.it/files/prodotti/epinephelusgoreensis_0.jpg?1308064144|file:///var/www/www.nerodisole.it/sites/www.nerodisole.it/files/prodotti/epinephelusgoreensis_0.jpg?1308064144(missing)|/var/www/tourtools-drupal-6/sites/all/modules/print/lib/dompdf/lib/res/broken_image.png|png][__construct file:///var/www/www.nerodisole.it/sites/www.nerodisole.it/themes/nds/images/footer-logo.png]resolve_url(file:///var/www/www.nerodisole.it/sites/www.nerodisole.it/themes/nds/images/footer-logo.png,http://,www.nerodisole.it,/it/content/)()/tmp/ca_dompdf_img_wGQQeF
[resolve_url file:///var/www/www.nerodisole.it/sites/www.nerodisole.it/themes/nds/images/footer-logo.png||/tmp/ca_dompdf_img_wGQQeF.png|png]get_min_max_width() auto auto;527.248503937pt auto;527.248503937pt auto;110 140|82.5 105;get_min_max_width() 583px 400px;527.248503937pt auto;527.248503937pt auto;17 17|437.25 300;[image:/tmp/ca_dompdf_img_V88KlO.png|png]!!!png!!![addImagePng /tmp/cpdf_img_mzmhnB.png][addImagePng /tmp/cpdf_img_5e0Svx.png][image:/var/www/tourtools-drupal-6/sites/all/modules/print/lib/dompdf/lib/res/broken_image.png|png]!!!png!!![addImagePng /tmp/cpdf_img_DET3St.png][addImagePng /tmp/cpdf_img_rb2ggq.png]get_min_max_width() auto auto;527.248503937pt auto;527.248503937pt auto;32 46|24 34.5;[image:/tmp/ca_dompdf_img_wGQQeF.png|png]!!!png!!![addImagePng /tmp/cpdf_img_hHIL1m.png][addImagePng /tmp/cpdf_img_QkTURj.png][clear unlink /tmp/ca_dompdf_img_V88KlO.png][clear unlink /tmp/ca_dompdf_img_wGQQeF.png]

as you can see the logo image is found, but the imagefield image is not found due to the timestamp attached "?1308064144",

I tried to modify the print_pdf.pages.ing regexp at line 252:

$pattern = "!(<img\s[^>]*?src\s*?=\s*?['\"]?{$base_url}[^>]*?)(?:%3F|\?)[\w=&]+([^>]*?>)!is";
$html = preg_replace($pattern, '$1$2', $html);

but without any success, please help me.

d.sibaud’s picture

Version: 6.x-1.9 » 6.x-1.12

pardon, the print version used was the last one

jcnventura’s picture

Status: Active » Closed (fixed)

@tourtools: please open a new issue, and if possible instead of a confusing log tell me the following:

1. The URL of the image as in the HTML source of that page
2. The path which the above log complains about
3. The true location of that image in your server