Commit fb0b65be authored by yatinmaan's avatar yatinmaan Committed by Thibault Saunier

medialibrary: Show unsupported assets

A new emblem is introduced for the asset transcoding error.

Fixes #1992
parent 9ce981e0
Pipeline #50380 passed with stages
in 68 minutes and 26 seconds
......@@ -15,8 +15,8 @@
viewBox="0 0 95.513242 88.802552"
id="svg4817"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="exported - proxy status - error.svg">
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="triangle-exclamation.svg">
<defs
id="defs4819">
<radialGradient
......@@ -51,15 +51,20 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="45.745908"
inkscape:cy="71.284479"
inkscape:cx="-36.372507"
inkscape:cy="93.471348"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
fit-margin-bottom="0"
inkscape:window-width="1920"
inkscape:window-height="1018"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1" />
<metadata
id="metadata4822">
<rdf:RDF>
......@@ -68,7 +73,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
......@@ -84,93 +89,19 @@
height="88.802551"
x="107.92332"
y="830.2478" />
<g
id="g4282-4"
transform="matrix(1.8699342,0,0,1.8699342,111.37055,886.54896)"
style="display:inline;fill:#000000;fill-opacity:1">
<g
style="display:inline;fill:#000000;fill-opacity:1"
id="layer9-2-8"
transform="translate(-60,-518)" />
<g
id="layer10-3-7"
transform="translate(-60,-518)"
style="fill:#000000;fill-opacity:1" />
<g
id="layer11-8-6"
transform="translate(-60,-518)"
style="fill:#000000;fill-opacity:1" />
<g
id="layer12-0-9"
transform="translate(-60,-518)"
style="fill:#000000;fill-opacity:1">
<g
style="display:inline;fill:#000000;fill-opacity:1"
id="layer4-4-1-4"
transform="translate(19,-242)">
<path
style="color:#bebebe;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:'Andale Mono';-inkscape-font-specification:'Andale Mono';text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;enable-background:new"
id="path10839-9-9"
d="m 45,764 1,0 c 0.01037,-1.2e-4 0.02079,-4.6e-4 0.03125,0 0.254951,0.0112 0.50987,0.12858 0.6875,0.3125 L 49,766.59375 51.3125,764.3125 C 51.578125,764.082 51.759172,764.007 52,764 l 1,0 0,1 c 0,0.28647 -0.03434,0.55065 -0.25,0.75 l -2.28125,2.28125 2.25,2.25 C 52.906938,770.46942 52.999992,770.7347 53,771 l 0,1 -1,0 c -0.265301,-10e-6 -0.530586,-0.0931 -0.71875,-0.28125 L 49,769.4375 46.71875,771.71875 C 46.530586,771.90694 46.26529,772 46,772 l -1,0 0,-1 c -3e-6,-0.26529 0.09306,-0.53058 0.28125,-0.71875 l 2.28125,-2.25 L 45.28125,765.75 C 45.070508,765.55537 44.97809,765.28075 45,765 l 0,-1 z"
inkscape:connector-curvature="0" />
</g>
</g>
<g
id="layer13-7-6"
transform="translate(-60,-518)"
style="fill:#000000;fill-opacity:1" />
<g
id="layer14-7-6"
transform="translate(-60,-518)"
style="fill:#000000;fill-opacity:1" />
<g
id="layer15-1-5"
transform="translate(-60,-518)"
style="fill:#000000;fill-opacity:1" />
</g>
<g
id="g4282"
transform="matrix(1.8699342,0,0,1.8699342,110.87089,886.04866)"
style="display:inline;fill:#f57900;fill-opacity:1">
<g
style="display:inline;fill:#f57900;fill-opacity:1"
id="layer9-2"
transform="translate(-60,-518)" />
<g
id="layer10-3"
transform="translate(-60,-518)"
style="fill:#f57900;fill-opacity:1" />
<g
id="layer11-8"
transform="translate(-60,-518)"
style="fill:#f57900;fill-opacity:1" />
<g
id="layer12-0"
transform="translate(-60,-518)"
style="fill:#f57900;fill-opacity:1">
<g
style="display:inline;fill:#f57900;fill-opacity:1"
id="layer4-4-1"
transform="translate(19,-242)">
<path
style="color:#bebebe;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:'Andale Mono';-inkscape-font-specification:'Andale Mono';text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#f57900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;enable-background:new"
id="path10839-9"
d="m 45,764 1,0 c 0.01037,-1.2e-4 0.02079,-4.6e-4 0.03125,0 0.254951,0.0112 0.50987,0.12858 0.6875,0.3125 L 49,766.59375 51.3125,764.3125 C 51.578125,764.082 51.759172,764.007 52,764 l 1,0 0,1 c 0,0.28647 -0.03434,0.55065 -0.25,0.75 l -2.28125,2.28125 2.25,2.25 C 52.906938,770.46942 52.999992,770.7347 53,771 l 0,1 -1,0 c -0.265301,-10e-6 -0.530586,-0.0931 -0.71875,-0.28125 L 49,769.4375 46.71875,771.71875 C 46.530586,771.90694 46.26529,772 46,772 l -1,0 0,-1 c -3e-6,-0.26529 0.09306,-0.53058 0.28125,-0.71875 l 2.28125,-2.25 L 45.28125,765.75 C 45.070508,765.55537 44.97809,765.28075 45,765 l 0,-1 z"
inkscape:connector-curvature="0" />
</g>
</g>
<g
id="layer13-7"
transform="translate(-60,-518)"
style="fill:#f57900;fill-opacity:1" />
<g
id="layer14-7"
transform="translate(-60,-518)"
style="fill:#f57900;fill-opacity:1" />
<g
id="layer15-1"
transform="translate(-60,-518)"
style="fill:#f57900;fill-opacity:1" />
</g>
<path
id="path32"
d="m 134.55107,906.70827 c 0.53902,0.93431 -0.13758,2.10222 -1.21416,2.10222 h -14.01396 c -1.07865,0 -1.75212,-1.16972 -1.21415,-2.10222 l 7.00706,-12.14912 c 0.53929,-0.93476 1.89,-0.93307 2.42832,0 z m -8.22105,-2.51181 c -0.74189,0 -1.34332,0.60143 -1.34332,1.34333 0,0.74189 0.60143,1.34331 1.34332,1.34331 0.7419,0 1.34332,-0.60142 1.34332,-1.34331 0,-0.7419 -0.60142,-1.34333 -1.34332,-1.34333 z m -1.27537,-4.82854 0.21663,3.97157 c 0.0101,0.18584 0.1638,0.33133 0.3499,0.33133 h 1.41768 c 0.18611,0 0.33977,-0.14549 0.34991,-0.33133 l 0.21662,-3.97157 c 0.011,-0.20075 -0.14887,-0.36953 -0.3499,-0.36953 h -1.85096 c -0.20103,0 -0.36082,0.16878 -0.34988,0.36953 z"
inkscape:connector-curvature="0"
style="fill:currentColor;stroke-width:0.02920267" />
<path
id="path32-8"
d="m 134.05141,906.20797 c 0.53902,0.93431 -0.13758,2.10222 -1.21416,2.10222 h -14.01396 c -1.07865,0 -1.75212,-1.16972 -1.21415,-2.10222 l 7.00706,-12.14912 c 0.53929,-0.93476 1.89,-0.93307 2.42832,0 z m -8.22105,-2.51181 c -0.74189,0 -1.34332,0.60143 -1.34332,1.34333 0,0.74189 0.60143,1.34331 1.34332,1.34331 0.7419,0 1.34332,-0.60142 1.34332,-1.34331 0,-0.7419 -0.60142,-1.34333 -1.34332,-1.34333 z m -1.27537,-4.82854 0.21663,3.97157 c 0.0101,0.18584 0.1638,0.33133 0.3499,0.33133 h 1.41768 c 0.18611,0 0.33977,-0.14549 0.34991,-0.33133 l 0.21662,-3.97157 c 0.011,-0.20075 -0.14887,-0.36953 -0.3499,-0.36953 h -1.85096 c -0.20103,0 -0.36082,0.16878 -0.34988,0.36953 z"
inkscape:connector-curvature="0"
style="fill:#f57900;fill-opacity:1;stroke-width:0.02920267" />
</g>
</svg>
<!--Derived work based on
Font Awesome Free 5.1.0 by @fontawesome - https://fontawesome.com
License - https://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
-->
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="26.955959mm"
height="25.062054mm"
viewBox="0 0 95.513242 88.802552"
id="svg4817"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="exported - proxy status - error.svg">
<defs
id="defs4819">
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4173"
id="radialGradient4181"
cx="33.283539"
cy="1002.8445"
fx="33.283539"
fy="1002.8445"
r="80.256622"
gradientTransform="matrix(1.1432904,-1.9668506e-8,1.8574145e-8,1.0796774,70.127178,-163.84935)"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
id="linearGradient4173">
<stop
style="stop-color:#000000;stop-opacity:0.502"
offset="0"
id="stop4175" />
<stop
style="stop-color:#000000;stop-opacity:0"
offset="1"
id="stop4177" />
</linearGradient>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="45.745908"
inkscape:cy="71.284479"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<metadata
id="metadata4822">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-107.92332,-830.2478)">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:url(#radialGradient4181);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.54330707;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
id="rect4171"
width="95.513245"
height="88.802551"
x="107.92332"
y="830.2478" />
<g
id="g4282-4"
transform="matrix(1.8699342,0,0,1.8699342,111.37055,886.54896)"
style="display:inline;fill:#000000;fill-opacity:1">
<g
style="display:inline;fill:#000000;fill-opacity:1"
id="layer9-2-8"
transform="translate(-60,-518)" />
<g
id="layer10-3-7"
transform="translate(-60,-518)"
style="fill:#000000;fill-opacity:1" />
<g
id="layer11-8-6"
transform="translate(-60,-518)"
style="fill:#000000;fill-opacity:1" />
<g
id="layer12-0-9"
transform="translate(-60,-518)"
style="fill:#000000;fill-opacity:1">
<g
style="display:inline;fill:#000000;fill-opacity:1"
id="layer4-4-1-4"
transform="translate(19,-242)">
<path
style="color:#bebebe;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:'Andale Mono';-inkscape-font-specification:'Andale Mono';text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;enable-background:new"
id="path10839-9-9"
d="m 45,764 1,0 c 0.01037,-1.2e-4 0.02079,-4.6e-4 0.03125,0 0.254951,0.0112 0.50987,0.12858 0.6875,0.3125 L 49,766.59375 51.3125,764.3125 C 51.578125,764.082 51.759172,764.007 52,764 l 1,0 0,1 c 0,0.28647 -0.03434,0.55065 -0.25,0.75 l -2.28125,2.28125 2.25,2.25 C 52.906938,770.46942 52.999992,770.7347 53,771 l 0,1 -1,0 c -0.265301,-10e-6 -0.530586,-0.0931 -0.71875,-0.28125 L 49,769.4375 46.71875,771.71875 C 46.530586,771.90694 46.26529,772 46,772 l -1,0 0,-1 c -3e-6,-0.26529 0.09306,-0.53058 0.28125,-0.71875 l 2.28125,-2.25 L 45.28125,765.75 C 45.070508,765.55537 44.97809,765.28075 45,765 l 0,-1 z"
inkscape:connector-curvature="0" />
</g>
</g>
<g
id="layer13-7-6"
transform="translate(-60,-518)"
style="fill:#000000;fill-opacity:1" />
<g
id="layer14-7-6"
transform="translate(-60,-518)"
style="fill:#000000;fill-opacity:1" />
<g
id="layer15-1-5"
transform="translate(-60,-518)"
style="fill:#000000;fill-opacity:1" />
</g>
<g
id="g4282"
transform="matrix(1.8699342,0,0,1.8699342,110.87089,886.04866)"
style="display:inline;fill:#f57900;fill-opacity:1">
<g
style="display:inline;fill:#f57900;fill-opacity:1"
id="layer9-2"
transform="translate(-60,-518)" />
<g
id="layer10-3"
transform="translate(-60,-518)"
style="fill:#f57900;fill-opacity:1" />
<g
id="layer11-8"
transform="translate(-60,-518)"
style="fill:#f57900;fill-opacity:1" />
<g
id="layer12-0"
transform="translate(-60,-518)"
style="fill:#f57900;fill-opacity:1">
<g
style="display:inline;fill:#f57900;fill-opacity:1"
id="layer4-4-1"
transform="translate(19,-242)">
<path
style="color:#bebebe;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:'Andale Mono';-inkscape-font-specification:'Andale Mono';text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#f57900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;enable-background:new"
id="path10839-9"
d="m 45,764 1,0 c 0.01037,-1.2e-4 0.02079,-4.6e-4 0.03125,0 0.254951,0.0112 0.50987,0.12858 0.6875,0.3125 L 49,766.59375 51.3125,764.3125 C 51.578125,764.082 51.759172,764.007 52,764 l 1,0 0,1 c 0,0.28647 -0.03434,0.55065 -0.25,0.75 l -2.28125,2.28125 2.25,2.25 C 52.906938,770.46942 52.999992,770.7347 53,771 l 0,1 -1,0 c -0.265301,-10e-6 -0.530586,-0.0931 -0.71875,-0.28125 L 49,769.4375 46.71875,771.71875 C 46.530586,771.90694 46.26529,772 46,772 l -1,0 0,-1 c -3e-6,-0.26529 0.09306,-0.53058 0.28125,-0.71875 l 2.28125,-2.25 L 45.28125,765.75 C 45.070508,765.55537 44.97809,765.28075 45,765 l 0,-1 z"
inkscape:connector-curvature="0" />
</g>
</g>
<g
id="layer13-7"
transform="translate(-60,-518)"
style="fill:#f57900;fill-opacity:1" />
<g
id="layer14-7"
transform="translate(-60,-518)"
style="fill:#f57900;fill-opacity:1" />
<g
id="layer15-1"
transform="translate(-60,-518)"
style="fill:#f57900;fill-opacity:1" />
</g>
</g>
</svg>
......@@ -178,12 +178,13 @@ class AssetThumbnail(Loggable):
NO_PROXY = "no-proxy"
IN_PROGRESS = "asset-proxy-in-progress"
ASSET_PROXYING_ERROR = "asset-proxying-error"
UNSUPPORTED = "asset-unsupported"
DEFAULT_ALPHA = 255
icons_by_name = {}
for status in [PROXIED, IN_PROGRESS, ASSET_PROXYING_ERROR]:
for status in [PROXIED, IN_PROGRESS, UNSUPPORTED]:
EMBLEMS[status] = []
for size in [32, 64]:
EMBLEMS[status].append(GdkPixbuf.Pixbuf.new_from_file_at_size(
......@@ -327,6 +328,8 @@ class AssetThumbnail(Loggable):
self.state = self.ASSET_PROXYING_ERROR
elif self.proxy_manager.is_asset_queued(asset):
self.state = self.IN_PROGRESS
elif not asset.is_image() and not self.proxy_manager.isAssetFormatWellSupported(asset):
self.state = self.UNSUPPORTED
else:
self.state = self.NO_PROXY
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment