ImageMagick Thumbnail Quality

290 views
Skip to first unread message

Ben Parkes

unread,
Feb 6, 2024, 6:13:44 AM2/6/24
to dspace-c...@googlegroups.com

Hello,

 

I have been trying to improve the quality of the thumbnails produced by dspace in one of the repositories I manage. I have been following the documentation for implementing ImageMagick (https://wiki.lyrasis.org/display/DSDOC7x/ImageMagick+Media+Filters) but now that I have it set up I do not see any improvements in the thumbnail quality. I have increased the density to 144 and above, rerun filter-media on a specific test item and then reloaded the page clearing the cache but each time I do not see any changes in the thumbnail quality.

 

I have set the density configuration in dspace.cfg/local.cfg to be:

org.dspace.app.mediafilter.ImageMagickThumbnailFilter.density =. 144

 

Then run the command to refilter the bitstream on my test item:

./dspace filter-media -p 'ImageMagick PDF Thumbnail' -v -f -I 12345/12345

 

This should force the thumbnail to be regenerated using ImageMagick for the test item, which I believe it is from the command line output, but the quality of the thumbnail does not appear to change regardless of what value I set the density to.

 

Following the documentation above I have also updated the configuration to include all the other detailed changes to conversion utility path, supported file formats, overwriting the existing thumbnails, flattening the pdfs, and icc profiles in case the pdf is formatted to cmyk.

 

I am curious if ImageMagick has a limit to the quality of the thumbnails it can produce or that somehow dspace is not passing the density value correctly?

 

Any advice would be very welcomed.

 

Thank you,

Ben

 

____________________________

Ben Parkes

Digital Library Software Developer

Digital Library, Library & University Collections, University of Edinburgh 

Argyle House, Lady Lawson Street, Edinburgh EH3 9DR

Pronouns: He, him, his

 

The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. Is e buidheann carthannais a th’ ann an Oilthigh Dhùn Èideann, clàraichte an Alba, àireamh clàraidh SC005336.

rdias...@uol.com.br

unread,
Feb 6, 2024, 1:12:05 PM2/6/24
to dspace-c...@googlegroups.com
Hi all.

Since this is a community list focusing in DSpace, is still possible to get help in versions before the 7th here?
I've been working with DSpace 6.3.

Thanks.

Ricardo

Kimberly Chapman

unread,
Feb 6, 2024, 1:26:31 PM2/6/24
to rdias...@uol.com.br, dspace-c...@googlegroups.com
Hi Ricardo,

Yes. Although, if your question is more technical, you may wish to consider posting on the dspace-tech google group instead. https://groups.google.com/g/DSpace-tech?pli=1

DSpace Technical Support: This mailing list provides technical support for the DSpace.org repository platform. If you are running into issues, or need advice in solving a problem, this is the place to ask!

Before posting questions on DSpace errors, we recommend reading our "How to troubleshoot an error" guide which provides tips on how to post your questions. You should also search this mailing list's archives and the DSpace Issue Tracker to see if your issue has been previously answered/resolved.

All best,

Kimberly

--
All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups "DSpace Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-communi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-community/65c2766eeaee0_310c2b22239b311878485%40ip-10-81-19-11.ec2.internal.mail.

Keith Gilbertson

unread,
Feb 6, 2024, 2:05:18 PM2/6/24
to Ben Parkes, dspace-c...@googlegroups.com
Ben,

My colleague Philip sent this to me because we're also working on replacing thumbnails. I can't tell from the email text which character you have in the parameter before the handle. We're using a lowercase "eye" - "-i".  If you want you can also try without the -p "ImageMagick PDF Thumbnail" just for your test item.

--keith


--
All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups "DSpace Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-communi...@googlegroups.com.

Keith Gilbertson

unread,
Feb 6, 2024, 2:18:48 PM2/6/24
to Ben Parkes, dspace-c...@googlegroups.com
Ben, just thought of two more things:

- there's a "." before the 144 in your density line 'org.dspace.app.mediafilter.ImageMagickThumbnailFilter.density =. 144'
- there's also a dspace-tech mailing list if you're stuck where you might get better answers

Ben Parkes

unread,
Feb 9, 2024, 8:25:03 AM2/9/24
to Keith Gilbertson, dspace-c...@googlegroups.com

Hello Keith,

 

Thank you for your input. I have been using a lower case “I” and below was a typo. The same for the “.” In my density parameter.

 

Thanks,

Ben

 

____________________________

Ben Parkes

Digital Library Software Developer

Digital Library, Library & University Collections, University of Edinburgh 

Argyle House, Lady Lawson Street, Edinburgh EH3 9DR

Pronouns: He, him, his

 

 

From: Keith Gilbertson <keith.gi...@gmail.com>
Date: Tuesday, 6 February 2024 at 19:18
To: Ben Parkes <Ben.P...@ed.ac.uk>
Cc: dspace-c...@googlegroups.com <dspace-c...@googlegroups.com>
Subject: Re: [dspace-community] ImageMagick Thumbnail Quality

This email was sent to you by someone outside the University.

You should only click on links or attachments if you are certain that the email is genuine and the content is safe.

Emilia Lobo

unread,
May 27, 2024, 3:31:30 PM5/27/24
to DSpace Community
2024-05-27 19:21:07.216 INFO filter-media - 18 @ The script has started
2024-05-27 19:21:07.218 INFO filter-media - 18 @ The following MediaFilters are enabled:
2024-05-27 19:21:07.221 INFO filter-media - 18 @ Full Filter Name: org.dspace.app.mediafilter.ImageMagickPdfThumbnailFilter
2024-05-27 19:21:07.222 INFO filter-media - 18 @ org.dspace.app.mediafilter.ImageMagickPdfThumbnailFilter
2024-05-27 19:21:07.270 INFO filter-media - 18 @ PROCESSING: bitstream 33bffac3-4fc4-4325-a617-a7442830ba5f (item: 123456789/37)
2024-05-27 19:21:07.270 INFO filter-media - 18 @ File: PROYECTO_1217_-_10B047.pdf.jpg
2024-05-27 19:21:07.450 ERROR filter-media - 18 @ ERROR filtering, skipping bitstream:
Item Handle: 123456789/37 Bundle Name: ORIGINAL File Size: 608508 Checksum: 040d573b0a284839204f082c39f30630 (MD5) Asset Store: 0 Internal ID: 62499890989285402377106308317976582589
2024-05-27 19:21:07.450 ERROR filter-media - 18 @ java.io.FileNotFoundException: convert
Caused by:  java.io.FileNotFoundException convert
2024-05-27 19:21:07.469 INFO filter-media - 18 @ PROCESSING: bitstream b8e7d13e-e2a6-459c-8400-2c1fb08c1866 (item: 123456789/38)
2024-05-27 19:21:07.470 INFO filter-media - 18 @ File: Trabajo Final - Nahuel Rivero - Nahuel Rivero.pdf.jpg
2024-05-27 19:21:07.592 ERROR filter-media - 18 @ ERROR filtering, skipping bitstream:
Item Handle: 123456789/38 Bundle Name: ORIGINAL File Size: 1549938 Checksum: 864d63bda2159726833cfe54c07bf7c7 (MD5) Asset Store: 0 Internal ID: 169046340432318907874604350508379227717
2024-05-27 19:21:07.593 ERROR filter-media - 18 @ java.io.FileNotFoundException: convert
Caused by:  java.io.FileNotFoundException convert
2024-05-27 19:21:07.600 INFO filter-media - 18 @ PROCESSING: bitstream 724cdfe9-8965-4d0b-9cef-b3d371fb91af (item: 123456789/45)
2024-05-27 19:21:07.601 INFO filter-media - 18 @ File: TESIS VIDAL FLORENCIA DICIEMBRE 2023 - Florencia vidal.pdf.jpg
2024-05-27 19:21:07.731 ERROR filter-media - 18 @ ERROR filtering, skipping bitstream:
Item Handle: 123456789/45 Bundle Name: ORIGINAL File Size: 2468038 Checksum: 02ce2bf4f02a8c5966af516c1df68d58 (MD5) Asset Store: 0 Internal ID: 166762900654857822793813931149949451424
2024-05-27 19:21:07.731 ERROR filter-media - 18 @ java.io.FileNotFoundException: convert
Caused by:  java.io.FileNotFoundException convert
2024-05-27 19:21:07.745 INFO filter-media - 18 @ PROCESSING: bitstream dff1b536-766b-4c35-85f4-390f1d29cf0b (item: 123456789/44)
2024-05-27 19:21:07.746 INFO filter-media - 18 @ File: darwin_core.pdf.jpg
2024-05-27 19:21:07.822 ERROR filter-media - 18 @ ERROR filtering, skipping bitstream:
Item Handle: 123456789/44 Bundle Name: ORIGINAL File Size: 11705 Checksum: c8ed88738fddb9f9b58c3e04971e44f8 (MD5) Asset Store: 0 Internal ID: 83901652160751386245738102562358794791
2024-05-27 19:21:07.822 ERROR filter-media - 18 @ java.io.FileNotFoundException: convert
Caused by:  java.io.FileNotFoundException convert
2024-05-27 19:21:07.828 INFO filter-media - 18 @ PROCESSING: bitstream 94ecfd88-7100-4e39-8519-d5522505e9c5 (item: 123456789/48)
2024-05-27 19:21:07.828 INFO filter-media - 18 @ File: F. Alvarez Gallego - Tesis de Licenciatura - Florencia Alvarez.pdf.jpg
2024-05-27 19:21:08.105 ERROR filter-media - 18 @ ERROR filtering, skipping bitstream:
Item Handle: 123456789/48 Bundle Name: ORIGINAL File Size: 2389438 Checksum: 4fa18a28e6bb684631231f748c1e2121 (MD5) Asset Store: 0 Internal ID: 83302752004224043985965478930266493833
2024-05-27 19:21:08.106 ERROR filter-media - 18 @ java.io.FileNotFoundException: convert
Caused by:  java.io.FileNotFoundException convert
2024-05-27 19:21:08.113 INFO filter-media - 18 @ The script has completed


what does this error mean? In local.cfg I have this configuration:

#Names of the enabled MediaFilter or FormatFilter plugins

filter.plugins = Text Extractor

#filter.plugins = JPEG Thumbnail

#filter.plugins = PDFBox JPEG Thumbnail

filter.plugins = ImageMagick Image Thumbnail

filter.plugins = ImageMagick PDF Thumbnail

filter.plugins = ImageMagick Video Thumbnail


plugin.named.org.dspace.app.mediafilter.FormatFilter = org.dspace.app.mediafilter.TikaTextExtractionFilter = Text Extractor

#plugin.named.org.dspace.app.mediafilter.FormatFilter = org.dspace.app.mediafilter.JPEGFilter = JPEG Thumbnail

#plugin.named.org.dspace.app.mediafilter.FormatFilter = org.dspace.app.mediafilter.BrandedPreviewJPEGFilter = Branded Preview JPEG

#plugin.named.org.dspace.app.mediafilter.FormatFilter = org.dspace.app.mediafilter.PDFBoxThumbnail = PDFBox JPEG Thumbnail

plugin.named.org.dspace.app.mediafilter.FormatFilter = org.dspace.app.mediafilter.ImageMagickImageThumbnailFilter = ImageMagick Image Thumbnail

plugin.named.org.dspace.app.mediafilter.FormatFilter = org.dspace.app.mediafilter.ImageMagickPdfThumbnailFilter = ImageMagick PDF Thumbnail

plugin.named.org.dspace.app.mediafilter.FormatFilter = org.dspace.app.mediafilter.ImageMagickVideoThumbnailFilter = ImageMagick Video Thumbnail


thumbnail.maxwidth = 80

thumbnail.maxheight = 80


filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = Adobe PDF

filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = CSV

filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = HTML

filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = Microsoft Excel

filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = Microsoft Excel XML

filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = Microsoft Powerpoint

filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = Microsoft Powerpoint XML

filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = Microsoft Word

filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = Microsoft Word XML

filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = OpenDocument Presentation

filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = OpenDocument Spreadsheet

filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = OpenDocument Text

filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = RTF

filter.org.dspace.app.mediafilter.TikaTextExtractionFilter.inputFormats = Text

filter.org.dspace.app.mediafilter.JPEGFilter.inputFormats = BMP, GIF, JPEG, PNG

filter.org.dspace.app.mediafilter.BrandedPreviewJPEGFilter.inputFormats = BMP, GIF, JPEG, PNG

filter.org.dspace.app.mediafilter.ImageMagickImageThumbnailFilter.inputFormats = BMP, GIF, PNG, JPG, TIFF, JPEG, JPEG 2000

filter.org.dspace.app.mediafilter.ImageMagickPdfThumbnailFilter.inputFormats = Adobe PDF

filter.org.dspace.app.mediafilter.ImageMagickVideoThumbnailFilter.inputFormats = Video MP4

filter.org.dspace.app.mediafilter.PDFBoxThumbnail.inputFormats = Adobe PDF


org.dspace.app.mediafilter.ImageMagickThumbnailFilter.ProcessStarter = /usr/bin



org.dspace.app.mediafilter.ImageMagickThumbnailFilter.bitstreamDescription = IM Thumbnail



org.dspace.app.mediafilter.ImageMagickThumbnailFilter.replaceRegex = ^Generated Thumbnail$


org.dspace.app.mediafilter.ImageMagickThumbnailFilter.flatten = false


org.dspace.app.mediafilter.ImageMagickThumbnailFilter.density = 144


Thanks,
Emilia.-

Keith Gilbertson

unread,
May 27, 2024, 6:41:32 PM5/27/24
to Emilia Lobo, DSpace Community
Emilia Lobo:

With this error 'ERROR filter-media - 18 @ java.io.FileNotFoundException: convert
Caused by:  java.io.FileNotFoundException convert',

I think you should check that ImageMagick is installed on the system, and that the "convert" executable from ImageMagick is in the /usr/bin directory, which you have configured here:

org.dspace.app.mediafilter.ImageMagickThumbnailFilter.ProcessStarter = /usr/bin

--keith


Emilia Lobo

unread,
May 28, 2024, 9:31:08 AM5/28/24
to DSpace Community
Thanks for your answer. On my development netbook, I have it in the same directory:
biblio@biblioteca:/usr/bin$ convert --version
Version: ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25 https://imagemagick.org
Copyright: (C) 1999-2021 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP(4.5)
Delegates (built-in): bzlib djvu fftw fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png tiff webp wmf x xml zlib


Should I specify something else?
Greetings!

Keith Gilbertson

unread,
May 28, 2024, 11:33:27 AM5/28/24
to Emilia Lobo, DSpace Community
On Tue, May 28, 2024 at 9:31 AM Emilia Lobo <emili...@gmail.com> wrote:
Thanks for your answer. On my development netbook, I have it in the same directory:
biblio@biblioteca:/usr/bin$ convert --version
Version: ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25 https://imagemagick.org
Copyright: (C) 1999-2021 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP(4.5)
Delegates (built-in): bzlib djvu fftw fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png tiff webp wmf x xml zlib


Should I specify something else?

I'm not sure. This seems tricky. As a next step, try the command "which ls" and see which directory is listed when you do that. Make sure that's what you have in the DSpace configuration file. And then make sure that you can run that convert command, with the full path, as your DSpace user.



 

Keith Gilbertson

unread,
May 28, 2024, 11:34:52 AM5/28/24
to Emilia Lobo, DSpace Community
Apologies. I meant to suggest that you run the command "which convert" instead of "which ls" in order to verify or find the directory.
Message has been deleted

Emilia Lobo

unread,
May 28, 2024, 11:53:56 AM5/28/24
to DSpace Community
Thaks for the tip
I get this result when running the command:

biblioteca@biblioteca:/usr/bin$ which convert
/usr/bin/convert

Emilia Lobo

unread,
May 28, 2024, 11:59:26 AM5/28/24
to DSpace Community
I found this:
cd usr/bin
ls -l 
...
lrwxrwxrwx 1 root root          25 feb 26 12:55  convert -> /etc/alternatives/convert
lrwxrwxrwx 1 root root          29 feb 26 12:55  convert-im6 -> /etc/alternatives/convert-im6
....
I must specify this path:  /etc/alternatives/convert?

Thanks, 
Emilia.-
Reply all
Reply to author
Forward
0 new messages