Package org.apache.sanselan.formats.jpeg.segments

Examples of org.apache.sanselan.formats.jpeg.segments.SOFNSegment$Component


                } else if (marker == JFIFMarker)
                {
                    result.add(new JFIFSegment(marker, segmentData));
                } else if (Arrays.binarySearch(sofnSegments, marker) >= 0)
                {
                    result.add(new SOFNSegment(marker, segmentData));
                } else if (marker == DQTMarker)
                {
                    result.add(new DQTSegment(marker, segmentData));
                } else if ((marker >= JPEG_APP1_Marker)
                        && (marker <= JPEG_APP15_Marker))
View Full Code Here


            throw new ImageReadException("No JFIF Data Found.");

        if (segments.size() > 1)
            throw new ImageReadException("Redundant JFIF Data Found.");

        SOFNSegment fSOFNSegment = (SOFNSegment) segments.get(0);

        return new Dimension(fSOFNSegment.width, fSOFNSegment.height);
    }
View Full Code Here

        // + SOF_segments.size());

        ArrayList jfifSegments = readSegments(byteSource,
                new int[] { JFIFMarker, }, true);

        SOFNSegment fSOFNSegment = (SOFNSegment) SOF_segments.get(0);
        // SOFNSegment fSOFNSegment = (SOFNSegment) findSegment(segments,
        // SOFNmarkers);

        if (fSOFNSegment == null)
            throw new ImageReadException("No SOFN Data Found.");
View Full Code Here

        if (Arrays.binarySearch(sofnSegments, marker) >= 0)
        {
            if (marker != SOF0Marker)
                throw new ImageReadException("Only sequential, baseline JPEGs " +
                        "are supported at the moment");
            sofnSegment = new SOFNSegment(marker, segmentData);
        }
        else if (marker == DQTMarker)
        {
            DQTSegment dqtSegment = new DQTSegment(marker, segmentData);
            for (int i = 0; i < dqtSegment.quantizationTables.size(); i++)
View Full Code Here

                } else if (marker == JFIFMarker)
                {
                    result.add(new JFIFSegment(marker, segmentData));
                } else if ((marker >= SOF0Marker) && (marker <= SOF15Marker))
                {
                    result.add(new SOFNSegment(marker, segmentData));
                } else if ((marker >= JPEG_APP1_Marker)
                        && (marker <= JPEG_APP15_Marker))
                {
                    result.add(new UnknownSegment(marker, segmentData));
                }
View Full Code Here

            throw new ImageReadException("No JFIF Data Found.");

        if (segments.size() > 1)
            throw new ImageReadException("Redundant JFIF Data Found.");

        SOFNSegment fSOFNSegment = (SOFNSegment) segments.get(0);

        return new Dimension(fSOFNSegment.width, fSOFNSegment.height);
    }
View Full Code Here

        // + SOF_segments.size());

        ArrayList jfifSegments = readSegments(byteSource,
                new int[] { JFIFMarker, }, true);

        SOFNSegment fSOFNSegment = (SOFNSegment) SOF_segments.get(0);
        // SOFNSegment fSOFNSegment = (SOFNSegment) findSegment(segments,
        // SOFNmarkers);

        if (fSOFNSegment == null)
            throw new ImageReadException("No SOFN Data Found.");
View Full Code Here

    db.prepareDbUnit(getClass(), "migrate_components.xml");

    migration.execute();
    session.commit();

    Component root = mapper.selectComponentByKey("org.struts:struts");
    assertThat(root.getUuid()).isNotNull();
    assertThat(root.getProjectUuid()).isEqualTo(root.getUuid());
    assertThat(root.getModuleUuid()).isNull();
    assertThat(root.getModuleUuidPath()).isNull();

    Component module = mapper.selectComponentByKey("org.struts:struts-core");
    assertThat(module.getUuid()).isNotNull();
    assertThat(module.getProjectUuid()).isEqualTo(root.getUuid());
    assertThat(module.getModuleUuid()).isEqualTo(root.getUuid());
    assertThat(module.getModuleUuidPath()).isEqualTo(root.getUuid());

    Component subModule = mapper.selectComponentByKey("org.struts:struts-db");
    assertThat(subModule.getUuid()).isNotNull();
    assertThat(subModule.getProjectUuid()).isEqualTo(root.getUuid());
    assertThat(subModule.getModuleUuid()).isEqualTo(module.getUuid());
    assertThat(subModule.getModuleUuidPath()).isEqualTo(root.getUuid() + "." + module.getUuid());

    Component directory = mapper.selectComponentByKey("org.struts:struts-core:src/org/struts");
    assertThat(directory.getUuid()).isNotNull();
    assertThat(directory.getProjectUuid()).isEqualTo(root.getUuid());
    assertThat(directory.getModuleUuid()).isEqualTo(subModule.getUuid());
    assertThat(directory.getModuleUuidPath()).isEqualTo(root.getUuid() + "." + module.getUuid() + "." + subModule.getUuid());

    Component file = mapper.selectComponentByKey("org.struts:struts-core:src/org/struts/RequestContext.java");
    assertThat(file.getUuid()).isNotNull();
    assertThat(file.getProjectUuid()).isEqualTo(root.getUuid());
    assertThat(file.getModuleUuid()).isEqualTo(subModule.getUuid());
    assertThat(file.getModuleUuidPath()).isEqualTo(root.getUuid() + "." + module.getUuid() + "." + subModule.getUuid());

    // Verify that each generated uuid is unique
    assertThat(ImmutableSet.of(root.getUuid(), module.getUuid(), subModule.getUuid(), directory.getUuid(), file.getUuid())).hasSize(5);
  }
