Closed (duplicate)
Project:
Pdfview
Version:
4.7.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Jul 2006 at 16:10 UTC
Updated:
3 Feb 2007 at 08:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
Egon Bianchet commentedIt's the one shipped by Drupal (drupal/misc/arrow-asc.png).
What kind of node is involved?
Comment #2
mfitch commentedit's a php page generated by the tablemanager module
that generates the html output:
Last Name
The html display of the page is fine however (the arrow graphic appears)
Comment #3
Egon Bianchet commentedTry to change this line in the tcpdf config file:
define ("K_PATH_IMAGES", K_PATH_MAIN."images/");make it point to the root of your Drupal installation, as an absolute path, it should fix it.
Comment #4
mfitch commentedstill having the issue: : fopen(/misc/arrow-desc.png) [function.fopen]: failed to open stream: No such file or directory in /home/fitchinf/public_html/modules/pdfview/tcpdf/tcpdf.php on line 3056.
I have images under files/images - public_html/files/images
(misc was at the same level as drupal - public_html/misc - I copied those files to files/images/misc)
(I also copied arrow-asc.png to files/images just to see if it would help)
(the perms are 755 on the directories)
I tried
define ("K_PATH_IMAGES", K_PATH_MAIN."files/images/");
and
define ("K_PATH_IMAGES", K_PATH_MAIN."public_html/files/images/");
and
define define ("K_PATH_IMAGES", K_PATH_MAIN."/home/fitchinf/public_html/files/images/");
the pdfview module works in many other places on the site without embedded images but not when there are images.
Comment #5
Egon Bianchet commentedI committed a fix in the 4.7 version. Now it finds the image, but the output isn't good looking
Comment #6
mfitch commentednow I'm seeing a different error: FPDF error: Image file has no extension and no type was specified:
any ideas?
Comment #7
Egon Bianchet commentedI improved the image url/path filter ... check the latest 4.7 version and see if it works.
Comment #8
Egon Bianchet commentedChanged to a meaningful title
Comment #9
Egon Bianchet commentedI need someone to test this patch (see howto apply patches)
You will need to set the value of K_PATH_IMAGES inside the tcpdf_config.php file to the root of your Drupal installation, for example:
define ("K_PATH_IMAGES", "/var/www/drupal/");Comment #10
Egon Bianchet commentedI went ahead and committed it
Comment #11
Egon Bianchet commentedComment #12
Schoonzie commentedI have been having the same problem with the new version ($Id: pdfview.module,v 1.28.2.9 2006/11/13 23:34:53 egonbianchet Exp $) of this module. It was producing an fopen error because it couldn't find the file.
I had a look at the changed in the patch committed above on november 3rd (which was rolled into the version i downloaded).
The problem is that my base_path() function returns only "/", so this line was converting paths like "misc/feed.png" to "miscfeed.png" which obviously doesnt exist.
$path = str_replace(base_path(), '', $path);I just commented out that line of code, and it seems to be working correctly now.
Comment #13
Schoonzie commentedUPDATE: sorry, my code above was not entirely correct. I had to add this line of code
So the entire function should look like this:
However it looks like the tcpdf does not support Alpha channels in png files, which doesn't affect me, but might be worth noting.
Comment #14
Egon Bianchet commentedComment #15
Egon Bianchet commentedThanks for the input Schoonzie, can you check if this patch works for you? Basically I just check the base path before the string replace:
Comment #16
jorditr commentedHi you all. Last patch it's not working for me neither. But maybe is because I'm checking it on a localhost WAMP environment. Are you checking it on an online web server?
Curiously, if I comment the only line on previous pdfview_check_images function, instead of an inmediate error message it tries to rebuild the pdf file, it jumps to a new page, opens the acrobat plugin and then acrobat breacks.
Comment #17
Egon Bianchet commentedSchonzie, can you test if this using this
In place of
Works for you?
Thanks
Comment #18
pvasener commentedPersonaly, I use the 1.28.2.9 version and I also have a 'Missing or incorrect image file: /system/files/2903/something.jpg'
I guess the callback should get rid of the system or /system part of the filename but it does not. Besides it seems that the preg:
return preg_replace_callback('/(?<=src=")(.*?)(?=")/', '_pdfview_rewrite_image_url', $string);doesn't seem to match for the image as the callback is not called. Any help available please ?
Comment #19
chantra commentedI can confirm that Schoonzie patch works for me.
see attached patch
Comment #20
geme4472 commentedHello. I struggled for a while getting images to display with pdfview because I have the files folder behind the public_html folder and private downloads set. I got things to work but ended up using the _pdfview_rewrite_image_url() function to set a url to the images, like "http://mysite.com/system/files/funk.jpg". Or I can send through the full path as /home/mysite/secretfiles/images/funk.jpg and everything works. Whatever I use for the K_PATH_IMAGE const doesn't seem to matter.
I read in the install file that the K_PATH_IMAGE was prepended to the drupal filepath. Is that old documentation? Am I going to mess things up going about this the way that I did, as mentioned above?
It seems that I'm missing something here. Or is it simply because I have the files folder behind public_html?
Comment #21
Herras commentedEgon, your patch is not working for me, but Schoonzie's patch is working fine.
Now I have problems with URL Rewrite, TCPDF needs the absolute path...
Comment #22
Egon Bianchet commentedHerras, chantra, did you try #17 too?
geme4472, the documentation I wrote there makes the assumption that you're putting the files under the Drupal directory ... but if you change that path (K_PATH_IMAGES) to whatever you need to make your path absolute it should work
Comment #23
Herras commentedHello Egon!
I tried your patch and modification from #17. This is the error I got:
warning: preg_replace() [function.preg-replace]: No ending delimiter '^' found in /homepages/23/d162200924/htdocs/modules/pdfview/pdfview.module on line 253.
Comment #24
Egon Bianchet commentedI released Pdfview 4.7.x-1.1, it should fix problems with base_path
Comment #25
marcod commentedPersonaly, I use the pdfview.module 1.28.2.10 2007/01/27 version and
tcpdf.php Version : 1.53.0.TC027_PHP4 and
I also have a 'Missing or incorrect image file: /files/images/something.jpg'
I write at line 3840 of tcpdf.php :
instead of
I don't know if the right way but the other above patch not good for me
Comment #26
Tobias Maier commentedwhere's the difference between this issue and Doesn't show images in nodes?
I think they are dupes of each other