Open jcreel opened 3 years ago
From dspace as root
PGPASSWORD=<password> psql -h <host> -p <port> -d <database> -U <username> -c 'SELECT handle FROM handle WHERE resource_type_id = 2' -t > item_handles.txt
while read handle; do /data/DSpace/bin/dspace filter-media -f -i $handle; done < item_handles.txt
The default thumbnail size was enlarged some time ago. DSpace's media filter will not regenerate thumbnails if they already exist unless forced to, so the nightly job does not handles regeneration for the small legacy thumbnails. The legacy thumbnails should be either deleted or undergo a forced media filer. The small thumbnails can be tracked with this query.
Query for generated thumbnails with corresponding item and collection handles: select b.uuid,b.size_bytes,i.uuid as itemid,ci.collection_id as collectionid,idfi.handle as item_handle,idf.handle as coll_handle,m.text_value from bitstream b left join metadatavalue m on m.dspace_object_id=b.uuid left join bundle2bitstream bb on bb.bitstream_id=b.uuid left join item2bundle ib on ib.bundle_id=bb.bundle_id left join item i on i.uuid=ib.item_id left join dspaceobject di on di.uuid=i.uuid left join handle idfi on (idfi.resource_id=di.uuid and idfi.resource_type_id=2) left join collection2item ci on ci.item_id=i.uuid left join dspaceobject d on d.uuid=ci.collection_id left join handle idf on (idf.resource_id=d.uuid and idf.resource_type_id=3) where m.text_value='Generated Thumbnail' order by size_bytes asc limit 100;
Note that as DSpace is not lately able to run lengthy batch operations, individual media filter commands will need to be run serially. A handy script to do this for a list of handles can be found here: https://github.com/TAMULib/saf-scripts/blob/development/dspace/repeatcommand.sh