Search in sources :

Example 41 with Image

use of com.adobe.cq.wcm.core.components.it.seljup.util.components.image.v2.Image in project openj9 by eclipse.

the class XMLIndexReader method _createCoreImageAfterParseError.

/**
 * This is like the setJ9DumpData method but is to be used when we fail to parse the file.  It is meant to try to construct the
 * Image object with what it was able to get
 *
 * @param e The cause of the error
 */
private void _createCoreImageAfterParseError(Exception e) {
    Builder builder = null;
    if (_stream == null) {
        // extract directly from the file
        builder = new Builder(_coreFile, _reader, 0, _fileResolvingAgent);
    } else {
        // extract using the data stream
        builder = new Builder(_coreFile, _stream, 0, _fileResolvingAgent);
    }
    _coreFile.extract(builder);
    String osType = builder.getOSType();
    String cpuType = builder.getCPUType();
    String cpuSubType = builder.getCPUSubType();
    long creationTime = builder.getCreationTime();
    _coreImage = new Image(osType, null, cpuType, cpuSubType, 0, 0, creationTime);
    Iterator spaces = builder.getAddressSpaces();
    while (spaces.hasNext()) {
        ImageAddressSpace addressSpace = (ImageAddressSpace) spaces.next();
        // Set all processes as having invalid runtimes
        for (Iterator processes = addressSpace.getProcesses(); processes.hasNext(); ) {
            ImageProcess process = (ImageProcess) processes.next();
            process.runtimeExtractionFailed(e);
        }
        _coreImage.addAddressSpace(addressSpace);
    }
}
Also used : ImageAddressSpace(com.ibm.dtfj.image.j9.ImageAddressSpace) ImageProcess(com.ibm.dtfj.image.j9.ImageProcess) Builder(com.ibm.dtfj.image.j9.Builder) Iterator(java.util.Iterator) Image(com.ibm.dtfj.image.j9.Image)

Aggregations

AnnotateImageRequest (com.google.cloud.vision.v1.AnnotateImageRequest)29 AnnotateImageResponse (com.google.cloud.vision.v1.AnnotateImageResponse)29 BatchAnnotateImagesResponse (com.google.cloud.vision.v1.BatchAnnotateImagesResponse)29 Feature (com.google.cloud.vision.v1.Feature)29 Image (com.google.cloud.vision.v1.Image)29 ImageAnnotatorClient (com.google.cloud.vision.v1.ImageAnnotatorClient)28 ArrayList (java.util.ArrayList)27 WebImage (com.google.cloud.vision.v1.WebDetection.WebImage)25 ByteString (com.google.protobuf.ByteString)18 EntityAnnotation (com.google.cloud.vision.v1.EntityAnnotation)16 ImageSource (com.google.cloud.vision.v1.ImageSource)15 FileInputStream (java.io.FileInputStream)14 WebPage (com.google.cloud.vision.v1.WebDetection.WebPage)8 Block (com.google.cloud.vision.v1.Block)6 ColorInfo (com.google.cloud.vision.v1.ColorInfo)6 CropHint (com.google.cloud.vision.v1.CropHint)6 CropHintsAnnotation (com.google.cloud.vision.v1.CropHintsAnnotation)6 DominantColorsAnnotation (com.google.cloud.vision.v1.DominantColorsAnnotation)6 FaceAnnotation (com.google.cloud.vision.v1.FaceAnnotation)6 LocationInfo (com.google.cloud.vision.v1.LocationInfo)6