Examples of ArtifactThumbnail


Examples of io.lumify.core.model.artifactThumbnails.ArtifactThumbnail

    private static byte[] getThumbnailBytes(Vertex vertex, ArtifactThumbnailRepository artifactThumbnailRepository, User user, AnalystsNotebookExportConfiguration analystsNotebookExportConfiguration) {
        int[] dimensions = new int[]{analystsNotebookExportConfiguration.getThumbnailWidth(), analystsNotebookExportConfiguration.getThumbnailHeight()};
        String type = "raw";

        ArtifactThumbnail thumbnail = artifactThumbnailRepository.getThumbnail(vertex.getId(), type, dimensions[0], dimensions[1], user);
        if (thumbnail == null) {
            StreamingPropertyValue rawPropertyValue = LumifyProperties.RAW.getPropertyValue(vertex);
            if (rawPropertyValue == null) {
                return null;
            }
            InputStream in = rawPropertyValue.getInputStream();
            try {
                thumbnail = artifactThumbnailRepository.createThumbnail(vertex, type, in, dimensions, user);
            } catch (IOException e) {
                throw new LumifyException("error creating thumbnail", e);
            }
        }

        return thumbnail.getThumbnailData();
    }
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.