Skip to content

Commit 5afce1b

Browse files
committed
🚗 feat: support apk & ipa; fix: index; fix: double height
1 parent 9d7c5b1 commit 5afce1b

File tree

5 files changed

+162
-143
lines changed

5 files changed

+162
-143
lines changed

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,25 @@
1212
- 图标(![](https://raw.githubusercontent.com/drag-and-publish/operating-system-logos/master/src/16x16/WIN.png)ico、![](https://raw.githubusercontent.com/drag-and-publish/operating-system-logos/master/src/16x16/MAC.png)icns)
1313
- ![](https://raw.githubusercontent.com/drag-and-publish/operating-system-logos/master/src/16x16/WIN.png)Windows可执行文件(exe、dll、mui、mun)
1414
- ![](https://raw.githubusercontent.com/drag-and-publish/operating-system-logos/master/src/16x16/LIN.png)Linux可执行文件(\*.desktop【\*.AppImage、\*.run】)
15-
- ![](https://raw.githubusercontent.com/drag-and-publish/operating-system-logos/master/src/16x16/AND.png)apk包
15+
- 📱 手机应用安装包(![](https://raw.githubusercontent.com/drag-and-publish/operating-system-logos/master/src/16x16/AND.png)apk包![](https://raw.githubusercontent.com/drag-and-publish/operating-system-logos/master/src/16x16/IOS.png)ipa包)
1616
- ![](https://raw.githubusercontent.com/drag-and-publish/operating-system-logos/master/src/16x16/WIN.png)文件夹图标(autorun.inf、desktop.ini)
1717
- ![](https://raw.githubusercontent.com/drag-and-publish/operating-system-logos/master/src/16x16/MAC.png)MacOSX程序(\*.app)
1818

1919
### 开发进度
2020

2121
- [x] 获取位置和获取图标方法剥离
22+
- [x] 支持desktop.ini中IconResource的配置
2223
- [x] 支持获取png格式的图标
2324
- [x] PE文件无图标的默认图标逻辑
2425
- [x] PE文件获取图标的index逻辑
26+
- [x] 支持index为负数是资源id的逻辑
2527
- [x] 支持icns转换ico逻辑
2628
- [x] 指定尺寸缩放逻辑
2729
- [x] 指定尺寸图标匹配逻辑
2830
- [x] dll加载不到图标问题
2931
> 答: 在早期的 Windows 版本中,图标资源文件嵌入到目录中的某些 DLL 中C:\Windows\System32。自 Windows 10 版本 1903 起,它们已重新定位到: C:\Windows\SystemResources. 现在这些文件有一个新的扩展名,.mun而不是.mui (仍然存在于system32和syswow64子文件夹中。
3032
- [x] 低于256宽度图标格式转换为PNG的支持(先转换为32位位图)
31-
- [x] 支持获取准确的高度(BITMAPINFOHEADER中大小为48x96,实际数据只有48x48)
33+
- [x] 支持获取准确的高度(BITMAPINFOHEADER中大小为48x96,实际数据只有48x48,2倍高度实际是掩码数据
3234
- [x] 支持裁剪掉透明边缘(说明是48x48的位图,实际只有32x32是不透明的)
3335

3436
### 如果要更新assets下的默认图标

cmd/main.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,19 @@ func main() {
2424
// path := `C:\Windows\System32\cmd.exe`
2525
// path := `C:\Windows\System32\alg.exe`
2626
// path := `C:\Windows\System32\imageres.dll`
27-
// path := `C:\Windows\SystemResources\imageres.dll.mun`
27+
path := `C:\Windows\SystemResources\imageres.dll.mun`
2828
// path := `D:\Program Files (x86)\Adobe Illustrator CS4\Support Files\Contents\Windows\Illustrator.exe`
2929
// path := `app.icns`
3030
// path := `FileZilla.icns`
3131
// path := `F:\安装包\android-studio-ide-401-201.6858069-mac.dmg`
32-
path := `E:\Download\ETax.exe`
33-
err = fico.F2ICO(w, path, fico.Config{Width: 48, Height: 48})
32+
// path := `E:\Download\ETax.exe`
33+
// path := `E:\Download\weixin6.2.5.apk`
34+
// err = fico.F2ICO(w, path, fico.Config{Width: 48, Height: 48})
3435
// err = fico.F2ICO(w, path, fico.Config{Format: "png"})
3536
// err = fico.F2ICO(w, path, fico.Config{Format: "png", Width: 48, Height: 48})
3637
// err = fico.F2ICO(w, path)
38+
idx := -184
39+
err = fico.F2ICO(w, path, fico.Config{Format: "png", Index: &idx, Width: 48, Height: 48})
3740
if err != nil {
3841
panic(err)
3942
}

0 commit comments

Comments
 (0)