Howto: Popular AppImages one click away

Post tutorials, HOWTO's and other useful resources here.
User avatar
M. Eerie
Shogun
Shogun
Posts: 213
Joined: 31 Aug 2017, 21:18
Distribution: APorteus BUDGIE x64

Howto: Popular AppImages one click away

Post#61 by M. Eerie » 31 Mar 2020, 12:34

ncmprhnsbl wrote:
31 Mar 2020, 12:20
we should split this conversation out of this topic since it's not about appimages any more
Agree, this exceeds the limit of one click away... :D

I would ask for permission to edit the first post to include the new contributions and to put a little order

Cheers!

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 2472
Joined: 20 Mar 2012, 03:42
Distribution: 5.0rc1-64bit all-DE+more
Location: australia
Contact:

Howto: Popular AppImages one click away

Post#62 by ncmprhnsbl » 31 Mar 2020, 13:28

M. Eerie wrote:
31 Mar 2020, 12:34
I would ask for permission to edit the first post to include the new contributions and to put a little order
and i would glady give permission if i had the power :D
i'll look into it and see what can be done..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Rava
Contributor
Contributor
Posts: 2480
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 5.0rc1 x86-64 XFCe
Location: Forests of Germany

Howto: Popular AppImages one click away

Post#63 by Rava » 02 Apr 2020, 06:37

M. Eerie wrote:
09 Jul 2019, 16:01
ImageMagick Create, edit, compose, or convert bitmap images
Does anyone know the weird naming logic behind IM versions?
The most recent one is Release build (7.0.10-3)
But it is called 23e57a6.

E.g. the download is ImageMagick-23e57a6-clang-x86_64.AppImage

Trying to find info on that on "Travis CI build log: https://travis-ci.org/ImageMagick/Image ... /668301423 " was to no prevail.
Cheers!
Yours Rava

User avatar
M. Eerie
Shogun
Shogun
Posts: 213
Joined: 31 Aug 2017, 21:18
Distribution: APorteus BUDGIE x64

Howto: Popular AppImages one click away

Post#64 by M. Eerie » 02 Apr 2020, 07:47

Rava wrote:
02 Apr 2020, 06:37
But it is called 23e57a6.
This is the commit number. Imagemagick is in continuous development cycle and it seems they use this versioning convention.

Thinking about this, I don't really know how to use the different tool set Imagemagick provides in his AppImage incarnation. I mean, animate, compare, composite, conjure, convert, display, identify, import, mogrify, montage and stream are all symlinks to the /usr/lib/magick command which is not a clickable one... How does one invoke them without going to the shell? Even more, how does one invoke them going to the shell through the AppImage?


This is the AppRun.sh script contents:

Code: Select all

#!/bin/bash

# The purpose of this custom AppRun script is
# to allow symlinking the AppImage and invoking
# the corresponding binary depending on which
# symlink was used to invoke the AppImage

HERE="$(dirname "$(readlink -f "${0}")")"

export MAGICK_HOME="$HERE/usr:$MAGICK_HOME" # https://imagemagick.org/QuickStart.txt
export MAGICK_CONFIGURE_PATH=$(readlink -f "$HERE/usr/lib/ImageMagick-7.0.7/config-Q16"):$(readlink -f "$HERE/usr/lib/ImageMagick-7.0.7/config-Q16HDRI"):$(readlink -f "$HERE/usr/share/ImageMagick-7"):$(readlink -f "$HERE/usr/etc/ImageMagick-7"):$MAGICK_CONFIGURE_PATH #Wildcards don't work

export LD_LIBRARY_PATH=$(readlink -f "$HERE/usr/lib"):$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${HERE}/usr/lib/ImageMagick-7.0.7/modules-Q16HDRI/coders:$LD_LIBRARY_PATH

if [ "$1" == "man" ] ; then
  export MANPATH="$HERE/usr/share/man:$MANPATH" ; exec "$@" ; exit $?
elif [ "$1" == "info" ] ; then
  export INFOPATH="$HERE/usr/share/info:$INFOPATH" ; exec "$@" ; exit $?
fi

if [ ! -z $APPIMAGE ] ; then
  BINARY_NAME=$(basename "$ARGV0")
  if [ -e "$HERE/usr/bin/$BINARY_NAME" ] ; then
    exec "$HERE/usr/bin/$BINARY_NAME" "$@"
  else
    exec "$HERE/usr/bin/magick" "$@"
  fi
else
  exec "$HERE/usr/bin/magick" "$@"
fi
Cheers!

User avatar
Rava
Contributor
Contributor
Posts: 2480
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 5.0rc1 x86-64 XFCe
Location: Forests of Germany

Howto: Popular AppImages one click away

Post#65 by Rava » 02 Apr 2020, 10:00

M. Eerie wrote:
02 Apr 2020, 07:47
This is the commit number. Imagemagick is in continuous development cycle and it seems they use this versioning convention.
Thanks for the info.
M. Eerie wrote:
02 Apr 2020, 07:47
How does one invoke them without going to the shell? Even more, how does one invoke them going to the shell through the AppImage?
How to use it?
Quite simple.

Code: Select all

$ ln -s ImageMagick-23e57a6-clang-x86_64.AppImage mogrify
Unless you are only using the symlink in the folder where ImageMagick-23e57a6-clang-x86_64.AppImage sits, you need to apply the full path to the target. To make it universally working, create the symlink in /usr/local/bin/ like so:

