forum.coppermine-gallery.net
Support => cpg1.5 plugins => cpg1.5.x Support => cpg1.5 plugin contributions => Topic started by: hoeksma on November 09, 2010, 07:48:22 am
-
I have writen a plugin which will create for all PDF's you upload a thumbnail and normal sized picture of the first page of the PDF you uploaded. It requires ImageMagick (convert) and ghostscript to be installed.
Fixed the issue below about the file test.
Sierk
-
Thank you for your contribution.
-
I tried to install this plugin in "Coppermine Photo Gallery 1.5.10 (stable)", but all I get is:
Parse error: syntax error, unexpected T_BOOLEAN_AND in /home/XXXXXXXX/public_html/cpg15x/plugins/thumbnail_pdf/codebase.php on line 166
(I put the X's in to replace my user name)
Any chance someone could give me a little more insight into the problem?
-
Open codebase.php, find
if (is_pdf($file) ) && file_exists($normal)) { // is PDF
and replace with
if (is_pdf($file) && file_exists($normal)) { // is PDF
-
Thank you very much :)
-
I successfully installed the plugin according to the plugin manager, and I'm running Coppermine on a server that I know has imagemagick and ghostscript on it, but it doesn't seem like I'm getting any thumbnails of pdf files.
I have successfully generated thumbnails using gallery2 on the same server, but I was hoping to replace gallery2 (which is an awful gallery compared to this one) with Coppermine which I know and love.
Hopefully, I'm doing something very simple the wrong way and someone can steer me in the right direction.
Thank you.
-
someone can steer me in the right direction.
That would be much easier with a link to your gallery (which is required by board rules).
-
Oops! Sorry. I'm a newbie here.
http://www.mathshare.com
(which is also set up at http://www.math-drills.ca/mathshare/
and the gallery2 install that does work for thumbnails is http://www.math-drills.ca/gallery2/
Thanks for pointing out my mistake.
Peter
-
Do you get any error messages to your server's log or cpg's log?
-
No errors other than a failed login and missing files: favicon.ico and robots.txt, but I don't think those are related.
-
Are sure that you gave the correct absolute path to convert binary when you installed the plugin?
-
Yes, I used the same path as the Gallery2 install.
-
Maybe it's a bug in the plugin. If you want to be sure about, set the cpg's graphic engine to imagemagic in your gallery's settings and try to add some images. If that works or if you're already using imagemagic in cpg, then it's a bug in the plugin. If not, it might be a good idea to contact your hosting's support about the imagemagick.
-
I tried that already and any images I upload get thumbnailed, but the pdf files don't. Method for resizing images is set to ImageMagick and the path is /usr/bin/, same as I gave to the plugin.
-
Below i provide my configuration settings, hopes this helps
Absolute path to convert binary: /usr/bin/convert
Width of the PDF Image: 300
-
This is not working for me either. Have tried all the above suggestions with no joy.
Link to galley in my signature...
-
Dear I am using Wamp 2.0 and I already installed ghostscript 9 and Imagemagik on my system. Plugin installed successfully but I am unable to preview the PDF file.. So please help
-
You guys should make sure you not only to have installed ImageMagick but also to have told CPG to make use of it.
-
Dear in configuration I am using this path as ImageMagik is placed on this absolute path and i.e.
D:\ImageMagick\convert.exe and I am specifying D:/ImageMagick/convert.exe
and ghost script
C:\Program Files\gs\gs9.02\bin\gswin32.exe
Now tell me what o do next
-
If you do not enter the path whilst installing the gallery, CPG is using GD2
It's in the config -> file settings , something like 'method to resize images'. Make sure this is set to ImageMagick
-
Dear this is already set to ImageMagik...
Should I mention the ImageMagik path D:/ImageMagick/ or D:/ImageMagick/convert.exe
-
Dear Please help me in this regard
-
Dear this is already set to ImageMagik...
Should I mention the ImageMagik path D:/ImageMagick/ or D:/ImageMagick/convert.exe
It's documented here (http://documentation.coppermine-gallery.net/en/configuration.htm#admin_picture_thumb_advanced_im_path), there’s also a Windows specific warning (http://documentation.coppermine-gallery.net/en/install_faq.htm#enableIMonWindows). Finally, please follow board rules (http://forum.coppermine-gallery.net/index.php/topic,55415.msg270616.html#msg270616) if you need more help.
-
Hopefully this plugin is still supported and active. I've read the thread, verified with my host that both ImageMagick and ghostscript are installed and what their paths are.
Having this information and trying everything I can think of, including changing the position of active plugins and checking file and folder permissions, I can't get this plugin to work. This is a real bummer since it's exactly what I need.
Any suggestions would be great.
-
Just realized I left the domain out.
Lakelandimagegallery.com
-
Hi all,
Sorry for not responding and maitaining pluging for sometime. I did some investigations and found out that there are problems with this plugin and the version of convert. The version i use (ImageMagick 6.6.9-6 2011-04-26 on linux) has problems with PDF documents created with abobe version 9 and above. It cannot read the document, causing convert to crash. This again is not logged by plugin.
To test if your system works, enter on commandline : convert <yourpdffile> -colorspace RGB -geometry 2048 <imagefile>
If file is created then your system is capable of running plugin.
Sierk
-
I have a problem with this plugin. After convert I'm get something like that:
(http://testowausluga.osloskop.eu/albums/userpics/10001/normal_info.jpg)
-
Hi, after some investigation I find a way not only get a good quality of pdf first page but either of "eps" files. I used for it ghostscipt used directly. Only problem is that I don't know how to input it into this plugin.
gs -dQUIET -dSAFER -dBATCH -dNOPAUSE -dJPEGQ=70 -sDEVICE=jpeg -dTextAlphaBits=4 -sOutputFile=$outputfile $inputfile
After run this "gs" generate image from first page. There can be added option
-r=WIDTHxHEIGHT
Can any developer help me with replacing imagemagic/conver with this tool? It's placed in /usr/bin
-
Ok, I menage to change some code and now get error like this:
images/thumbs/thumb_pdf.png
This is oryginal code:
$cmd = "{$CONFIG['thumbnail_pdf_path']} -q -o $ff_dest_file -sDEVICE=jpeg -dPDFFitPage {$src_file}";
And I replace with this:
$cmd = 'gs -dQUIET -dSAFER -dBATCH -dNOPAUSE -dJPEGQ=70 -sDEVICE=jpeg -dTextAlphaBits=4 -sOutputFile='."{$src_file}".' '.$ff_dest_file;