Opened 9 years ago

Closed 8 years ago

#391 closed enhancement (duplicate)

Presentation and/or document media type support?

Reported by: Christopher Allan Webber Owned by: Jorge Araya Navarro
Priority: major Milestone: 0.4.0
Component: programming Keywords: review
Cc: Parent Tickets:

Description

It would be nice if we could support viewing presentations and/or documents in MediaGoblin. Minimally, it would be great if I could upload PDFs and have them openable in MediaGoblin via pdf.js.

See:
https://beta.mozillalabs.com/en-US/pdfjs/
https://github.com/andreasgal/pdf.js

Subtickets

Change History (11)

comment:1 Changed 9 years ago by Elrond

Milestone: 0.2.1

comment:2 Changed 9 years ago by Christopher Allan Webber

Component: component1programming

comment:3 Changed 9 years ago by Jorge Araya Navarro

Owner: changed from somebody to Jorge Araya Navarro
Status: newassigned

This will be something hard, at least for me, because the process to implement any view for any media type isn't documented AFAIK. Otherwise, I'll take this bug... but I need some mentoring here

comment:4 Changed 9 years ago by Christopher Allan Webber

I think more than writing a view, this is actually about adding a media type, which actually shouldn't require adding any more views. But you are right, this is completely undocumented and definitely requires quite a bit of mentoring.

I'm happy to provide some assistance with this if it's something you're interested in working on... I'll be available next weekend to do some talking and will become increasingly very available starting next month.

My thoughts on this are pretty simple:

  • I think for now just supporting downloading, verifying, and displaying PDFs is sufficient
  • So, the processing stage should be more verification than anything else I suspect? We could try opening the PDF with some sort of library to verify that it *is* a PDF. Is that overkill? Should verification be optional? Are there any decent libraries for this?
  • Again, on the display side, I think we should use pdf.js

By the way, adding new media types is not an easy thing to do if you are fairly new to doing mediagoblin hacking. Not to discourage you though... if you are indeed very interested I am more than happy to help you walk you through the process!

comment:5 Changed 8 years ago by spaetz

Milestone: 0.3.3

comment:6 Changed 8 years ago by spaetz

Please review and merge my patch media_handler_pdf which provides initial PDF support. (it depends on prior merging of the get_thumb_url branch as proposed in issue #533). This branch allows uploading/downloading of PDF files and uses a generic PDF icon as fallback preview.

Once this is done, I have another experimental (but still hacky and non-mergable) branch that uses pdf.js to display the PDF.

Git repo is at: git://gitorious.org/~spaetz/mediagoblin/spaetz-mediagoblin.git

comment:7 Changed 8 years ago by spaetz

Keywords: review added

I just updated the media_handler_pdf branch to the latest master and made it work again. It provides initial .pdf support, just displaying a pdf thumbnail and offering the possibility to download the file.

Once that is in, we could work on displaying the pdf via pdf.js and find a library that actually let's us extract some useful metadata from the file. I would be happy if someone could review this branch.

comment:8 Changed 8 years ago by Christopher Allan Webber

Milestone: 0.3.30.3.4

I think the pdf.js route is an awesome direction to go, but a prerequisite to this being a mergable feature. Document support might be cool for 0.3.4 though.

comment:9 Changed 8 years ago by alon

See http://issues.mediagoblin.org/ticket/672#comment:2 , I've also started work on PDF.js but am stuck with a lack of css knowledge and a good design direction - do we want to force it to be in the same size (640x640 ~) display you get for all other media types, do we want a full mode that is similar to what you get with pdf.js viewer.html (i.e. thumbnail, overview working, find) in addition to full screen?

comment:10 Changed 8 years ago by Christopher Allan Webber

In the case of pdf.js, I actually think 640 width makes sense, but 640 height is too small.

How about restricting on the width but not the height?

I'm not sure about other features because I haven't tried pdf.js enough to comment there. :)

comment:11 Changed 8 years ago by Christopher Allan Webber

Resolution: duplicate
Status: assignedclosed

This is implemented properly by #672 which is now merged! So I'm closing this as a duplicate :)

Note: See TracTickets for help on using tickets.