Fix imagemagick policy for gifs

This commit is contained in:
Aode (lion) 2021-08-31 12:14:23 -05:00
parent b1ca7f95a2
commit 43f94a3d5d
2 changed files with 7 additions and 4 deletions

View file

@ -1,6 +1,6 @@
<policymap>
<policy domain="resource" name="memory" value="256MiB" />
<policy domain="resource" name="list-length" value="32" />
<policy domain="resource" name="list-length" value="128" />
<policy domain="resource" name="width" value="10KP" />
<policy domain="resource" name="height" value="10KP" />
<policy domain="resource" name="map" value="512MiB" />
@ -9,12 +9,11 @@
<policy domain="resource" name="file" value="768" />
<policy domain="resource" name="thread" value="2" />
<policy domain="coder" rights="none" pattern="*" />
<policy domain="coder" rights="read | write" pattern="{GIF,JPEG,PNG,WEBP,MP4,TMP}" />
<policy domain="coder" rights="read | write" pattern="{GIF,JPEG,PNG,WEBP,MP4,TMP,PAM}" />
<policy domain="filter" rights="none" pattern="*" />
<policy domain="path" rights="none" pattern="@*" />
<policy domain="delegate" rights="none" pattern="*" />
<policy domain="module" rights="none" pattern="*" />
<policy domain="module" rights="read | write" pattern="{GIF,JPEG,PNG,WEBP,MP4,TMP}" />
<policy domain="module" rights="read | write" pattern="{GIF,JPEG,PNG,WEBP,MP4,TMP,PAM}" />
<!-- indirect reads not permitted -->
<policy domain="system" name="precision" value="6" />
</policymap>

View file

@ -192,12 +192,16 @@ async fn upload(
let details = manager.variant_details(path.clone(), name.clone()).await?;
let details = if let Some(details) = details {
debug!("details exist");
details
} else {
debug!("generating new details from {:?}", path);
let new_details = Details::from_path(path.clone()).await?;
debug!("storing details for {:?} {}", path, name);
manager
.store_variant_details(path, name, &new_details)
.await?;
debug!("stored");
new_details
};