Does PDF Thumbnails work?

lamur

Joined: 2004-12-11
Posts: 50
Posted: Sat, 2004-12-11 17:36

Greetings. I was just wondering if PDF thumbnails worked on the new G2 that was released. Because I can upload the .pdf file. But it still has no thumbnail.
Also, in my Modules Site Administration the Thumbnail Manager is not active, so I tryed to "Activate" it and it comes up with this page:

Error (ERROR_MISSING_OBJECT) : GalleryGroup
in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 1613 (gallerystatus::error) 
in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 284 (mysqldatabasestorage::_describeentitymembers) 
in modules/core/classes/GalleryStorage.class at line 113 (mysqldatabasestorage::loadentities) 
in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 89 (gallerystorage::loadentities) 
in modules/core/classes/GalleryCoreApi.class at line 2018 (galleryentityhelper_simple::loadentitiesbyid) 
in modules/core/classes/helpers/GalleryPermissionHelper_advanced.class at line 93 (gallerycoreapi::loadentitiesbyid) 
in modules/core/classes/helpers/GalleryPermissionHelper_advanced.class at line 74 (gallerypermissionhelper_advanced::_postgroupevent) 
in modules/core/classes/GalleryCoreApi.class at line 537 (gallerypermissionhelper_advanced::addgrouppermission) 
in modules/thumbnail/classes/ThumbnailHelper.class at line 213 (gallerycoreapi::addgrouppermission) 
in modules/thumbnail/module.inc at line 122 (thumbnailhelper::additem) 
in modules/core/AdminModules.inc at line 108 (thumbnailmodule::activate) 
in main.php at line 170 (adminmodulescontroller::handlerequest) 
in main.php at line 47
in main.php at line 40

Some info you might want:
GD Version 2.0.28 (Bundled)
ImageMagic 5.5.6
NetPBM Passed everything

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2004-12-11 18:51

that bug is fixed.. update to current cvs or nightly snapshot.

to get thumbnails for pdf you can:
1) use thumbnail manager to assign a default thumbnail used for all pdfs
2) make sure you have both imagemagick and gs (ghostscript) on your system and activate the G2 imagemagick module.. then you'll get pdf thumbnails of the first page of the pdf. you can additionally activate the Thumbnail Page module which lets you pick which page# to use for the thumbnail (edit document / thumb page tab)

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Sun, 2004-12-12 07:33

How do I update to the lastest CVS or nightly snapshot? I have no idea what these are.
Thanks

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Sun, 2004-12-12 07:42

Look at the FAQ stickied in this forum.

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Sun, 2004-12-12 08:04

So apparently to us the CVS you have to have the Unix Command line, which I do not run the server locally and my host does not give me a command line..

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Sun, 2004-12-12 08:14

Take another look at the FAQ, looking for "nightly" zip/tar files.

 
CSpotkill

Joined: 2004-12-11
Posts: 113
Posted: Sun, 2004-12-12 08:31

http://galleryupdates.jpmullan.com/ - I think.

If you're feeling adventurous, try WinCVS or TortoiseCVS

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Sun, 2004-12-12 18:29

That's what I needed. Thanks. I udpated and the Thumbnail manager works. Apparently my hosting company does not have Ghostscript on their system, so I e-mailed them asking to set it up for me. So that should fix the PDF auto thumbnail for me.

One thing I think this needs though, is to be able to assign a thumbnail to each file. Instead of having ONE default image for all .pdf files. You should be able to assign 1 image to 1 .pdf file. Just a thought..

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Mon, 2004-12-13 01:14

By the way I do use Powweb.com
Does anyone else have problems on Powweb ?

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2004-12-13 04:48

I haven't heard too many complaints about PowWeb. If you're having problems with them, please let me know. Remember that they're geared up to support Gallery 1.x, and are only coming up to speed on Gallery 2.x now (remember that G2 is still an alpha product!).

We have plans to allow you to assign a custom thumbnail to each file. Won't happen in the near future, but it will happen.

 
jmullan
jmullan's picture

Joined: 2002-07-28
Posts: 974
Posted: Mon, 2004-12-13 08:53
CSpotkill wrote:
http://galleryupdates.jpmullan.com/ - I think.

