Class ImageUtilities

  • java.lang.Object
    • com.thingworx.utils.ImageUtilities
    • Constructor Summary

      Constructors 
      Constructor Description
      ImageUtilities()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] cropAndResizeImage​(byte[] imageData, int x, int y, int cropWidth, int cropHeight, int width, int height)  
      static byte[] cropImage​(byte[] imageData, int x, int y, int cropWidth, int cropHeight)  
      static byte[] formatImage​(byte[] imageData)  
      static byte[] formatImage​(byte[] imageData, java.lang.String mimeType)  
      static byte[] resizeImage​(byte[] imageData, int width, int height)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ImageUtilities

        public ImageUtilities()
    • Method Detail

      • resizeImage

        @ThingworxExtensionApiMethod(since={6,6})
        public static byte[] resizeImage​(byte[] imageData,
                                         int width,
                                         int height)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception - If an error occurs
      • cropImage

        @ThingworxExtensionApiMethod(since={6,6})
        public static byte[] cropImage​(byte[] imageData,
                                       int x,
                                       int y,
                                       int cropWidth,
                                       int cropHeight)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception - If an error occurs
      • cropAndResizeImage

        @ThingworxExtensionApiMethod(since={6,6})
        public static byte[] cropAndResizeImage​(byte[] imageData,
                                                int x,
                                                int y,
                                                int cropWidth,
                                                int cropHeight,
                                                int width,
                                                int height)
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception - If an error occurs
      • formatImage

        @ThingworxExtensionApiMethod(since={7,4})
        public static byte[] formatImage​(byte[] imageData)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception - If an error occurs
      • formatImage

        @ThingworxExtensionApiMethod(since={8,4})
        public static byte[] formatImage​(byte[] imageData,
                                         java.lang.String mimeType)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception - If an error occurs