Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1] 2   Go Down

Author Topic: PDF First page thumbnail plugin  (Read 27751 times)

0 Members and 1 Guest are viewing this topic.

hoeksma

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Posts: 4
PDF First page thumbnail plugin
« 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

« Last Edit: December 10, 2010, 12:06:02 pm by hoeksma »
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: PDF First page thumbnail plugin
« Reply #1 on: November 09, 2010, 09:03:42 am »

Thank you for your contribution.
Logged

waycik

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: PDF First page thumbnail plugin
« Reply #2 on: December 08, 2010, 06:41:53 am »

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?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: PDF First page thumbnail plugin
« Reply #3 on: December 08, 2010, 08:59:43 am »

Open codebase.php, find
Code: [Select]
if (is_pdf($file) ) && file_exists($normal)) { // is PDF    and replace with
Code: [Select]
if (is_pdf($file) && file_exists($normal)) { // is PDF   
Logged

waycik

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: PDF First page thumbnail plugin
« Reply #4 on: December 08, 2010, 04:37:38 pm »

Thank you very much  :)
Logged

waycik

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: PDF First page thumbnail plugin
« Reply #5 on: December 09, 2010, 12:04:23 am »

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.
Logged

papukaija

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 333
Re: PDF First page thumbnail plugin
« Reply #6 on: December 09, 2010, 08:59:01 pm »

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).
Logged

waycik

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: PDF First page thumbnail plugin
« Reply #7 on: December 09, 2010, 10:07:57 pm »

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
Logged

papukaija

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 333
Re: PDF First page thumbnail plugin
« Reply #8 on: December 11, 2010, 01:59:27 am »

Do you get any error messages to your server's log or cpg's log?
Logged

waycik

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: PDF First page thumbnail plugin
« Reply #9 on: December 11, 2010, 05:17:11 am »

No errors other than a failed login and missing files: favicon.ico and robots.txt, but I don't think those are related.
Logged

papukaija

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 333
Re: PDF First page thumbnail plugin
« Reply #10 on: December 11, 2010, 10:22:36 pm »

Are sure that you gave the correct absolute path to convert binary when you installed the plugin?
Logged

waycik

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: PDF First page thumbnail plugin
« Reply #11 on: December 11, 2010, 11:42:44 pm »

Yes, I used the same path as the Gallery2 install.
Logged

papukaija

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 333
Re: PDF First page thumbnail plugin
« Reply #12 on: December 12, 2010, 04:04:57 pm »

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.
Logged

waycik

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: PDF First page thumbnail plugin
« Reply #13 on: December 12, 2010, 04:44:22 pm »

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.
Logged

hoeksma

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Posts: 4
Re: PDF First page thumbnail plugin
« Reply #14 on: December 27, 2010, 10:51:57 am »

Below i provide my configuration settings, hopes this helps
 
Absolute path to convert binary:   /usr/bin/convert
Width of the PDF Image:   300
Logged

Quinn

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 20
  • Things go better with Quinn!
    • Raven
Re: PDF First page thumbnail plugin
« Reply #15 on: January 31, 2011, 12:21:48 am »

This is not working for me either. Have tried all the above suggestions with no joy.

Link to galley in my signature...

AnnuN

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: PDF First page thumbnail plugin
« Reply #16 on: May 26, 2011, 10:24:50 am »

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
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: PDF First page thumbnail plugin
« Reply #17 on: May 26, 2011, 10:48:54 am »

You guys should make sure you not only to have installed ImageMagick but also to have told CPG to make use of it.

AnnuN

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: PDF First page thumbnail plugin
« Reply #18 on: May 26, 2011, 11:01:53 am »

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
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: PDF First page thumbnail plugin
« Reply #19 on: May 26, 2011, 01:20:21 pm »

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
Pages: [1] 2   Go Up
 

Page created in 0.026 seconds with 20 queries.