Attach license to images

merge-requests/30/head
Bob Mottram 2023-01-22 22:43:55 +00:00
parent f7d320861c
commit ec704d6afe
1 changed files with 6 additions and 0 deletions

View File

@ -599,6 +599,12 @@ def attach_media(base_dir: str, http_prefix: str,
'type': 'Document',
'url': http_prefix + '://' + domain + '/' + media_path
}
if content_license_url:
attachment_json['@context'] = [
'https://www.w3.org/ns/activitystreams',
{'schema': 'https://schema.org#'}
]
attachment_json['schema:license'] = content_license_url
if media_type.startswith('image/'):
attachment_json['blurhash'] = _get_blur_hash()
# find the dimensions of the image and add them as metadata