Page 1 of 3

thumbnail of pdf - wrong filename

Posted: Sat Jun 20, 2009 11:47 pm
by stm999999999
When I upload a pdf, ImageMagick makes a thumbnail, very fine.

But:

going to the image library, I see an empty image with the filename within.
image path: /uploads/pdf-file.serendipityThumb.pdf

Clicking on it: popup window with the Image alignment etc. - here the image has a correct thumb-filename: /uploads/pdf-file.serendipityThumb.pdf.png

the code in the article:

Code: Select all

<a class='serendipity_image_link' href='/uploads/pdf-file.pdf'><!-- s9ymdb:682 --><img width='' height='' style="float: right; border: 0px; padding-left: 5px; padding-right: 5px;" src="/uploads/pdf-file.serendipityThumb.pdf" alt="" /></a>

so, on this two places the thumb-image-filename is wrong, it misses the .png

Re: thumbnail of pdf - wrong filename

Posted: Sun Jun 21, 2009 1:50 am
by garvinhicking
Hi!

I believe this could be realted to you other problem?

When inserting a pdf file, usually only the link is inserted, never a thumbnail...?! Clicking on a pdf file in the media library should never give you the option to have a thumbnail like images do. The thumbnail is only shown in the media library usually...

Regards,
garvin

Re: thumbnail of pdf - wrong filename

Posted: Sun Jun 21, 2009 2:50 am
by stm999999999
garvinhicking wrote:Hi!

I believe this could be realted to you other problem?
no no, this is another server from another provider :D

and yes, ImageMagick makes a thumb from pdf and I can use it (except for the described error) like a normal image:

Image

strange: after rebuild the thumbs (version 2 "if the size does not fit") I do not longer get these empty image but the yellow cube in the library. Importing it with a thumb is possible in both situations.

Image

But 1) there is a thumbnail, but it is unshown in the library and 2) the created html-code has a wrong file-name. But on the "option-page" the right one is used!


the alternative (gd?) does not make pdf-thumbs and then there is only a yellow cube in the library and on a click directly the link is in the article.

Re: thumbnail of pdf - wrong filename

Posted: Thu Jun 25, 2009 12:11 am
by stm999999999
no idea for a remedy?

Re: thumbnail of pdf - wrong filename

Posted: Thu Jun 25, 2009 12:40 am
by garvinhicking
Hi!

Hm, a pdf s never meant to have a thumbnail image when being linked. So something is obviously wrong, but I currently have no way to test imagemagick on my server installation...

Regards,
Garvin

Re: thumbnail of pdf - wrong filename

Posted: Thu Jul 02, 2009 7:49 pm
by randulo
I am now having this problem too, having just updated to the latest version.

Is there a solution?

Here's what is created:

-rw-rw-r-- 1 www www 78756 Jul 2 17:45 MEVIO.pdf
-rw-rw-rw- 1 www www 25629 Jul 2 17:45 MEVIO.serendipityThumb.pdf.png
-rw-rw-rw- 1 www www 0 Jul 2 17:45 MEVIO.serendipityThumb.pdf

the last file shouldn't exist at all. The pdf.png is as the other person says, a nice icon of the PDF.

The resulting uploaded media is not placeable in posts.

Powered by Serendipity 1.4.1 and PHP 4.4.9

Re: thumbnail of pdf - wrong filename

Posted: Fri Jul 03, 2009 7:21 pm
by stm999999999
I am now having this problem too, having just updated to the latest version.
gd-lib or imageMagick?
-rw-rw-r-- 1 www www 78756 Jul 2 17:45 MEVIO.pdf
-rw-rw-rw- 1 www www 25629 Jul 2 17:45 MEVIO.serendipityThumb.pdf.png
-rw-rw-rw- 1 www www 0 Jul 2 17:45 MEVIO.serendipityThumb.pdf

the last file shouldn't exist at all. The pdf.png is as the other person says, a nice icon of the PDF.

The resulting uploaded media is not placeable in posts.
workaraound: manually add the .pdf in the html-code of the post.

Re: thumbnail of pdf - wrong filename

Posted: Fri Jul 03, 2009 8:46 pm
by randulo
Hmmmm you mean if I changed it it might help? I'll try (I believe it's ImageMagik at the moment)

Ok, it kind of looks like it works with gd. Too bad because those icons looked good with ImageMagick. Still if it works, don't fix it.

Thanks

Re: thumbnail of pdf - wrong filename

Posted: Fri Jul 03, 2009 10:57 pm
by stm999999999
Ok, it kind of looks like it works with gd. Too bad because those icons looked good with ImageMagick.
So, if you want to have this nice icon feature, use still imageMagick and when you add a pdf to a post:

Code: Select all

<a class='serendipity_image_link' href='/uploads/pdf-file.pdf'><!-- s9ymdb:682 --><img width='' height='' style="float: right; border: 0px; padding-left: 5px; padding-right: 5px;" src="/uploads/pdf-file.serendipityThumb.pdf" alt="" /></a>
manualy: src="/uploads/pdf-file.serendipityThumb.pdf" to src="/uploads/pdf-file.serendipityThumb.pdf.png"

Re: thumbnail of pdf - wrong filename

Posted: Sat Jul 04, 2009 7:51 am
by randulo
Thabnks, I see how that would work as a work around, but we computers and CMS to avoid that kind of thing :)

Re: thumbnail of pdf - wrong filename

Posted: Sat Jul 04, 2009 10:49 am
by garvinhicking
Hi!

I'll try to reproduce this in my server and see if I can come up with a fix for imagemagick! Might take me a few days tho.

Regards,
Garvin

Re: thumbnail of pdf - wrong filename

Posted: Sat Jul 04, 2009 12:02 pm
by randulo
Hi Garvin,

Well what's important is the work around, which for some reason wasn't published before. I'm trying to get my user to go rent somewhere else so I am in no hurry for a fix now :)

regards,

r

Re: thumbnail of pdf - wrong filename

Posted: Sat Jul 04, 2009 4:08 pm
by stm999999999
I'll try to reproduce this in my server and see if I can come up with a fix for imagemagick!
Do you think it is a problem with imagemagick?

the problem seems to be that the library-code do not take the right filename!?

But the right code must be in s9y already:
going to the image library, I see an empty image with the filename within.
image path: /uploads/pdf-file.serendipityThumb.pdf

Clicking on it: popup window with the Image alignment etc. - here the image has a correct thumb-filename: /uploads/pdf-file.serendipityThumb.pdf.png

Re: thumbnail of pdf - wrong filename

Posted: Sat Jul 04, 2009 4:13 pm
by randulo
Actually if I take the trouble to think about this and since you're looking into it, Garvin, I would recommend a code change next release: in the graphics config, I'd give the choice of PDF icons if ImageMagick is selected (btw, what else does ImageMagick know how to make icons for?) Or, fix the code if you feel like it.

The manual workaround in each post is fine for saving the day until then, but I won't be doing that kind of work in each post.

Re: thumbnail of pdf - wrong filename

Posted: Fri Jul 10, 2009 4:20 pm
by garvinhicking
Hi!

Sorry it has taken me some time. I've now hopefully committed a fix to this in SVN. The fix relies on a stub .serendipityThumb.pdf file (which can be empty) to detect a PDF thumbnail. The upside of this is that also old uploaded thumbnails will now be properly displayed when you use the patch.

If you want you can patch your files manually, it is only a few lines:

http://svn.berlios.de/viewvc/serendipit ... threv=2545

Regards,
Garvin