thumbnail of pdf - wrong filename

Found a bug? Tell us!!
stm999999999
Regular
Posts: 1517
Joined: Wed Mar 08, 2006 12:25 am
Location: Berlin, Germany
Contact:

thumbnail of pdf - wrong filename

Post by stm999999999 » Sat Jun 20, 2009 11:47 pm

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
Ciao, Stephan

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: thumbnail of pdf - wrong filename

Post by garvinhicking » Sun Jun 21, 2009 1:50 am

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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

stm999999999
Regular
Posts: 1517
Joined: Wed Mar 08, 2006 12:25 am
Location: Berlin, Germany
Contact:

Re: thumbnail of pdf - wrong filename

Post by stm999999999 » Sun Jun 21, 2009 2:50 am

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.
Ciao, Stephan

stm999999999
Regular
Posts: 1517
Joined: Wed Mar 08, 2006 12:25 am
Location: Berlin, Germany
Contact:

Re: thumbnail of pdf - wrong filename

Post by stm999999999 » Thu Jun 25, 2009 12:11 am

no idea for a remedy?
Ciao, Stephan

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: thumbnail of pdf - wrong filename

Post by garvinhicking » Thu Jun 25, 2009 12:40 am

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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

randulo
Regular
Posts: 141
Joined: Thu Jul 21, 2005 10:28 am

Re: thumbnail of pdf - wrong filename

Post by randulo » Thu Jul 02, 2009 7:49 pm

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

stm999999999
Regular
Posts: 1517
Joined: Wed Mar 08, 2006 12:25 am
Location: Berlin, Germany
Contact:

Re: thumbnail of pdf - wrong filename

Post by stm999999999 » Fri Jul 03, 2009 7:21 pm

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.
Ciao, Stephan

randulo
Regular
Posts: 141
Joined: Thu Jul 21, 2005 10:28 am

Re: thumbnail of pdf - wrong filename

Post by randulo » Fri Jul 03, 2009 8:46 pm

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

stm999999999
Regular
Posts: 1517
Joined: Wed Mar 08, 2006 12:25 am
Location: Berlin, Germany
Contact:

Re: thumbnail of pdf - wrong filename

Post by stm999999999 » Fri Jul 03, 2009 10:57 pm

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"
Ciao, Stephan

randulo
Regular
Posts: 141
Joined: Thu Jul 21, 2005 10:28 am

Re: thumbnail of pdf - wrong filename

Post by randulo » Sat Jul 04, 2009 7:51 am

Thabnks, I see how that would work as a work around, but we computers and CMS to avoid that kind of thing :)

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: thumbnail of pdf - wrong filename

Post by garvinhicking » Sat Jul 04, 2009 10:49 am

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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

randulo
Regular
Posts: 141
Joined: Thu Jul 21, 2005 10:28 am

Re: thumbnail of pdf - wrong filename

Post by randulo » Sat Jul 04, 2009 12:02 pm

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

stm999999999
Regular
Posts: 1517
Joined: Wed Mar 08, 2006 12:25 am
Location: Berlin, Germany
Contact:

Re: thumbnail of pdf - wrong filename

Post by stm999999999 » Sat Jul 04, 2009 4:08 pm

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
Ciao, Stephan

randulo
Regular
Posts: 141
Joined: Thu Jul 21, 2005 10:28 am

Re: thumbnail of pdf - wrong filename

Post by randulo » Sat Jul 04, 2009 4:13 pm

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.

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: thumbnail of pdf - wrong filename

Post by garvinhicking » Fri Jul 10, 2009 4:20 pm

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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

Post Reply