Code: Select all

# ln -s $(realpath ImageMagick-23e57a6-clang-x86_64.AppImage /usr/local/bin/mogrify
(The above only works if you are currently in the folder the AppImage itself is sitting, if not, replace the $(realpath […]) construct with the full path to the AppImage)

For my demonstration how it would work I used a local symlink that only works in the directory the AppImage is also in.
To use mogrify you then do:

Code: Select all

$ ./mogrify -verbose -format jpeg -quality 93 /tmp/Screenshot_2020-04-02_07-57-03.png 
/tmp/Screenshot_2020-04-02_07-57-03.png PNG 313x73 313x73+0+0 8-bit sRGB 10104B 0.010u 0:00.011
/tmp/Screenshot_2020-04-02_07-57-03.png=>/tmp/Screenshot_2020-04-02_07-57-03.jpeg PNG 313x73 313x73+0+0 8-bit sRGB 15832B 0.000u 0:00.012
$ ls -o /tmp/Screenshot_2020-04-02_07-57-03.*
-rw-r--r-- 1 guest 15832 Apr  2 12:03 /tmp/Screenshot_2020-04-02_07-57-03.jpeg
-rw-r--r-- 1 guest 10104 Apr  2 07:57 /tmp/Screenshot_2020-04-02_07-57-03.png
HTH!

Cave! getting help can be a bit tricky:

Code: Select all

$ ./mogrify --help
mogrify: unable to open image '--help': No such file or directory @ error/blob.c/OpenBlob/3496.
mogrify: no decode delegate for this image format `' @ error/constitute.c/ReadImage/562.
___________________________

I usually use the fork, GraphicsMagick , but was unable to find a binary for the most recent version, 1.3.35.
See my report here: https://sourceforge.net/p/graphicsmagic ... on/250738/

And yes, I use a module of an older GM version, since you usually use it via console anyway.

(I tried downloading the most recent GM version and then extract the files to create a GM module for 5.0rc1 Porteus. Hopefully there are binaries for GM 1.3.35 and x86-64 Linux somewhere)

User avatar
Rava
Contributor
Contributor
Posts: 2480
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 5.0rc1 x86-64 XFCe
Location: Forests of Germany

Howto: Popular AppImages one click away

Post#66 by Rava » 02 Apr 2020, 14:05

Update

I got a reply on my GM question and linux binaries:
Providing Linux "binaries" is not within the project scope. Linux is an operating system kernel and then Linux distributions add the necessary libraries and other infrastructure to produce a complete "operating system". Each major Linux distribution is different. In addition to the run-time libraries, Linux targets many different types of hardware.

Each Linux distribution normally provides GraphicsMagick binaries.
Some Linux distributions provide rather old versions and some provide very recent versions.

If you are using a stable/LTS Linux distribution, then you may need to compile GraphicsMagick from source code in order to have the latest GraphicsMagick.
Le sigh. Compiling it manually. :shock: The horror. =@
Cheers!
Yours Rava

User avatar
M. Eerie
Shogun
Shogun
Posts: 213
Joined: 31 Aug 2017, 21:18
Distribution: APorteus BUDGIE x64

Howto: Popular AppImages one click away

Post#67 by M. Eerie » 03 Apr 2020, 06:39

Rava wrote:
02 Apr 2020, 10:00
To make it universally working, create the symlink in /usr/local/bin/ like so:
Ok, but then, what's the purpose of the AppRun.sh script above? :hmmm: Maybe It has to be related to some AppImage manager/daemon which is AppRun.sh aware (AppImageKit, AppImaged or similar)...

This is the AppRun.sh reference int AppImage specification.



Cheers!

User avatar
Rava
Contributor
Contributor
Posts: 2480
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 5.0rc1 x86-64 XFCe
Location: Forests of Germany

Howto: Popular AppImages one click away

Post#68 by Rava » 03 Apr 2020, 07:41

M. Eerie wrote:
03 Apr 2020, 06:39
Ok, but then, what's the purpose of the AppRun.sh script above? :hmmm: Maybe It has to be related to some AppImage manager/daemon which is AppRun.sh aware (AppImageKit, AppImaged or similar)...

This is the AppRun.sh reference int AppImage specification.
I have no clue what the purpose of the AppRun.sh is in this case.
I merely concentrated in finding the working solution, and after I did, showing you how to use the binaries (or symlinks) to use IM from the console. Image

But I do get your point, at times I also want to know why stuff is done in a certain way, especially when it comes to the CLI. B)
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 2480
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 5.0rc1 x86-64 XFCe
Location: Forests of Germany

Howto: Popular AppImages one click away

Post#69 by Rava » 03 Apr 2020, 08:43

M. Eerie, I know, it is a boring Porteus module and not an AppImage, but maybe you are interested in my GraphicsMagick V1.3.35 x86_64 module of the most recent version of GraphicsMagick.
And yes, that is for use via the Command-line interface as well, but at the end of my article I provided some examples.

But please heed my warning:
Rava wrote:
03 Apr 2020, 08:38
Cave! Some commands might overwrite the input file! Make sure you understand the syntax of the gm commands prior using them on the only original files without having made backups.
Cheers!
Yours Rava

Post Reply