Project

General

Profile

task #9132

Update cyprus images to Scaler default API and add thumbnails

Added by Andreas Müller 4 months ago. Updated 2 months ago.

Status:
In Progress
Priority:
Highest
Category:
data
Target version:
Start date:
07/07/2020
Due date:
% Done:

50%

Severity:
normal

Description

Currently only 1 representation exists (for the full image) using the Scaler IIF API with links like:

https://pictures.bgbm.org/digilib/Scaler/IIIF/Cyprus!Melilotus_italicus_B1.jpg/full/full/0/default.jpg

We better use the Scaler default API using links like

https://pictures.bgbm.org/digilib/Scaler?fn=Cyprus/Arum_rupicola_B2.jpg&mo=file (for full image)

or

https://pictures.bgbm.org/digilib/Scaler?fn=Cyprus/Arum_rupicola_B2.jpg&mo=fit&dw=400&dh=400 (for scaled images)

To implement this the script from #5744 needs to be adapted.
The API is available at: https://robcast.github.io/digilib/scaler-api.html

uv-fist-image-determines-aspectratio.png View (362 KB) Andreas Kohlbecker, 08/18/2020 03:32 PM

manifest-canvas-for-thumbs.json (4.02 KB) Andreas Kohlbecker, 08/18/2020 04:57 PM

manifest.json (4.02 KB) Andreas Kohlbecker, 08/18/2020 04:57 PM


Related issues

Related to Edit - feature request #9134: Rule based creation of additional media representations "on the fly" Feedback 07/08/2020
Related to Edit - feature request #9198: option in iiif manifest creation to set canvas size to thumbnail size Closed 08/18/2020

Associated revisions

Revision 684783aa (diff)
Added by Andreas Müller 4 months ago

ref #9132 improve length reading for URI based images

Revision 40d1f836 (diff)
Added by Andreas Müller 4 months ago

ref #9132 Cyprus images updated for IIIF and Scaler API

Revision 15d27f3d (diff)
Added by Andreas Müller 3 months ago

ref #9132 add uvfix parameter to Cyprus image import code

History

#2 Updated by Andreas Müller 4 months ago

Keyword has not correct format and can not be parsed: showing abscission zone for file Bromus_fasciculatus_s_delilei_B3.jpg
Keyword has not correct format and can not be parsed: showing lemma and callus for file Bromus_fasciculatus_s_delilei_B4.jpg
More than 1 taxon found for media: Carex egorovae . Will now try to use only taxon with taxon node.
More than 1 taxon found for media: Carex egorovae . Will now try to use only taxon with taxon node.
More than 1 taxon found for media: Carex egorovae . Will now try to use only taxon with taxon node.

Person could not be parsed: G, N. Hadjikyriakou for file Euphorbia_falcata_s_falcata_A1.jpg
Person could not be parsed: G, N. Hadjikyriakou for file Euphorbia_falcata_s_falcata_D1.jpg
Keyword has not correct format and can not be parsed: Date: 16.03.2015 Photographer: G. N. Hadjikyriakou for file Euphorbia_helioscopia_s_helioscopioides_A1.jpg
Keyword has not correct format and can not be parsed: Date: 16.03.2015 Photographer: G. N. Hadjikyriakou for file Euphorbia_helioscopia_s_helioscopioides_B1.jpg
Keyword has not correct format and can not be parsed: Date: 16.03.2015 Photographer: G. N. Hadjikyriakou for file Euphorbia_helioscopia_s_helioscopioides_B2.jpg
More than 1 taxon found for media: Ranunculus neapolitanus . Will now try to use only taxon with taxon node.
More than 1 taxon found for media: Sambucus nigra . Will now try to use only taxon with taxon node.
Incorrect filename:silene_conoidea_D1.jpg

#3 Updated by Andreas Müller 4 months ago

