Examples of ImageMetadata


Examples of ch.entwine.weblounge.common.impl.content.image.ImageMetadata

   *      java.io.InputStream, ch.entwine.weblounge.common.security.User,
   *      ch.entwine.weblounge.common.language.Language)
   */
  public Resource<ImageContent> newResource(Site site, InputStream is,
      User user, Language language) {
    ImageMetadata imageMetadata = ImageMetadataUtils.extractMetadata(new BufferedInputStream(is));
    ImageResource imageResource = new ImageResourceImpl(new ImageResourceURIImpl(site));
    imageResource.setCreated(user, new Date());

    if (imageMetadata == null)
      return imageResource;

    if (!StringUtils.isBlank(imageMetadata.getCaption())) {
      imageResource.setTitle(imageMetadata.getCaption(), language);
    }
    if (!StringUtils.isBlank(imageMetadata.getLegend())) {
      imageResource.setDescription(imageMetadata.getLegend(), language);
    }
    for (String keyword : imageMetadata.getKeywords()) {
      imageResource.addSubject(keyword);
    }
    if (!StringUtils.isBlank(imageMetadata.getCopyright())) {
      imageResource.setRights(imageMetadata.getCopyright(), language);
    }
    return imageResource;
  }
View Full Code Here

Examples of com.google.walkaround.wave.server.attachment.AttachmentMetadata.ImageMetadata

    ThumbnailData thumbnail = thumbnailDirectory.getWithoutTx(key);

    if (thumbnail == null) {
      log.info("Generating and storing thumbnail for " + key);

      ImageMetadata thumbDimensions = metadata.getThumbnail();

      if (thumbDimensions == null) {
        // TODO(danilatos): Provide a default thumbnail
        throw NotFoundException.withInternalMessage("No thumbnail available for attachment " + id);
      }

      byte[] thumbnailBytes = rawService.getResizedImageBytes(key,
          thumbDimensions.getWidth(), thumbDimensions.getHeight());

      thumbnail = new ThumbnailData(key, thumbnailBytes);

      if (thumbnailBytes.length > maxThumbnailSavedSizeBytes) {
        log.warning("Thumbnail for " + key + " too large to store " +
View Full Code Here

Examples of com.lightcrafts.image.metadata.ImageMetadata

    private void updateImage(TreePath path) {
        try {
            FileNode node = (FileNode) path.getLastPathComponent();
            File file = node.getFile();
            ImageInfo info = ImageInfo.getInstanceFor(file);
            ImageMetadata meta = info.getMetadata();
            if (meta != null) {
                if (thumb != null) {
                    remove(thumb);
                }
                thumb = new ThumbnailComponent(info);
View Full Code Here

Examples of com.lightcrafts.image.metadata.ImageMetadata

            }
            catch (IOException e) {
                // Maybe it's an image:
                try {
                    ImageInfo info = ImageInfo.getInstanceFor(file);
                    ImageMetadata meta = info.getMetadata();
                    new Document(meta, null);
                }
                catch (BadImageFileException f) {
                    System.err.println(e.getMessage());
                }
View Full Code Here

Examples of com.lightcrafts.image.metadata.ImageMetadata

        if (file.isFile()) {
            try {
                ImageInfo info = ImageInfo.getInstanceFor(file);
                ImageType type = info.getImageType();
                if (type instanceof RawImageType) {
                    ImageMetadata meta = info.getMetadata();
                    String make = meta.getCameraMake(true);
                    System.out.println(file.getName() + ": |" + make + "|");
                }
            }
            catch (BadImageFileException e) {
                handleError(file, e);
View Full Code Here

Examples of com.lightcrafts.image.metadata.ImageMetadata

                    doc = new Document(xmlDoc);
                }
                else {
                    // Maybe it's an image:
                    ImageInfo info = ImageInfo.getInstanceFor(file);
                    ImageMetadata meta = info.getMetadata();
                    doc = new Document(meta);
                }
            }
            catch (BadImageFileException e) {
                fail("Invalid image file", e);
View Full Code Here

Examples of com.lightcrafts.image.metadata.ImageMetadata

        getViewport().removeAll();
        if (path != null) {
            FileNode node = (FileNode) path.getLastPathComponent();
            File file = node.getFile();
            ImageInfo info = ImageInfo.getInstanceFor(file);
            ImageMetadata meta = null;
            Exception error = null;
            try {
                meta = info.getMetadata();
            }
            catch (Exception e) {
View Full Code Here

Examples of com.lightcrafts.image.metadata.ImageMetadata

    private void updateImage(TreePath path) {
        try {
            FileNode node = (FileNode) path.getLastPathComponent();
            File file = node.getFile();
            ImageInfo info = ImageInfo.getInstanceFor(file);
            ImageMetadata meta = info.getMetadata();
            if (meta != null) {
                if (preview != null) {
                    remove(preview);
                }
                preview = new PreviewComponent(info);
View Full Code Here

Examples of com.lightcrafts.image.metadata.ImageMetadata

    public void readMetadata( ImageInfo imageInfo )
        throws BadImageFileException, IOException, UnknownImageTypeException
    {
        final TIFFMetadataReader reader =
            new TIFFMetadataReader( imageInfo, DNGDirectory.class );
        final ImageMetadata metadata = reader.readMetadata();
        final Document xmpDoc = getXMP( imageInfo );
        if ( xmpDoc != null ) {
            final ImageMetadata xmpMetadata =
                XMPMetadataReader.readFrom( xmpDoc );
            metadata.mergeFrom( xmpMetadata );
        }
    }
View Full Code Here

Examples of com.lightcrafts.image.metadata.ImageMetadata

     */
    public RenderedImage getPreviewImage( ImageInfo imageInfo, int maxWidth,
                                          int maxHeight )
        throws BadImageFileException, IOException, UnknownImageTypeException
    {
        final ImageMetadata metadata = imageInfo.getMetadata();
        final ImageMetadataDirectory dir =
            metadata.getDirectoryFor( CIFFDirectory.class );
        if ( dir != null ) {
            final ImageMetaValue colorSpace = dir.getValue( CIFF_COLOR_SPACE );
            ColorSpace cs = JAIContext.sRGBColorSpace;
            if ( colorSpace != null )
                switch ( colorSpace.getIntValue() ) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.