[owncloud-devel] File Preview for New File Type

Aaron Boxer boxerab at gmail.com
Tue Jul 29 19:56:30 GMT 2014

Thanks very much, Georg. It doesn't look to hard to do this.
First, I need to set up my dev environment, and then I will try to
implement this.

By the way, adding DICOM support will be a huge win, I think.


On Tue, Jul 29, 2014 at 3:40 PM, Georg Ehrke <developer at georgehrke.com>

> Hi,
> On Jul29 2014, at 09:19 PM, Aaron Boxer <boxerab at gmail.com> wrote:
> Hello,
> Can someone please explain or point me to any docs on how
> to add file preview to new file type? I would like to preview .dcm
> files, which are DICOM medical images.
> You need to write a class that implements certain methods:
> - getMimeType() - this function should return 'application/dicom’ in your
> case.
> - getThumbnail() - this function would return the actual preview.
> You mentioned imagemagick in an earlier mail.
> An example of a preview provider that uses imagick is the pdf provider:
> https://github.com/owncloud/core/blob/master/lib/private/preview/pdf.php
> (You can ignore the " . '[0]’” in the imagick constructor.)
> Finally you need to register your preview providers.
> You would put this line of code into your appinfo/app.php
> ```
> \OC\Preview::registerProvider('OC\Preview\PDF’);
> ```
> You shouldn’t use \OC\Preview directly, but sadly there is no public api
> function for this yet.
> I’ll add one and I’ll also write a proper interface for preview providers.
> Cheers,
> Georg
> Also, another question: is it possible to filter uploaded files to detect
> the actual file format? If a user uploads a file FOO.BAR which is actually
> a dicom file, is there a way of filtering and storing meta-data about the
> file?
> ping @icewind :)
> Thanks very much!
> Aaron
> _______________________________________________
> Devel mailing list
> Devel at owncloud.org
> http://mailman.owncloud.org/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.owncloud.org/pipermail/devel/attachments/20140729/28f9437d/attachment.html>

More information about the Devel mailing list