Problem (Could not read block (block start: 14468, block length: 15217440, data length: 65527).) when reading metadata from file: Micromeria_chionistrae_C1.jpg
Problem (Could not read block (block start: 13908, block length: 15217440, data length: 65527).) when reading metadata from file: Micromeria_chionistrae_C2.jpg
Problem (Could not read block (block start: 14572, block length: 15217440, data length: 65527).) when reading metadata from file: Moricandia_arvensis_C3.jpg
Problem (Could not read block (block start: 12164, block length: 15217440, data length: 65527).) when reading metadata from file: Moricandia_arvensis_C4.jpg
Problem (Could not read block (block start: 15136, block length: 15217440, data length: 65527).) when reading metadata from file: Nigella_ciliaris_C7.jpg
Problem (Could not read block (block start: 13546, block length: 15217440, data length: 65527).) when reading metadata from file: Nigella_ciliaris_C8.jpg
Problem (Could not read block (block start: 13584, block length: 15217440, data length: 65527).) when reading metadata from file: Nigella_ciliaris_C9.jpg
Problem (Could not read block (block start: 12388, block length: 15217440, data length: 65527).) when reading metadata from file: Teucrium_karpasiticum_C1.jpg
Problem (Could not read block (block start: 14838, block length: 15217440, data length: 65527).) when reading metadata from file: Teucrium_karpasiticum_C2.jpg
Problem (Could not read block (block start: 12228, block length: 15217440, data length: 65527).) when reading metadata from file: Teucrium_salaminium_C1.jpg
Problem (Could not read block (block start: 15484, block length: 15217440, data length: 65527).) when reading metadata from file: Teucrium_salaminium_C2.jpg
Problem (Could not read block (block start: 14760, block length: 15217440, data length: 65527).) when reading metadata from file: Veronica_bozakmanii_C2.jpg
Problem (Could not read block (block start: 12416, block length: 15217440, data length: 65527).) when reading metadata from file: Veronica_bozakmanii_C3.jpg

#4 Updated by Andreas Müller 4 months ago

Taxon not found: Ophrys kotschyi-sphegodes

#6 Updated by Andreas Müller 4 months ago

AM:

