@Test public void test_ColorPaletteExtraction_FailForVideo() throws Exception { final ImageMetaInfo metaInfo = new ColorExtractor(PATH_COLORMAP).colorExtraction(getPath(Video1)); assertNull(metaInfo); }
public ImageMetaInfo colorExtraction(final String path) throws IOException, InterruptedException { boolean success = true; int retry = 3; do { try { if (MediaChecker.getMimeType(path).startsWith("image")) { final ImageMetaInfo imageMetaInfo = MediaMetaDataUtils.extractImageMetadata(path, colorMapPath); return new ImageMetaInfo(null, null, null, null, null, null, imageMetaInfo.getColorPalette(), null); } } catch (Exception e) { e.printStackTrace(); if (retry > 0) { success = false; Thread.sleep(1000); retry = -1; } else { success = true; } } } while (!success); return null; }
ColorExtractor { public ImageMetaInfo colorExtraction(final String path) throws IOException, InterruptedException { boolean success = true; int retry = 3; do { try { if (MediaChecker.getMimeType(path).startsWith("image")) { final ImageMetaInfo imageMetaInfo = MediaMetaDataUtils.extractImageMetadata(path, colorMapPath); return new ImageMetaInfo(null, null, null, null, null, null, imageMetaInfo.getColorPalette(), null); } } catch (Exception e) { e.printStackTrace(); if (retry > 0) { success = false; Thread.sleep(1000); retry = -1; } else { success = true; } } } while (!success); return null; } }
ColorExtractor { public ImageMetaInfo colorExtraction(final String path) throws IOException, InterruptedException { boolean success = true; int retry = 3; do { try { if (MediaChecker.getMimeType(path).startsWith("image")) { final ImageMetaInfo imageMetaInfo = MediaMetaDataUtils.extractImageMetadata(path, colorMapPath); return new ImageMetaInfo(null, null, null, null, null, null, imageMetaInfo.getColorPalette(), null); } } catch (Exception e) { e.printStackTrace(); if (retry > 0) { success = false; Thread.sleep(1000); retry = -1; } else { success = true; } } } while (!success); return null; } ColorExtractor(String colorMapPath); }
ColorExtractor { public ImageMetaInfo colorExtraction(final String path) throws IOException, InterruptedException { boolean success = true; int retry = 3; do { try { if (MediaChecker.getMimeType(path).startsWith("image")) { final ImageMetaInfo imageMetaInfo = MediaMetaDataUtils.extractImageMetadata(path, colorMapPath); return new ImageMetaInfo(null, null, null, null, null, null, imageMetaInfo.getColorPalette(), null); } } catch (Exception e) { e.printStackTrace(); if (retry > 0) { success = false; Thread.sleep(1000); retry = -1; } else { success = true; } } } while (!success); return null; } ColorExtractor(String colorMapPath); ImageMetaInfo colorExtraction(final String path); }
ColorExtractor { public ImageMetaInfo colorExtraction(final String path) throws IOException, InterruptedException { boolean success = true; int retry = 3; do { try { if (MediaChecker.getMimeType(path).startsWith("image")) { final ImageMetaInfo imageMetaInfo = MediaMetaDataUtils.extractImageMetadata(path, colorMapPath); return new ImageMetaInfo(null, null, null, null, null, null, imageMetaInfo.getColorPalette(), null); } } catch (Exception e) { e.printStackTrace(); if (retry > 0) { success = false; Thread.sleep(1000); retry = -1; } else { success = true; } } } while (!success); return null; } ColorExtractor(String colorMapPath); ImageMetaInfo colorExtraction(final String path);  }