View Full Code Here

    db.prepareDbUnit(getClass(), "not_migrate_already_migrated_components.xml");

    migration.execute();
    session.commit();

    Component root = mapper.selectComponentByKey("org.struts:struts");
    assertThat(root.getUuid()).isEqualTo("ABCD");
    assertThat(root.getProjectUuid()).isEqualTo("ABCD");
    assertThat(root.getModuleUuid()).isNull();
    assertThat(root.getModuleUuidPath()).isNull();

    Component module = mapper.selectComponentByKey("org.struts:struts-core");
    assertThat(module.getUuid()).isEqualTo("BCDE");
    assertThat(module.getProjectUuid()).isEqualTo("ABCD");
    assertThat(module.getModuleUuid()).isEqualTo("ABCD");
    assertThat(module.getModuleUuidPath()).isEqualTo("ABCD");

    Component subModule = mapper.selectComponentByKey("org.struts:struts-db");
    assertThat(subModule.getUuid()).isNotNull();
    assertThat(subModule.getProjectUuid()).isEqualTo("ABCD");
    assertThat(subModule.getModuleUuid()).isEqualTo("BCDE");
    assertThat(subModule.getModuleUuidPath()).isEqualTo("ABCD.BCDE");

    Component directory = mapper.selectComponentByKey("org.struts:struts-core:src/org/struts");
    assertThat(directory.getUuid()).isNotNull();
    assertThat(directory.getProjectUuid()).isEqualTo("ABCD");
    assertThat(directory.getModuleUuid()).isEqualTo(subModule.getUuid());
    assertThat(directory.getModuleUuidPath()).isEqualTo("ABCD.BCDE." + subModule.getUuid());

    Component file = mapper.selectComponentByKey("org.struts:struts-core:src/org/struts/RequestContext.java");
    assertThat(file.getUuid()).isNotNull();
    assertThat(file.getProjectUuid()).isEqualTo("ABCD");
    assertThat(file.getModuleUuid()).isEqualTo(subModule.getUuid());
    assertThat(file.getModuleUuidPath()).isEqualTo("ABCD.BCDE." + subModule.getUuid());

    Component removedFile = mapper.selectComponentByKey("org.struts:struts-core:src/org/struts/RequestContext2.java");
    assertThat(removedFile.getUuid()).isEqualTo("DCBA");
    assertThat(removedFile.getProjectUuid()).isEqualTo("ABCD");
    assertThat(removedFile.getModuleUuid()).isEqualTo("BCDE");
    assertThat(removedFile.getModuleUuidPath()).isEqualTo("ABCD.BCDE");
  }
View Full Code Here

    db.prepareDbUnit(getClass(), "migrate_disable_components.xml");

    migration.execute();
    session.commit();

    Component root = mapper.selectComponentByKey("org.struts:struts");
    assertThat(root.getUuid()).isNotNull();

    Component module = mapper.selectComponentByKey("org.struts:struts-core");
    assertThat(module.getUuid()).isNotNull();
    assertThat(module.getProjectUuid()).isEqualTo(root.getUuid());
    // Module and module path will always be null for removed components
    assertThat(module.getModuleUuid()).isNull();
    assertThat(module.getModuleUuidPath()).isNull();

    Component subModule = mapper.selectComponentByKey("org.struts:struts-db");
    assertThat(subModule.getUuid()).isNotNull();
    assertThat(subModule.getProjectUuid()).isEqualTo(root.getUuid());
    // Module and module path will always be null for removed components
    assertThat(subModule.getModuleUuid()).isNull();
    assertThat(subModule.getModuleUuidPath()).isNull();

    Component directory = mapper.selectComponentByKey("org.struts:struts-core:src/org/struts");
    assertThat(directory.getUuid()).isNotNull();
    assertThat(directory.getProjectUuid()).isEqualTo(root.getUuid());
    // Module and module path will always be null for removed components
    assertThat(directory.getModuleUuid()).isNull();
    assertThat(directory.getModuleUuidPath()).isNull();

    Component file = mapper.selectComponentByKey("org.struts:struts-core:src/org/struts/RequestContext.java");
    assertThat(file.getUuid()).isNotNull();
    assertThat(file.getProjectUuid()).isEqualTo(root.getUuid());
    // Module and module path will always be null for removed components
    assertThat(file.getModuleUuid()).isNull();
    assertThat(file.getModuleUuidPath()).isNull();
  }
View Full Code Here

TOP

Related Classes of org.apache.sanselan.formats.jpeg.segments.SOFNSegment$Component

Copyright © 2018 www.massapicom. 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.