noch ein „kleiner“ Nachtrag. Es gibt im CDM inzwischen >100 „Bilder“, die in als Datei nicht mehr existieren. Dies führt zu Unschönheiten bei der Anzeige. Ich denke, wir sollten die löschen, wollte das aber nicht machen ohne es vorher mit dir abgesprochen zu haben. Kannst du das mal überprüfen?
"Sedum_caespitosum_A3.jpg"
"Beta_vulgaris_C1.jpg"
"Podospermum_alpigenum_A1.jpg"
"Astragalus_echinus_A1.jpg"
"Crypsis_factorovskyi_B1.jpg"
"Crypsis_factorovskyi_B2.jpg"
"Pinguicula_crystallina_B1.jpg"
"Euphorbia_helioscopia_B1.jpg"
"Iris_albicans_A1.jpg"
"Saccharum_ravennae_A1.jpg"
"Sinapis_alba_E1.jpg"
"Lactuca_triquetra_E1.jpg"
"Ononis_variegata_B1.jpg"
"FIlago_pyramidata_B1.jpg"
"Sorbus_graeca_C1.jpg"
"Linum_trigynum_A1.jpg"
"Linum_usitatissimum_B1.jpg"
"Ononis_serrata_A1.jpg"
"Cytinus_hypocistis_B1.jpg"
"Urtica_dioica_s_cypria_B1.jpg"
"Geranium_lucidum_B1.jpg"
"Lindbergella_sintenisii_B1.jpg"
"Matthiola_longipetala_A1.jpg"
"Hypopitys_monotropa_A1.jpg"
"Beta_vulgaris_s_maritima_B1.jpg"
"Podospermum_laciniatum_D2.jpg"
"Helianthemum_sanguineum_A1.jpg"
"Helianthemum_sanguineum_A1.jpg"
"Helianthemum_sanguineum_A1.jpg"
"Cyperus_fuscus_B1.jpg"
"Securigera_cretica_B1.jpg"
"Euphorbia_falcata_s_macrostegia_D1.jpg"
"Carex_flacca_s_serrulata_A1.jpg"
"Epipactis_microphylla_A1.jpg"
"Epilobium_tetragonum_B1.jpg"
"Lapsana_communis_s_communis_D1.jpg"
"Lepidium_latifolium_D1.jpg"
"Malvella_sherardiana_C1.jpg"
"Medicago_lupulina_C1.jpg"
"Nigella_ciliaris_C1.jpg"
"Osyris_alba_A2.jpg"
"Orobanche_orientalis_B2.jpg"
"Silene_muscipula_B2.jpg"
"Vicia_lathyroides_B2.jpg"
"Orobanche_orientalis_B2.jpg"
"Melilotus_elegans_C2.jpg"
"Cynoglossum_natolicum_C2.jpg"
"Ranunculus_bulbosus_s_bulbosus_A1.jpg"
"Symphyotrichum_squamatum_B1.jpg"
"Ranunculus_peltatus_s_peltatus_A1.jpg"
"Astragalus_echinus_A2.jpg"
"Astragalus_echinus_A4.jpg"
"Astragalus_echinus_B2.jpg"
"Astragalus_echinus_B3.jpg"
"Beta_vulgaris_s_maritima_D2.jpg"
"Chaenorhinum_rubrifolium_B1.jpg"
"Cyperus_fuscus_B2.jpg"
"Cyperus_fuscus_B3.jpg"
"Euphorbia_falcata_s_macrostegia_A1.jpg"
"Euphorbia_falcata_s_macrostegia_B1.jpg"
"Euphorbia_falcata_s_macrostegia_D2.jpg"
"Euphorbia_helioscopia_A1.jpg"
"Euphorbia_helioscopia_A2.jpg"
"Euphorbia_helioscopia_A3.jpg"
"Euphorbia_helioscopia_A4.jpg"
"Euphorbia_helioscopia_A5.jpg"
"Euphorbia_helioscopia_D1.jpg"
"Euphorbia_helioscopia_D2.jpg"
"Helianthemum_sanguineum_A1.jpg"
"Iris_albicans_B1.jpg"
"Iris_albicans_B2.jpg"
"Lactuca_triquetra_A1.jpg"
"Lactuca_triquetra_B1.jpg"
"Lactuca_triquetra_B2.jpg"
"Lactuca_triquetra_B3.jpg"
"Lactuca_triquetra_B4.jpg"
"Lactuca_triquetra_C1.jpg"
"Lactuca_triquetra_C2.jpg"
"Lindbergella_sintenisii_B2.jpg"
"Matthiola_longipetala_A2.jpg"
"Matthiola_longipetala_A3.jpg"
"Podospermum_alpigenum_A2.jpg"
"Podospermum_alpigenum_A3.jpg"
"Podospermum_alpigenum_A4.jpg"
"Podospermum_alpigenum_A5.jpg"
"Podospermum_alpigenum_A6.jpg"
"Podospermum_laciniatum_A1.jpg"
"Podospermum_laciniatum_C1.jpg"
"Podospermum_laciniatum_C2.jpg"
"Podospermum_laciniatum_D1.jpg"
"Ranunculus_peltatus_s_peltatus_A1.JPG"
"Ranunculus_peltatus_s_peltatus_A2.JPG"
"Saccharum_ravennae_A3.jpg"
"Saccharum_ravennae_B2.jpg"
"Securigera_securidaca_A1.jpg"
"Securigera_securidaca_B1.jpg"
"Securigera_securidaca_B2.jpg"
"Securigera_securidaca_B4.jpg"
"Securigera_securidaca_D1.jpg"
"Veronica_persica_A1.jpg"
"Veronica_persica_B4.jpg"
"Veronica_persica_C1.jpg"
"Veronica_persica_D1.jpg"
"Podospermum_laciniatum_A2.jpg"
"Podospermum_laciniatum_B1.jpg"
"Podospermum_laciniatum_B2.jpg"

#7 Updated by Andreas Müller 4 months ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 40
SELECT Replace(Replace(uri, 'https://pictures.bgbm.org/digilib/Scaler/IIIF/Cyprus!', ''), '/full/full/0/default.jpg','')
FROM MediaRepresentationPart p
WHERE uri  NOT LIKE 'https://pictures.bgbm.org/digilib/Scaler?fn=Cyprus/%'

#8 Updated by Andreas Kohlbecker 3 months ago

The Universalviewer appends ?t={some-hash} to the image URI. By this the links to the scaler api become invalid and the last parameter it not parsed correctly.

Invalid URI with appended parameter t (last parameter as parsed in bold letters, white space after schema part for formatting ):

https: //pictures.bgbm.org/digilib/Scaler?fn=Cyprus/Arum_rupicola_B2.jpg&mo=fit&dw=400&dh=400?t=1594725873250

adding an additional dummy parameter (uvfix for "universalviewer fix") to the end of the query part help parse the parameters:

https: //pictures.bgbm.org/digilib/Scaler?fn=Cyprus/Arum_rupicola_B2.jpg&mo=fit&dw=400&dh=400&uvfix=1?t=1594725873250

==> adapt the thumbnail URIs accordingly

#10 Updated by Andreas Kohlbecker 3 months ago

  • Related to feature request #9134: Rule based creation of additional media representations "on the fly" added

