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]   Go Down

Author Topic: PDF as image?  (Read 7003 times)

0 Members and 1 Guest are viewing this topic.

brynn

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 198
    • Inkscape Commmunity
PDF as image?
« on: January 23, 2015, 03:10:57 am »

Hi Friends,
Is it possible to use the File Types Editor to add PDF as an image file?  I suppose PDF can only be either a document or image?

I tried to set up as image file, but it doesn't seem to work.  I don't know if I set it up wrong, or if it's just not possible.

In File Types Editor dialog, I put:

File extension -- pdf
MIME type -- image/pdf
Content type -- image
player -- no player

Sorry if this seems obvious to some of you.  But I don't completely understand how everything works.

Thanks for your help   :)
Logged

brynn

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 198
    • Inkscape Commmunity
Re: PDF as image?
« Reply #1 on: January 23, 2015, 03:14:48 am »

Sorry.  On 2nd thought, I decided maybe I should clarify what I meant by "doesn't seem to work".

When I try to upload a PDF, I get an error that says "The file you have uploaded is not a valid image!"
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: PDF as image?
« Reply #2 on: January 23, 2015, 08:12:17 pm »

What exactly do you want to achieve? PDF files are no images: http://en.wikipedia.org/wiki/Portable_Document_Format
Logged

brynn

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 198
    • Inkscape Commmunity
Re: PDF as image?
« Reply #3 on: January 24, 2015, 08:34:03 am »

I want to be able to upload PDF images, into my CPG.  PDF can contain both raster or vector graphics (or both).  In the case of my gallery, which is to display graphics made with Inkscape (a vector graphics editor), it would be mostly vector content.  But whether it's raster or vector shouldn't matter.  Just that PDF is a graphics format, and I'd like to be able to upload PDF files as images.

Here you can see that PDF is listed as a graphics file format:  https://en.wikipedia.org/wiki/Comparison_of_graphics_file_formats

Let's see if I can attach an example....
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: PDF as image?
« Reply #4 on: January 25, 2015, 01:02:13 am »

While PDF is listed in the link you provided - its 'MIME type' even in that document is 'application/pdf' - and not 'image/pdf'
While 'MIME type' originated with email - it is also know as Content Type and used to determine what program/handler to open a file.
https://en.wikipedia.org/wiki/Internet_media_type
No image program will know how to handle 'image/pdf'

I expect the error from CPG is when either Imagemagick or GD (based on config) try to open the file to create a thumbnail - they fail...

I believe you can load pdf files to CPG as 'application/pdf' and use the Custom Thumbnail plugin to give them a thumbnail...
Does that help with what you are trying to do?



 
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

brynn

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 198
    • Inkscape Commmunity
Re: PDF as image?
« Reply #5 on: January 25, 2015, 05:06:39 am »

Well, I guess that's how it has to go.  I already do use custom thumbnails for SVG files, so all I need to do, is set PDF back to a document.

Are these the right settings for the file type editor?  Is this how it should be, to put PDF back to a document:

File extension -- pdf
MIME type -- document/pdf  or is it application/pdf?
Content type -- document
player -- ?

Do I need to specify a player for the PDF?  Or will it display in the browser?

Thanks again  :-)
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4886
    • Windsurf.me
Re: PDF as image?
« Reply #6 on: January 25, 2015, 04:58:23 pm »

Logged
It is a mistake to think you can solve any major problems just with potatoes.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: PDF as image?
« Reply #7 on: January 25, 2015, 08:11:06 pm »

Are these the right settings for the file type editor?  Is this how it should be, to put PDF back to a document:

File extension -- pdf
MIME type -- document/pdf  or is it application/pdf?
Content type -- document
player -- ?

Do I need to specify a player for the PDF?  Or will it display in the browser?

Default values:
Code: (sql/basic.sql) [Select]
INSERT INTO CPG_filetypes VALUES ('pdf', 'application/pdf', 'document', '');
Logged

brynn

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 198
    • Inkscape Commmunity
Re: PDF as image?
« Reply #8 on: January 26, 2015, 02:54:29 am »

Hhm....  After I changed PDF back to a document, it doesn't look like I need to use a custom thumbnail, or the other plugin, that Phill Lockhurst mentioned.  It makes a thumbnail, although it does look like it's displaying the thumbnail on the intermediate page.  But as long as it displays the full size by clicking on it, that's fine with me.

Anyway, thanks for your help  :)
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.