# NC14 : Problems with preview TIF, AI, RAW images on new installation

**URL:** <https://help.nextcloud.com/t/nc14-problems-with-preview-tif-ai-raw-images-on-new-installation/42445>\
**Category:** ℹ️ Support\
**Created:** [December 3, 2018, 9:47am UTC](https://help.nextcloud.com/t/nc14-problems-with-preview-tif-ai-raw-images-on-new-installation/42445 "2018-12-03T09:47:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vindic](https://help.nextcloud.com/letter_avatar/vindic/32/6_22734026db12803ebb3e059622ac3534.png) [@vindic](https://help.nextcloud.com/u/vindic)\
**Post date:** [December 3, 2018, 9:47am UTC](https://help.nextcloud.com/t/nc14-problems-with-preview-tif-ai-raw-images-on-new-installation/42445/1 "2018-12-03T09:47:04Z")

</div>

Hi everybody,

Since i have migrated my Nextcloud 14 to Ubuntu 18.04 from Ubuntu 16.04 i cannot manage to make the images preview working on some extensions like TIF, RAW, or AI.

I tried a lot of things even launching my own php scripts with imagick which are working on the server.

It’s weird because it’s working with PNG or JPEG with Nextcloud.

Does someone encountered the same problems.

Nextcloud version : 14.0.4  
Operating system and version : Ubuntu 18.04  
Apache : 2.4  
PHP version : 7.2

The output of your Nextcloud log in **Admin \> Logging** :

```auto
OCP\Files\NotFoundException: 

    /var/www/nextcloud-14.0.4/lib/private/Preview/Generator.php - line 118:

    OC\Preview\Generator->getMaxPreview(OC\Files\Sim ... {}, OC\Files\Node\File {}, "image/x-dcraw")

    /var/www/nextcloud-14.0.4/lib/private/PreviewManager.php - line 205:

    OC\Preview\Generator->getPreview(OC\Files\Node\File {}, 200, 200, false, "fill", "image/x-dcraw")

    /var/www/nextcloud-14.0.4/apps/gallery/lib/Service/PreviewService.php - line 106:

    OC\PreviewManager->getPreview(OC\Files\Node\File {}, 200, 200, false)

    /var/www/nextcloud-14.0.4/apps/gallery/lib/Controller/Preview.php - line 167:

    OCA\Gallery\Service\PreviewService->createPreview(OC\Files\Node\File {}, 200, 200, true, false)

    /var/www/nextcloud-14.0.4/apps/gallery/lib/Controller/Preview.php - line 117:

    OCA\Gallery\Controller\PreviewController->getPreviewData(OC\Files\Node\File {}, true, 200, 200, true, false)

    /var/www/nextcloud-14.0.4/apps/gallery/lib/Controller/PreviewController.php - line 134:

    OCA\Gallery\Controller\PreviewController->getData(3623549, 200, 200)

    /var/www/nextcloud-14.0.4/lib/private/AppFramework/Http/Dispatcher.php - line 166:

    OCA\Gallery\Controller\PreviewController->getPreview(3623549, 200, 200)

    /var/www/nextcloud-14.0.4/lib/private/AppFramework/Http/Dispatcher.php - line 99:

    OC\AppFramework\Http\Dispatcher->executeController(OCA\Gallery\ ... {}, "getPreview")

    /var/www/nextcloud-14.0.4/lib/private/AppFramework/App.php - line 118:

    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Gallery\ ... {}, "getPreview")

    /var/www/nextcloud-14.0.4/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47:

    OC\AppFramework\App::main("PreviewController", "getPreview", OC\AppFramew ... {}, { fileId: "3 ... "})

    OC\AppFramework\Routing\RouteActionHandler->__invoke({ fileId: "3 ... "})

    /var/www/nextcloud-14.0.4/lib/private/Route/Router.php - line 297:

    call_user_func(OC\AppFramew ... {}, { fileId: "3 ... "})

    /var/www/nextcloud-14.0.4/lib/base.php - line 987:

    OC\Route\Router->match("/apps/gallery/preview/3623549")

    /var/www/nextcloud-14.0.4/index.php - line 42:

    OC::handleRequest()

```

---

<div class="post-metadata">

**Author:** ![vindic](https://help.nextcloud.com/letter_avatar/vindic/32/6_22734026db12803ebb3e059622ac3534.png) [@vindic](https://help.nextcloud.com/u/vindic)\
**Post date:** [December 4, 2018, 6:44am UTC](https://help.nextcloud.com/t/nc14-problems-with-preview-tif-ai-raw-images-on-new-installation/42445/2 "2018-12-04T06:44:10Z")

</div>

Ok i have resolved some of the issues for the AI, EPS, PDF files changing policy for ImageMagick :

> <https://stackoverflow.com/questions/42928765/convertnot-authorized-aaaa-error-constitute-c-readimage-453>

But i’m still struggling with the TIF format …

Edit : the same tif file renamed only by it’s extension in ‘.tiff’ is working … I’m missing something…

---

<div class="post-metadata">

**Author:** ![vindic](https://help.nextcloud.com/letter_avatar/vindic/32/6_22734026db12803ebb3e059622ac3534.png) [@vindic](https://help.nextcloud.com/u/vindic)\
**Post date:** [December 4, 2018, 10:39am UTC](https://help.nextcloud.com/t/nc14-problems-with-preview-tif-ai-raw-images-on-new-installation/42445/3 "2018-12-04T10:39:52Z")

</div>

Still digging i have found that adding an imagickProvider in the PreviewManager.php for the tif files like this make a lot of files being generated :

```
                         $imagickProviders = [
                            'SVG' => ['mimetype' => '/image\/svg\+xml/', 'class' => Preview\SVG::class],
                            'TIFF' => ['mimetype' => '/image\/tiff/', 'class' => Preview\TIFF::class],
                            **'TIF' => ['mimetype' => '/image\/tiff/', 'class' => Preview\TIFF::class],**
                            'PDF' => ['mimetype' => '/application\/pdf/', 'class' => Preview\PDF::class],
                            'AI' => ['mimetype' => '/application\/illustrator/', 'class' => Preview\Illustrator::class],
                            'PSD' => ['mimetype' => '/application\/x-photoshop/', 'class' => Preview\Photoshop::class],
                            'EPS' => ['mimetype' => '/application\/postscript/', 'class' => Preview\Postscript::class],
                            'TTF' => ['mimetype' => '/application\/(?:font-sfnt|x-font$)/', 'class' => Preview\Font::class],
                            'HEIC' => ['mimetype' => '/image\/hei(f|c)/', 'class' => Preview\HEIC::class],
                    ];

```

Now the preview for the images with extension tif are working if the mimetype is image/tiff for those recognize as x-dcraw is not working.

So each extension has only one mimetype but i need one for TIF and one for TIFF

I suppose two things changed in the code :

1. each $imagickProviders works for only one extension

2. the mimetype for the tif files can be recognized as image/x-dcraw

Maybe the imagick lib has changed also on the Ubuntu 18.04 version.

Still searching for the solution.

---

<div class="post-metadata">

**Author:** ![vindic](https://help.nextcloud.com/letter_avatar/vindic/32/6_22734026db12803ebb3e059622ac3534.png) [@vindic](https://help.nextcloud.com/u/vindic)\
**Post date:** [December 4, 2018, 11:24am UTC](https://help.nextcloud.com/t/nc14-problems-with-preview-tif-ai-raw-images-on-new-installation/42445/4 "2018-12-04T11:24:05Z")

</div>

Finally i made it, adding the mimetype in the registerCoreProvider in the PreviewManager.php around the line 363

```
$this->registerCoreProvider(Preview\TIFF::class, '/image\/x-dcraw/');
$this->registerCoreProvider(Preview\TIFF::class, '/image\/tif/');

```

Do i have to submit the bug on the gitHub ?

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 4, 2024, 8:26am UTC](https://help.nextcloud.com/t/nc14-problems-with-preview-tif-ai-raw-images-on-new-installation/42445/5 "2024-12-04T08:26:40Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 9, 2024, 3:42pm UTC](https://help.nextcloud.com/t/nc14-problems-with-preview-tif-ai-raw-images-on-new-installation/42445/6 "2024-12-09T15:42:15Z")

</div>