If you're feeling adventurous, try WinCVS or TortoiseCVS

Yes.

Also, yes, and yes. You can find some ancient and rudimentary WinCVS instructions on my galleryupdates site, also.

 
CSpotkill

Joined: 2004-12-11
Posts: 113
Posted: Mon, 2004-12-13 09:30
jmullan wrote:
You can find some ancient and rudimentary WinCVS instructions on my galleryupdates site, also.

I'm using the latest version of WinCVS for pulling G2 right now ... though I didn't see your instructions ;)

Oooh, after looking at them now, they really are out of date.

It's now a lot easier to checkout source code in WinCVS:

Quote:
  1. Click Check out module on the Remote menu.
  2. On the Checkout Settings tab, type gallery2 for the Module name and path on server.
  3. For Local folder to check out to, choose a path by clicking the ... button on the right. It will create a new folder named gallery2 in the specified path to store the source code.
  4. Make sure the CVSROOT check box is selected, then copy and paste the following in to the box on the right:
    :pserver;username=anonymous;hostname=cvs.sourceforge.net:/cvsroot/gallery
  5. By now, the Checkout settings window should look something like this:

    [img]http://www.cszen.com/checkoutsettings.png[/img]

  6. Click OK. Lots of green and orange text will scroll by in part of the main window. Don't worry, that's normal and means it's downloading the source code with CVS.
  7. After a few minutes, it should say CVS exited normally with code 0. That means it's done. :)

Tip
To speed up future checkouts, leave the files you've already checked out in the same folder, and when it comes time to check out, browse to the /gallery2 folder in the main WinCVS window. Right-click it, and choose Update. Select the Get the clean copy check box and click OK to begin updating.

[img]http://www.cszen.com/updatefolderwincvs.png[/img]

How does this speed it up? Well, it means that only files that have been changed since you last updated will be downloaded, saving you a lot of time.

Troubleshooting
If it says CVS exited normally with code 1 then we've a problem. Double-check the Local folder to check out to path you used. Make sure there isn't already a gallery2 folder with files in it. If there is, delete all the files in the folder first or try using the Update command instead (See tip).

Feel free to update your web page with these instructions, or repost them in the G2 FAQ (or in a separate stickied thread). If you use them, please give credit to Louis St-Amour (CSpotkill), if possible. Also, please save the image locally, as it is currently hosted on my home ADSL connection. Thanks.[/]

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Mon, 2004-12-13 20:00

Wowser, nice lookin instructions CSpot.

Well I contacted Powweb and they do have Ghostscript v7.97 enabled and everything else... So now I am wondering why no PDF thumbnail... Any suggestions on what I should check to see if it's enabled? I do know it's Alpha and still has stuff to work out, I just love playing around with it :)

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2004-12-13 20:21

gs needs to be in your path so imagemagick can find it.
does "identify modules/imagemagick/test/data/test.pdf" work?

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Mon, 2004-12-13 21:33

I am not 100% sure what you mean. But I went into the admin section, clicked on ImageMagick and clicked "test Settings". and it came back:

ImageMagick binary test results
Binary Name Pass/Fail
identify Passed
convert Passed
composite Passed

(Also, how could I edit the gallery, so that I can just view the gallery, click on the pdf file and have it go directly to the PDF instead of going to the NEXT page where it says "download this document" ? )

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2004-12-14 00:31

I meant trying the identify command from the command line when logged into your server.

You could accomplish the direct download using a layouts/matrix/templates/albumBody.tpl.local
change this code:

    {capture name="link"}<a href="{g->url arg1="view=core:ShowItem"
                                          arg2="itemId=`$child.id`"}">{/capture}

to:

    {capture name="link"}<a href="{if $child.mimeType == "application/pdf"}{g->url
      arg1="view=core:DownloadItem" arg2="itemId=`$child.id`"}{else}{g->url
      arg1="view=core:ShowItem" arg2="itemId=`$child.id`"}{/if}">{/capture}

I think that works.. you might also need isset($child.mimeType) in the "if"

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Tue, 2004-12-14 03:02

Didnt work.

I could P.M someone the link to the gallery and give them admin privilages and see if they could get it to work that way?

can I trust someone with this?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2004-12-14 05:27

