java tomcat: what library should i use to convert images to jpg and create thumbnails on-the-fly? - servlets

I have a form that accepts image file, i want to be able to convert this image from any common format to jpg and to create a thumbnail. what's the recommended method to achieve such a thing?
Working with latest apache-tomcat on a gentoo linux server.
thanks

Imagemagick is a pretty solid library that a lot of people use for such a purpose.

Related

How to download an image from url to use in ILLUSTRATOR scripting (ExtendScript Toolkit)

To place an image into Adobe Illustrator using the ExtendScript Toolkit is well documented:
var placedItem = doc.placedItems.add();
placedItem.file = new File("~/Desktop/xxx.jpg");
placedItem.position = [100,370];
Does anyone know how to place an image from URL into Adobe Illustrator. For example: https://www.bcgen.com/demo/IDAutomationStreamingDataMatrix.aspx?D=TEST123&PT=T&MODE=3&X=1&LM=1
In Photoshop one can use app.system(curl -o .....) as explanined here (How to download an image from url to use in Photoshop scripting (ExtendScript Toolkit)). But in Illustrator app.system() seems not to be available. Maybe do.script() is the right way to go but did not figure out how so far....
JSXGetURL is meant to work with any Adobe Creative Cloud application that has ExtendScript support – InDesign, InDesign Server, InCopy, Illustrator, Photoshop…
JSXGetURL is implemented as an ExtendScript DLL/framework, written in C/C++.
This DLL allows you to access URLs (including https: or ftp:) straight from ExtendScript.
There is nothing to install – all you need to do is //#include a .jsx file which then loads the DLL.
See https://coppieters.nz/?p=577
Disclosure: I am the author of JSXGetURL.

Display CHM file in JavaFX app

Is there a way to display Compiled Help manual CHM in a javaFX app, without using java.awt.Desktop from AWT ?
Calling A CHM reader using Runtime.getRuntime().exec(help.chm) is an option, but to make it cross platform, this would require every user in mac, win and linux to have a CHM reader installed.
What's the best option for a cross platform solution ? should I extract it to HTML and display it in javafx.scene.web.WebView ?
Given your wish to be platform independent, I'd advise to go to the HTML route as you yourself suggested. I don't know your reason for converting CHM to HTML if you also control the source, in that case I'd either use HTML directly or markdown to HTML.
You should try this. It's works for me!

Qt how to create font from image?

I need to use some custom font for numbers in my Qt app, but company ask me to use image as font, font file is not allowed(For example: ttf).
the font image like this:
So i wonder is possible to converting the font image to QFont?
like a Qt font generator.
Or any other solution?
There is nothing out of the box that supports what you are looking for. You would need to get around this company rule by building your own TrueTypeFont data programmatically from your image, keeping it in memory only and load that into your application with addApplicationFontFromData(const QByteArray & fontData).
Unfortunately I cannot find a single library that does this, and the TTF format appears dauntingly complex. I would suggest looking into this open source project for font creation. Perhaps you can use this as a starting point? http://fontforge.github.io/en-US/
You may want to find out the reason your company is telling you that you cannot use a custom font. (I just remembered reading that QT has difficulties storing a font as a "resource". If it's not due to copyright issues, then you could suggest not using an image, but storing the entire file in the source code in a text format like base-64. Then convert it back into binary at startup, then load it up as a new font from a QByteArray.
I guess it's about copyright issues ? There are lots of ttf fonts available for completely free commercial use. E.G. have a look at Droid Sans Mono : https://www.google.com/fonts/specimen/Droid+Sans+Mono
Otherwise it would be good to know the reason why ttf is not allowed.
It is possible to create a font from a vector graphic.
If you have resonable high resolution images of every letter (if not already vector graphics) you can try to convert them to vector graphics (SVG).
Afterwards you can use tools to convert SVG to a font. This would be most likely a ttf font which can be used with QFont.

Use image as thumbnails without save its

I want to genrate a thumbnails of image without save its differentlty
ImageResizer supports resizing images and it can output the thumbnail to a stream (for example a MemoryStream), so you don't have to save the image on disk. It has a very good support for ASP.NET and it can be installed using NuGet.

Bitmap image are visible in Qt Designer but I can't see them after compiling in QDevelop IDE

In qt-designer I loaded bitmap images and in preview I am able to view the images. But after compiling in qdevelop IDE, I could not see the images at all.
Is there any procedure to load the bitmaps in to qdevelop.
Thanks in advance
I think you'll be wanting to add the bitmaps to a resource file, using Qt's resource system, if you want to be able to use them in Designer and also have them work in your compiled application correctly. I've not used it, but the examples look fairly straightforward, and it appears QDevelop supports the resource system to some extent.
Have you configured Qt to use required images plugins?
[-no-gif] [-qt-gif] [-no-libtiff] [-system-libtiff] [-no-libpng] [-qt-libpng] [-system-libpng] [-no-libmng] [-qt-libmng] [-system-libmng] [-no-libjpeg] [-qt-libjpeg] [-system-libjpeg]

Resources