PedrozaThumbnail Extension

extension

#1

PedrozaThumbnail Extension

Hello! Here I present to you my fourth extension ever created! This extension provides tools to extract thumbnails from an image or a video.

Background

There isn’t a deep background for this extension as the previous one. It all started when a friend asked me how to get the thumbnail of a video to use it in his app, and I told him that I could try a way, and here it is! I hope you can find it useful. If you find how to make it better, please let me know so I can learn from it!


For reference of the classes used in this extension, please consider reading the Android Developer’s Reference for Android about the ThumbnailUtils class.


Description

Tool developed by Carlos Pedroza to extract thumbnails from an image or a video.


Methods

  • GetFromVideo: Method for getting a thumbnail from a video. Parameters: String path - Text with the path to the video to create the new thumbnail. Number kind - Number with the specifications of the new thumbnail to be created. Use 1 for MiniKind or 3 for MicroKind. Number quality - Number with the desired quality of the image from 1 to 100. It returns a string with the path of the new thumbnail created.
    image

  • GetFromImage: Method for getting a thumbnail from an image. Parameters: String path - Text with the path to the image to create the new thumbnail. Number width - Number with the desired width in pixels (px). Number height - Number with the desired height in pixels (px). Number quality - Number with the desired quality of the image from 1 to 100. It returns a string with the path of the new thumbnail created.
    image

Properties

  • MiniKind: Returns number 1 to be used in the kind parameter for thumbnails with 512 x 384 pixels in size.
    image

  • MicroKind: Returns number 3 to be used in the kind parameter for thumbnails with 96 x 96 pixels in size.
    image


Examples

Blocks for getting a thumbnail with 150x150 pixels in size and 100 percent quality from an image displayed in an Image1 component when clicking Button1.

image

Blocks for getting a thumbnail with 512x384 pixels in size and 100 percent quality from an video located at certain path when clicking Button1.

image

Also, I recommend using the last Juan Antonio’s Explorer extension for getting the paths of the video or Taifun’s Metadata extension for more metadata information from an image.


Price

This extension is free and open source!

Yet, if you find this useful, you can donate!


Downloads

.AIX: com.pedroza.PedrozaThumbnail.aix (8.9 KB)

.JAVA Available at: Github


Changelog

  • November 1st, 2017 - Initial release.

Best Regards from :venezuela:,
Carlos Pedroza


#2

this extention getting error


#3

How to avoid runtime errors with the companion app

  • After importing an extension, please restart the companion app.
  • If you like to use an extension on a different screen, in Screen1 additionally drag the extension into the working area.

While starting the companion app, all necessary assets and also the imported extensions of your project will be copied to your device. So in case the no such class error shows up, the extension code to run the extension is not available on your device. Without that code the companion app is not able to execute methods from the extension.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.