hmm, i tried it out.. i'll give as much detail as you did :)

It worked.

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Tue, 2004-12-14 05:59

Well, I went into the .tpl and replaced the code with:

Quote:
{capture name="link"}<a href="{if $child.mimeType == "application/pdf"}{g->url
arg1="view=core:DownloadItem" arg2="itemId=`$child.id`"}{else}{g->url
arg1="view=core:ShowItem" arg2="itemId=`$child.id`"}{/if}">{/capture}

uploaded, and then uploaded another .pdf file to see if it created a Thumbnail and it still didnt.

**UPDATE** this does work

 
CSpotkill

Joined: 2004-12-11
Posts: 113
Posted: Tue, 2004-12-14 06:10

The {capture name="link"} code is only to directly download the .pdf file from the link/thumbnail, it won't magically fix the thumbnail problem on its own, that's something else, probably configuration-related. I'd recommend re-installing a recent GhostScript 8 RPM (on Linux) or using the installation wizard on Windows. If you leave it in the default installation directory, ImageMagick should find it, no problemo.

As for adding the code to the if statement, I'd assume it would look something like this:

{capture name="link"}<a href="{if isset($child.mimeType) && $child.mimeType == "application/pdf"}{g->url
arg1="view=core:DownloadItem" arg2="itemId=`$child.id`"}{else}{g->url
arg1="view=core:ShowItem" arg2="itemId=`$child.id`"}{/if}">{/capture}

All that should do is see whether child.mineType is set before confirming the value as "application/pdf". Again, it also won't magically fix the thumbnail problem, but it might prevent errors if there isn't a mimeType for the item. Or something like that.

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Tue, 2004-12-14 07:34

Ok, yea that worked perfect, I got a little confused on a few issues, but they got resolved. So it does go directy to them.

Now on to the thumbnail making again.... This is wacky..

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Tue, 2004-12-14 07:40

Could there be a certain folder that I am not CHMODing correctly? The only one I did was g2data at 777

Also, I uploaded a typical JPG file and there WAS a thumbnail created for it..

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Thu, 2004-12-16 06:16

I recon I am just S.O.L. I will wait until the beta and install it and see if my Thumbnails appear. Thanks for the help though.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2004-12-16 16:06

you never posted the output of the identify command from the command line..

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Thu, 2004-12-16 20:51

The identify command is not recognized on the server... Is there any other way of doing this output to a Powweb.com server? Does anyone know?

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Fri, 2004-12-17 05:34

I'm not familiar with what PowWeb offers, but they have good tech support so you could forward this forum thread to them and ask them if they can help and see what comes of it...

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Fri, 2004-12-17 18:59

ok, here is a new error when I try and upload 3 or more PDF files

Quote:
Error (ERROR_PLATFORM_FAILURE)
in modules/core/classes/GalleryDataItem.class at line 186 (gallerystatus::error)
in modules/core/classes/GalleryUnknownItem.class at line 77 (gallerydataitem::create)
in modules/core/classes/helpers/GalleryItemHelper_medium.class at line 206 (galleryunknownitem::create)
in modules/core/classes/GalleryCoreApi.class at line 1327 (galleryitemhelper_medium::additemtoalbum)
in modules/core/ItemAddFromBrowser.inc at line 79 (gallerycoreapi::additemtoalbum)
in modules/core/ItemAdd.inc at line 77 (itemaddfrombrowser::handlerequest)
in main.php at line 170 (itemaddcontroller::handlerequest)
in main.php at line 47
in main.php at line 40

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2004-12-17 21:40

that's an error from trying to copy the uploaded file to its location in g2data/albums.
enable debug output to get more detail on the error, if it is reproducible.
is the disk full or something like that?

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Sat, 2004-12-18 05:36

I enabled Debuggin, and it just linked to the files that was giving the errors.. it was the same error. No the disk is not even close to being full.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sat, 2004-12-18 22:12

The problem is that you're only including part of the debug output (the stack trace) which doesn't include other information that we really need to diagnose your problem. Can you take all the debug output, save it into a file, put it on your website and post a link to it here? That will probably help us figure out what's going wrong.

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Mon, 2004-12-20 21:33

