congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Thumber.determineScaleSize
Code IndexAdd Tabnine to your IDE (free)

How to use
determineScaleSize
method
in
com.atlassian.core.util.thumbnail.Thumber

Best Java code snippets using com.atlassian.core.util.thumbnail.Thumber.determineScaleSize (Showing top 4 results out of 315)

origin: com.atlassian.core/atlassian-core-utils

private WidthHeightHelper determineScaleSize(int maxWidth, int maxHeight, Image image)
{
  return determineScaleSize(maxWidth, maxHeight, image.getWidth(null), image.getHeight(null));
}
origin: com.atlassian.core/atlassian-core-utils

private BufferedImage scaleImage(Image originalImage, int maxWidth, int maxHeight)
{
  return scaleImage(originalImage, determineScaleSize(maxWidth, maxHeight, originalImage));
}
origin: com.atlassian.jira/jira-rest-plugin

  public UploadedAvatar scaleImageToTempFile(final Image sourceImage, final File targetFile, final int edgeSize)
      throws IOException
  {
    ThumbnailDimension targetDimension = thumber.determineScaleSize(edgeSize, edgeSize, sourceImage.getWidth(null), sourceImage.getHeight(null));
    BufferedImage scaledImage = thumber.scaleImage(sourceImage, targetDimension);

    ImageIO.write(scaledImage, AVATAR_IMAGE_FORMAT, targetFile);

    return new UploadedAvatar(targetFile, AVATAR_IMAGE_FORMAT_FULL.getContentType(), targetDimension.getWidth(), targetDimension.getHeight());
  }
}
origin: com.atlassian.jira/jira-core

private ResultAndContentTypeChanged cropImageToFile(final int edgeSize, final Image sourceImage)
{
  Result<File> prescaledFile = createTemporaryFile(TEMP_FILE_EXTENSION);
  if (!prescaledFile.isValid())
  {
    return new ResultAndContentTypeChanged(prescaledFile, false);
  }
  ThumbnailDimension dimensions = thumber.determineScaleSize(edgeSize, edgeSize, sourceImage.getWidth(null), sourceImage.getHeight(null));
  BufferedImage scaledImage = thumber.scaleImage(sourceImage, dimensions);
  try
  {
    ImageIO.write(scaledImage, AVATAR_IMAGE_FORMAT, prescaledFile.getResult());
    return new ResultAndContentTypeChanged(prescaledFile, true);
  }
  catch (IOException e)
  {
    return new ResultAndContentTypeChanged(new Result<File>().addError(getText("avatarpicker.upload.temp.io", e.getMessage()), ErrorCollection.Reason.SERVER_ERROR), false);
  }
}
com.atlassian.core.util.thumbnailThumberdetermineScaleSize

Popular methods of Thumber

  • getImage
    Reads an image from the specified input stream.
  • scaleImage
    This method should take BufferedImage argument, but takes just Image for backward compatibility (so
  • <init>
    Thumbnails will be generated of the given type and, if the type permits it (PNG), preserve transpare
  • createThumbnail
  • getThumbnail
  • isFileSupportedImage
  • retrieveOrCreateThumbNail
    Need to pass filename in as we cannot get the filename from the stream that is passed in
  • storeImage
    Store Image in format defined by Thumber constructor.
  • checkOutputFileCreation
  • storeImageAsJpeg
  • storeImageAsPng
  • storeImageAsPng

Popular in Java

  • Running tasks concurrently on multiple threads
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setScale (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Menu (java.awt)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Notification (javax.management)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now