Package org.photovault.dbhelper

Examples of org.photovault.dbhelper.ODMGXAWrapper.lock()


     */
    protected void createThumbnail( VolumeBase volume, boolean createPreview ) {
       
        log.debug( "Creating thumbnail for " + uid );
        ODMGXAWrapper txw = new ODMGXAWrapper();
        txw.lock( this, Transaction.WRITE );
       
        // Maximum size of the thumbnail
        int maxThumbWidth = 100;
        int maxThumbHeight = 100;
        checkCropBounds();
View Full Code Here


            // If there are no uncorrupted instances, no thumbnail can be created
            log.warn( "Error - no original image was found!!!" );
            txw.commit();
            return;
        }
        txw.lock( original, Transaction.READ );
        log.debug( "Found original, reading it..." );
       
        /*
         We try to ensure that the thumbnail is actually from the original image
         by comparing aspect ratio of it to original. This is not a perfect check
View Full Code Here

     @param height Height of the exported image in pixels
     @throws PhotovaultException if exporting the photo fails for some reason.
     */
    public void exportPhoto( File file, int width, int height ) throws PhotovaultException {
        ODMGXAWrapper txw = new ODMGXAWrapper();
        txw.lock( this, Transaction.WRITE );
       
        // Find the original image to use as a staring point
        ImageInstance original = null;
        for ( int n = 0; n < instances.size(); n++ ) {
            ImageInstance instance = (ImageInstance) instances.get( n );
View Full Code Here

            ImageInstance instance = (ImageInstance) instances.get( n );
            if ( instance.getInstanceType() == ImageInstance.INSTANCE_TYPE_ORIGINAL
                    && instance.getImageFile() != null
                    && instance.getImageFile().exists() ) {
                original = instance;
                txw.lock( original, Transaction.READ );
                break;
            }
        }
        if ( original == null ) {
            // If there are no instances, nothing can be exported
View Full Code Here

                    ri.setRawSettings( rawSettings );
                } else if ( rawSettings == null ) {
                    // No raw settings for this photo yet, let's use
                    // the thumbnail settings
                    rawSettings = ri.getRawSettings();
                    txw.lock( rawSettings, Transaction.WRITE );
                }
            }
            if ( width > 0 ) {
                exportImage =img.getRenderedImage( width, height, false );
            } else {
View Full Code Here

     Sets the original instance hash. This is intended for only internal use
     @param hash MD5 hash value for original instance
     */
    protected void setOrigInstanceHash( byte[] hash ) {
        ODMGXAWrapper txw = new ODMGXAWrapper();
        txw.lock( this, Transaction.WRITE );
        origInstanceHash = (byte[]) hash.clone();
        txw.commit();
    }
   
    java.util.Date shootTime;
View Full Code Here

     null (to mean that the time is unspecified)1
     @return value of shootTime.
     */
    public java.util.Date getShootTime() {
        ODMGXAWrapper txw = new ODMGXAWrapper();
        txw.lock( this, Transaction.READ );
        txw.commit();
        return shootTime != null ? (java.util.Date) shootTime.clone() : null;
    }
   
    /**
 
View Full Code Here

     * Set the value of shootTime.
     * @param v  Value to assign to shootTime.
     */
    public void setShootTime(java.util.Date  v) {
        ODMGXAWrapper txw = new ODMGXAWrapper();
        txw.lock( this, Transaction.WRITE );
        this.shootTime = (v != null) ? (java.util.Date) v.clone()  : null;
        modified();
        txw.commit();
    }
   
View Full Code Here

     Set both shooting time & accuracy directly using a FuzzyTime object
     @param v FuzzyTime containing new values.
     */
    public void setFuzzyShootTime( FuzzyDate v ) {
        ODMGXAWrapper txw = new ODMGXAWrapper();
        txw.lock( this, Transaction.WRITE );
        this.shootTime = (java.util.Date) v.getDate().clone();
        this.timeAccuracy = v.getAccuracy();
        modified();
        txw.commit();       
    }
View Full Code Here

     * Get the value of desc.
     * @return value of desc.
     */
    public String getDesc() {
        ODMGXAWrapper txw = new ODMGXAWrapper();
        txw.lock( this, Transaction.READ );
        txw.commit();
        return desc;
    }
   
    /**
 
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.