Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
fix(package): update for transparent icon file
Browse files Browse the repository at this point in the history
Signed-off-by: Domingo Oropeza <doropeza@teclib.com>
  • Loading branch information
DIOHz0r committed Sep 26, 2018
1 parent 012daa8 commit 0fd3ffd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions inc/package.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,12 @@ private function parseApplication() {
$manifest = $apk->getManifest();
$iconResources = $apk->getResources($manifest->getApplication()->getIcon());
$apkLabel = $apk->getResources($manifest->getApplication()->getLabel());
// Default transparent PNG icon 1x1
$input['icon'] = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=';
$stream = $apk->getStream($iconResources[0]);
if (!is_resource($stream)) {
// Transparent 1x1 GIF
$stream = imagegif(imagecreate(1, 1));
if (is_resource($stream)) {
$input['icon'] = base64_encode(stream_get_contents($stream));
}
$input['icon'] = base64_encode(stream_get_contents($stream));
$input['package_name'] = $manifest->getPackageName();
$input['version'] = $manifest->getVersionName();
$input['version_code'] = $manifest->getVersionCode();
Expand Down
5 changes: 2 additions & 3 deletions tpl/package.html.twig
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{% if not isNewID %}
<tr class='tab_bg_1'>
<td colspan="4">
{% if not package.icon %}
{% else %}
<img width="64px" height="64px" src="data:image/png;base64,{{ package.icon }}" />
{% if package.icon %}
<img src="data:image/png;base64,{{ package.icon }}" style="max-height: 64px" />
{% endif %}
</td>
</tr>
Expand Down

0 comments on commit 0fd3ffd

Please sign in to comment.