-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adapt prepare_icons.sh script to generate icons for emv-viewer * Add window icon using .qrc resource file and setWindowIcon() function for Linux and Windows * Add MacOS bundle icon using MACOSX_BUNDLE_ICON_FILE property and add it as a bundle resource * Add Windows application executable icon using .rc resource file * Add NSIS installer icons using CPACK_PACKAGE_ICON, CPACK_NSIS_MUI_ICON and CPACK_NSIS_MUI_UNIICON variables * Add icon file, desktop entry file and appstream file for Linux desktop environments NOTE: This is mostly based on the OpenEMV dukpt project.
- Loading branch information
Showing
16 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
|
||
# Let script show exact commands | ||
set -x | ||
|
||
# NOTE: this script depends on Imagemagick. Given that Imagemagick may | ||
# delegate processing of SVGs to various different backends that may have | ||
# different behaviour regarding the alpha channel, it's best to use a PNG icon | ||
# with the correct alpha channel as the input icon. | ||
# | ||
# NOTE: this script also depends on png2icns (see | ||
# https://sourceforge.net/projects/icns/) | ||
|
||
function help { | ||
printf "Usage: %s [icons-dir] [input-icon]\n" "$(basename "$0")" | ||
exit 1 | ||
} | ||
|
||
if [ $# -ne 2 ]; then | ||
help | ||
fi | ||
|
||
icons_dir="$1" | ||
input_icon="$2" | ||
|
||
if [ ! -f "${input_icon}" ]; then | ||
printf "${input_icon} does not exist!\n" | ||
exit 1 | ||
fi | ||
|
||
# Trim and center the input icon before creating the various resized outputs | ||
# NOTE: 57px offset ensures that the card image is in the center | ||
magick "${input_icon}" -trim -resize 1024x1024 -background none -gravity center -extent 1024x1024+0-57 "${icons_dir}/openemv_emv_utils_1024x1024.png" | ||
|
||
# Output various icon sizes for use in the menu, app window, taskbar and installer | ||
magick "${icons_dir}/openemv_emv_utils_1024x1024.png" -resize 512x512 -background none -gravity center -extent 512x512 "${icons_dir}/openemv_emv_utils_512x512.png" | ||
magick "${icons_dir}/openemv_emv_utils_1024x1024.png" -resize 256x256 -background none -gravity center -extent 256x256 "${icons_dir}/openemv_emv_utils_256x256.png" | ||
magick convert "${icons_dir}/openemv_emv_utils_256x256.png" "${icons_dir}/openemv_emv_utils.ico" | ||
|
||
# Output icon for MacOS | ||
png2icns "${icons_dir}/openemv_emv_utils.icns" "${icons_dir}/openemv_emv_utils_1024x1024.png" | ||
|
||
# Trim and relocate the input icon for Windows NSIS installer (150x57 geometry) | ||
magick "${input_icon}" -trim -resize 150x53 -background white -gravity center -extent 150x53 - | magick - -resize 150x57 -background white -gravity south -extent 150x57 "${icons_dir}/openemv_emv_utils_150x57.png" | ||
magick convert "${icons_dir}/openemv_emv_utils_150x57.png" "BMP3:${icons_dir}/openemv_emv_utils.bmp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<component type="desktop"> | ||
<id>org.openemv.emv-viewer</id> | ||
<metadata_license>CC0-1.0</metadata_license> | ||
<project_license>GPL-3.0</project_license> | ||
<name>EMV Viewer</name> | ||
<summary>Decoder and viewer for EMV card data</summary> | ||
<description> | ||
<p> | ||
EMV Viewer is a graphical user interface to decode and view EMV card data, including: | ||
</p> | ||
<ul> | ||
<li>Decoding of ISO 3166 country codes</li> | ||
<li>Decoding of ISO 4217 currency codes</li> | ||
<li>Decoding of ISO 8859 strings</li> | ||
<li>Decoding of ISO 18245 Merchant Category Codes (MCC)</li> | ||
</ul> | ||
</description> | ||
<launchable type="desktop-id">emv-viewer.desktop</launchable> | ||
<url type="homepage">https://github.com/openemv/emv-utils</url> | ||
<url type="bugtracker">https://github.com/openemv/emv-utils/issues</url> | ||
<provides> | ||
<id>emv-viewer.desktop</id> | ||
<binary>emv-viewer</binary> | ||
</provides> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[Desktop Entry] | ||
Type=Application | ||
Name=EMV Viewer | ||
Comment=Decoder and viewer for EMV card data | ||
Exec=emv-viewer | ||
Icon=emv-viewer | ||
Categories=Development;Qt | ||
Terminal=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
IDI_ICON1 ICON DISCARDABLE "icons/openemv_emv_utils.ico" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!DOCTYPE RCC> | ||
<RCC version="1.0"> | ||
<qresource> | ||
<file>icons/openemv_emv_utils_512x512.png</file> | ||
<file>icons/openemv_emv_utils_256x256.png</file> | ||
</qresource> | ||
</RCC> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.