File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -65,9 +65,11 @@ impl IconManager {
65
65
. map_err ( |e| Error :: ReadImageFailed ( e. into ( ) ) ) ?;
66
66
{
67
67
let mut images = zip_reader. file ( ) . entries ( ) . iter ( ) . enumerate ( ) ;
68
- let icon = match images
69
- . find ( |( _, x) | x. entry ( ) . filename ( ) . as_str ( ) . unwrap_or ( "" ) == "images/icon.png" )
70
- {
68
+ let icon = match images. find ( |( _, x) | {
69
+ let filename = x. entry ( ) . filename ( ) . as_str ( ) . unwrap_or ( "" ) ;
70
+
71
+ filename == "images/icon.png" || filename == "icon.png"
72
+ } ) {
71
73
Some ( ( icon, _) ) => icon,
72
74
None => return Err ( Error :: ReadImageFailed ( anyhow ! ( "Icon not found" ) ) ) ,
73
75
} ;
@@ -152,7 +154,8 @@ impl IconManager {
152
154
let image_index = match images. find ( |( _, x) | {
153
155
let name = x. entry ( ) . filename ( ) . as_str ( ) . unwrap_or ( "" ) ;
154
156
155
- name. starts_with ( & format ! ( "images/{}/OpenEyes" , emotion) )
157
+ ( name. starts_with ( & format ! ( "images/{}/OpenEyes" , emotion) )
158
+ || name. starts_with ( & format ! ( "{}/OpenEyes" , emotion) ) )
156
159
&& name. split ( '/' ) . last ( ) . and_then ( |n| n. chars ( ) . nth ( 4 ) ) == Some ( '0' )
157
160
} ) {
158
161
Some ( ( i, _) ) => i,
You can’t perform that action at this time.
0 commit comments