See if this works:

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2004-12-21 01:25

that appears to be an error stack trace, but there is no debug output.

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Tue, 2004-12-21 05:36

I am currently updating the software with the vary latest CVS version and deleted all the MYSQL files, just doing a complete reinstall.. Hope it works :)

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Tue, 2004-12-21 12:02

It didnt... still won't create thumbnails..

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2004-12-21 16:41

how about you put your G2 in buffered debug mode and PM me a G2 username/passwd I can use to upload items (either your admin login or a new user with appropriate permissions to add items).

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Wed, 2004-12-22 16:01

Let me know how it goes Mindless

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2004-12-22 17:00

so, I posted waaaay back in this topic:

Quote:
gs needs to be in your path so imagemagick can find it.

take a look at the list of supported mime types in thumbnail manager or the Test Settings output from Imagemagick site admin... the mime type for PDF is NOT listed! this means imagemagick isn't finding ghostscript so it won't support pdf.

put this test.php file in your gallery2 directory:

<?php system("/usr/local/bin/identify modules/imagemagick/test/data/test.pdf");
print "---------------";
system("which gs"); ?>
 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Wed, 2004-12-22 21:22

I added test.php in the root directory so you can check it out.

Also, I did the "test settings" for imagemagic and the supported MIME types are:
image/gif
image/jpeg
image/pjpeg
image/jp2
image/jpg2
image/jpx
image/png
image/tiff
image/svg+xml
image/bmp
application/pdf
application/postscript

So it does show pdf support?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2004-12-23 00:47

haha, yes it turns out your problem is intermittent.. try "test settings" a few times and you'll see pdf only shows up sometimes.

I tried test.php and see that gs is in /usr/local/bin/gs, so it is installed ok. Here's the error message from running "identify" that I see from test.php:

Quote:
Unrecoverable error: rangecheck in .putdeviceprops

now you have something to give your webhost.. give them the identify command too and ask them to make sure that command works reliably.

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Fri, 2004-12-24 06:26

Holiday is getting me a bit busy, but come monday or tuesday I will write them a note and see if they can figure it out.

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Thu, 2004-12-30 05:44

Waiting on the E-mail from Powweb

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Tue, 2005-01-04 04:17

Ok, they are not responding.. anything else I can do?

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2005-01-04 05:58

I pinged JadeaDragon, who does tech support for PowWeb. Hopefully she'll respond here soon with advice.

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Fri, 2005-01-07 00:37

Great, Thanks

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Mon, 2005-02-07 19:41

I hate to bring this back up, but has anyone figured this out or have any fixes for this?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2005-02-07 21:04

if your webhost has some broken software installed and won't fix it then i guess you could try installing your own copy of imagemagick and give the appropriate path to the G2 imagemagick module.

 
lamur

Joined: 2004-12-11
Posts: 50
Posted: Wed, 2005-02-09 06:11

Ok, I will need some direction on how to install imagemagick, and where to get it...
(sorry to be so illiterate)

 
laughingtiger

Joined: 2005-10-14
Posts: 8
Posted: Tue, 2005-11-08 16:16

Hello,

I've got the latest release of G2 installed using the latest version of the PG theme and I'm able to see .pdf as supported file type. However, G2 does not generate thumbnails of the pdf. It creates a broken document icon and a link to the document download. Any ideas?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-11-08 16:29

so in site admin -> imagemagick, when you click test, it lists application/pdf or something like that? only then you can expect thumbs for pdf.

if you get the broken thumbnail and we're talking about the same broken thumbnail (modules/core/data/broken-image.gif), then it tries to generate thumbs for pdf but it fails.
then you'll have to activate buffered debug mode and do
site admin -> maintenance -> build thumbs and resizes

 
laughingtiger

Joined: 2005-10-14
Posts: 8
Posted: Tue, 2005-11-08 17:10
valiant wrote:
so in site admin -> imagemagick, when you click test, it lists application/pdf or something like that? only then you can expect thumbs for pdf.

if you get the broken thumbnail and we're talking about the same broken thumbnail (modules/core/data/broken-image.gif), then it tries to generate thumbs for pdf but it fails.
then you'll have to activate buffered debug mode and do
site admin -> maintenance -> build thumbs and resizes

Thanks for the prompt response. Imagemagick does show pdf as a supported MIME type. I rebuilt thumbs and resizes to no avail. I believe the pertinent error output is as follows:

Error: /undefined in /BXlevel
Operand stack:
--dict:5/5(L)-- 1 --dict:6/6(ro)(G)-- xref
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval--
--nostringval-- 2 %stopped_push --nostringval-- --nostringval--
--nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3
%oparray_pop 1 3 %oparray_pop --nostringval-- --nostringval--
--nostringval-- --nostringval-- %loop_continue --nostringval--
false 1 %stopped_push --nostringval-- %loop_continue
--nostringval-- --nostringval-- --nostringval--
Dictionary stack:
--dict:1072/1123(ro)(G)-- --dict:0/20(G)-- --dict:93/200(L)--
--dict:93/200(L)-- --dict:97/127(ro)(G)-- --dict:229/230(ro)(G)--
--dict:16/24(L)--
Current allocation mode is local
Error Output:
GNU Ghostscript 7.07: Unrecoverable error, exit code 1
identify: Postscript delegate failed
`/home/httpd/vhosts/gallery.cinemadesigngroup.com/httpdocs/gallery/g2data/albums/Dealer
Backpages/testpdf/CDGi_Theater_Seat_Models.pdf'.
Status: 1 (expected 0)
chdir(/home/httpd/vhosts/gallery.cinemadesigngroup.com/httpdocs/gallery)
realpath(/home/httpd/vhosts/gallery.cinemadesigngroup.com/httpdocs/gallery/modules/core/classes/../../../)

Error (ERROR_TOOLKIT_FAILURE)in
modules/imagemagick/classes/ImageMagickToolkit.class at line 405
(gallerystatus::error)
in modules/imagemagick/classes/ImageMagickToolkit.class at
line 130 (imagemagicktoolkit::_getimagedimensions)
in modules/core/classes/GalleryDerivative.class at line 483
(imagemagicktoolkit::performoperation)
in modules/core/classes/GalleryDerivative.class at line 312
(galleryderivativeimage::_rebuildcache)
in modules/core/classes/GalleryDerivativeImage.class at line
175 (galleryderivative::rebuildcache)
in
modules/core/classes/helpers/GalleryDerivativeHelper_advanced.class at
line 703 (galleryderivativeimage::rebuildcache)
in modules/core/classes/GalleryCoreApi.class at line 830
(galleryderivativehelper_advanced::rebuildcache)
in
modules/core/classes/helpers/GalleryDerivativeHelper_simple.class at
line 66 (gallerycoreapi::rebuildderivativecache)
in modules/core/classes/GalleryCoreApi.class at line 817
(galleryderivativehelper_simple::rebuildcacheifnotcurrent)
in modules/core/classes/BuildDerivativesTask.class at line
92 (gallerycoreapi::rebuildderivativecacheifnotcurrent)
in modules/core/AdminMaintenance.inc at line 104
(buildderivativestask::run)
in ??? at line 0 (adminmaintenancecontroller::runtask)
in modules/core/classes/GalleryTemplateAdapter.class at line
730
in
g2data/smarty/templates_c/%%3681953864/%%0B^0B4^0B4F6589%%theme.tpl.php
at line 267 (gallerytemplateadapter::trailer)
in lib/smarty/Smarty.class.php at line 1251
in modules/core/classes/GallerySmarty.class at line 90
(smarty::fetch)
in modules/core/classes/GalleryTemplate.class at line 228
(gallerysmarty::fetch)
in main.php at line 316 (gallerytemplate::display)
in main.php at line 87
in main.php at line 80

copy(/home/httpd/vhosts/gallery.cinemadesigngroup.com/httpdocs/gallery/modules/core/classes/../data/broken-image.gif,
/home/httpd/vhosts/gallery.cinemadesigngroup.com/httpdocs/gallery/g2data/cache/derivative/4/8/4837.dat)

Thanks again!

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-11-08 17:16
Quote:
GNU Ghostscript 7.07: Unrecoverable error, exit code 1
identify: Postscript delegate failed

the module reports pdf is supported because ghostscript is present.. however, it appears it isn't working, at least for this file.