#11 Updated by Andreas Müller 3 months ago

I updated data in cyprus

UPDATE MediaRepresentationPart p
SET uri = Concat(uri, '&uvfix=1')
WHERE p.uri LIKE '%&mo=fit&dw=400&dh=400' OR p.uri LIKE '%&mo=fit&dw=200&dh=200'

and adapted the import code

#12 Updated by Andreas Müller 3 months ago

  • Status changed from In Progress to Resolved
  • Assignee changed from Andreas Müller to Andreas Kohlbecker
  • % Done changed from 40 to 50

The above problems are all solved and discussed with Ralf so I guess we can close this ticket.

#13 Updated by Andreas Kohlbecker 3 months ago

Andreas Müller wrote:

The above problems are all solved and discussed with Ralf so I guess we can close this ticket.

Let's wait for Ralfs answer regarding the decision if mo=fit or mo=crop should be used.

#14 Updated by Andreas Kohlbecker 3 months ago

  • Assignee changed from Andreas Kohlbecker to Andreas Müller
  • % Done changed from 50 to 40

Ralf voted for cropping the images (Email from 16.07.20 17:58)

#15 Updated by Andreas Kohlbecker 3 months ago

I modified the small thumbnails images with following sql statement:

UPDATE  MediaRepresentationPart p set p.uri = replace(uri, '&mo=fit&dw=200&dh=200', '&mo=crop&dw=200&dh=147') , height=147, width=200 where p.uri LIKE '%&mo=fit&dw=200&dh=200%'

in the test-server.

This does not work for the UV as hoped. The UV takes the aspect ration of the first full resolution image as default, for all thumbnail images. So using the crop function is not the complete solution.

see http://test.e-taxonomy.eu/dataportal/preview/cyprus/cdm_dataportal/taxon/e9925386-b197-4d81-a4fc-137ea96e6b4f/images

This is task still requires more research.

#16 Updated by Andreas Müller 2 months ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Andreas Müller to Andreas Kohlbecker

Can you explain this a bit more? I do not yet understand what the exact problem is.

#17 Updated by Andreas Kohlbecker 2 months ago

  • Status changed from Feedback to Resolved

This is a complicated issue which required quite some time for a comprehensive explanation comment 15 contains all information which is required to fully understand the issue. Since I am the one to solve this ticket I would prefer not to spend too much time for further explanations.

#18 Updated by Andreas Müller 2 months ago

OK. It was assigned to me before therefore I asked.
So is the status "Resolved" correct or is there still work to do?

#19 Updated by Andreas Kohlbecker 2 months ago

adding picture to illustrate the above mentioned problem

#20 Updated by Andreas Kohlbecker 2 months ago

I a filed a bug report for the UV developers: https://github.com/UniversalViewer/universalviewer/issues/743

#21 Updated by Andreas Kohlbecker 2 months ago

I found a workaround for my case which at least works with universalviewer@v3.0.1:

The thumbnail dimensions are corrected if I set width and height of the thumbnails for the canvas size. You can see the change by comparing the attached manifest files: original= manifest.json, tweaked= manifest-canvas-for-thumbs.json

I am not sure if this solution conforms to the IIIF Presentation API 3.0 specification or if I should fear that coming changes to UV will behave differently with respect to my workaround.

#22 Updated by Andreas Kohlbecker 2 months ago

  • Related to feature request #9198: option in iiif manifest creation to set canvas size to thumbnail size added

#23 Updated by Andreas Kohlbecker 2 months ago

implementation ticket for above workaround #9198

once there is a better solution ( https://github.com/UniversalViewer/universalviewer/issues/743 ) we might want to remove the workaround again.

#24 Updated by Andreas Kohlbecker 2 months ago

  • Assignee changed from Andreas Kohlbecker to Andreas Müller
  • % Done changed from 40 to 50

I think we can close this ticket now.

#25 Updated by Andreas Müller 2 months ago

I think we should keep it for removing the thumbnails again after the release and also for updating the cichorieae data, too.

#26 Updated by Andreas Müller 2 months ago

  • Status changed from Resolved to In Progress
  • Target version changed from Release 5.18 to Release 5.19

#27 Updated by Andreas Müller 2 months ago

  • Target version changed from Release 5.19 to Release 5.18

#28 Updated by Andreas Kohlbecker 2 months ago

I updated the cyprus thumbnail representations in the production system to be cropped as documented in comment 15

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)