Page 1 of 2
Valid image formats inside image widget
Posted: Wed Feb 01, 2017 8:37 am
by KeithHodges
What image formats can successfully be displayed in genie inside an image widget? The documentation says "any valid image format", but while I can get many to work, tif images (which is how we have tens of millions of images stored), don't render. Is tif a valid format for the image widget? If not, is there a workaround other than converting the images?
Re: Valid image formats inside image widget
Posted: Wed Feb 01, 2017 9:52 am
by Glenn
Keith,
The issue you are describing is caused by the browser, not the image widget. Our image widget creates a basic <img> HTML element, so when we say "any valid image format" we mean that it supports any image format that the browser will render.
In the case of .tiff images, it appears from the link below that only a few browsers will support them and they apparently require a plugin (Please note that I have not researched the accuracy of the link).
https://en.wikipedia.org/wiki/Compariso ... at_support
Glenn
Re: Valid image formats inside image widget
Posted: Wed Feb 01, 2017 1:10 pm
by KeithHodges
Oh, you are so right!
Thanks.
Re: Valid image formats inside image widget
Posted: Wed Feb 01, 2017 2:05 pm
by matt.denninghoff
If installing a plugin will not work, and if bulk converting the formats is a problem, there is another option if you use PHP on the i. You could write PHP programs to accept some TIFF file name argument, then automatically convert the file to another format, then return the data back to the browser.
There are even open source libraries that might work on the i that automatically generate image thumbnails; e.g.
http://phpthumb.sourceforge.net/
You'd need GD and ImageMagick libraries, which support image manipulation. On our development machine, at least, those are available.
Re: Valid image formats inside image widget
Posted: Wed Feb 01, 2017 4:32 pm
by KeithHodges
Yes, we'll use ImageMagick to do the job.
Re: Valid image formats inside image widget
Posted: Thu Feb 02, 2017 3:44 am
by Scott Klement
ImageMagick can be easily run from a QShell/PASE command-line. This can be invoked from RPG or CL programs. There's really no need to use PHP for this sort of thing (unless you want to.)
Re: Valid image formats inside image widget
Posted: Thu Jul 12, 2018 3:57 am
by Seyfried
Hello Scott,
I want to use ImageMagick with QSHELL. Do you have any advice how to use the QSHELL Command.
I have downloaded the portable Version of ImageMagick. When i call the magick with parameters i receive the follwoing Error-Statements.
magick 2695307_0.tif 2695307_0.jpg
qsh: 001-0019 Fehler gefunden beim Suchen des Befehls magick. Kein Pfad oder keine Bibliothek mit diesem Namen.
$
magick.exe 2695307_0.tif 2695307_0.jpg
/tmp/ImageMagick/magick.exe: 001-0050 Syntaxfehler bei Zeile 1: Token "(" nicht erwartet.
Re: Valid image formats inside image widget
Posted: Thu Jul 12, 2018 6:56 am
by TaskForce_Kerim
Hey Seyfried,
you cannot simply run .exe files in the QSHELL. .exe files are typically executable binaries for the Windows operating system, you can only run them on Windows or with the help of some compatibility layer like WINE.
You either have to find a prebuilt binary speficially for your operating system or you have to download the source code of ImageMagick and compile the source code and build the executable yourself. But you're in luck, Scott has a prebuilt version of imagemagick that you can download
https://www.scottklement.com/imagemagick/.
Re: Valid image formats inside image widget
Posted: Fri Jul 13, 2018 1:02 pm
by Scott Klement
I agree with Kerim. You need ImageMagick for IBM i (or AIX, since AIX software can be run under PASE). You can't the Windows version on IBM i.
Re: Valid image formats inside image widget
Posted: Thu Aug 16, 2018 9:20 am
by TaskForce_Kerim
Hello Keith,
I managed to create a custom image widget that can show .tif images. Would you mind uploading some of the ones you have, so that I can test it?
This is necessary because not all .tif images are the same, for example they can use different compression algorithms.