/* Photo.c generated by valac 0.34.7, the Vala compiler
 * generated from Photo.vala, do not modify */

/* Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU LGPL (version 2.1 or later).
 * See the COPYING file in this distribution.
 */
/* Specifies how pixel data is fetched from the backing file on disk.  MASTER is the original*/
/* backing photo of any supported photo file format; SOURCE is either the master or the editable*/
/* file, that is, the appropriate reference file for user display; BASELINE is an appropriate*/
/* file with the proviso that it may be a suitable substitute for the master and/or the editable.*/
/* UNMODIFIED represents the photo with no edits, i.e. the head of the pipeline.*/
/**/
/* In general, callers want to use the BASELINE unless requirements are specific.*/

#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <time.h>
#include "shotwell-graphics-processor.h"
#include <glib/gstdio.h>
#include <float.h>
#include <math.h>
#include <gdk/gdk.h>
#include <glib/gi18n-lib.h>
#include <cairo.h>
#include <gobject/gvaluecollector.h>


#define TYPE_BACKING_FETCH_MODE (backing_fetch_mode_get_type ())

#define TYPE_PHOTO_IMPORT_PARAMS (photo_import_params_get_type ())
#define PHOTO_IMPORT_PARAMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_IMPORT_PARAMS, PhotoImportParams))
#define PHOTO_IMPORT_PARAMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_IMPORT_PARAMS, PhotoImportParamsClass))
#define IS_PHOTO_IMPORT_PARAMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_IMPORT_PARAMS))
#define IS_PHOTO_IMPORT_PARAMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_IMPORT_PARAMS))
#define PHOTO_IMPORT_PARAMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_IMPORT_PARAMS, PhotoImportParamsClass))

typedef struct _PhotoImportParams PhotoImportParams;
typedef struct _PhotoImportParamsClass PhotoImportParamsClass;
typedef struct _PhotoImportParamsPrivate PhotoImportParamsPrivate;

#define TYPE_IMPORT_ID (import_id_get_type ())
typedef struct _ImportID ImportID;

#define PHOTO_FILE_SNIFFER_TYPE_OPTIONS (photo_file_sniffer_options_get_type ())

#define TYPE_THUMBNAILS (thumbnails_get_type ())
#define THUMBNAILS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THUMBNAILS, Thumbnails))
#define THUMBNAILS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THUMBNAILS, ThumbnailsClass))
#define IS_THUMBNAILS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THUMBNAILS))
#define IS_THUMBNAILS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THUMBNAILS))
#define THUMBNAILS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THUMBNAILS, ThumbnailsClass))

typedef struct _Thumbnails Thumbnails;
typedef struct _ThumbnailsClass ThumbnailsClass;

#define TYPE_PHOTO_ROW (photo_row_get_type ())
#define PHOTO_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_ROW, PhotoRow))
#define PHOTO_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_ROW, PhotoRowClass))
#define IS_PHOTO_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_ROW))
#define IS_PHOTO_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_ROW))
#define PHOTO_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_ROW, PhotoRowClass))

typedef struct _PhotoRow PhotoRow;
typedef struct _PhotoRowClass PhotoRowClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _thumbnails_unref0(var) ((var == NULL) ? NULL : (var = (thumbnails_unref (var), NULL)))
#define _photo_row_unref0(var) ((var == NULL) ? NULL : (var = (photo_row_unref (var), NULL)))
typedef struct _ParamSpecPhotoImportParams ParamSpecPhotoImportParams;

#define TYPE_PHOTO_TRANSFORMATION_STATE (photo_transformation_state_get_type ())
#define PHOTO_TRANSFORMATION_STATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_TRANSFORMATION_STATE, PhotoTransformationState))
#define PHOTO_TRANSFORMATION_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_TRANSFORMATION_STATE, PhotoTransformationStateClass))
#define IS_PHOTO_TRANSFORMATION_STATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_TRANSFORMATION_STATE))
#define IS_PHOTO_TRANSFORMATION_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_TRANSFORMATION_STATE))
#define PHOTO_TRANSFORMATION_STATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_TRANSFORMATION_STATE, PhotoTransformationStateClass))

typedef struct _PhotoTransformationState PhotoTransformationState;
typedef struct _PhotoTransformationStateClass PhotoTransformationStateClass;
typedef struct _PhotoTransformationStatePrivate PhotoTransformationStatePrivate;

#define TYPE_RATING (rating_get_type ())

#define TYPE_DATA_OBJECT (data_object_get_type ())
#define DATA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_OBJECT, DataObject))
#define DATA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_OBJECT, DataObjectClass))
#define IS_DATA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_OBJECT))
#define IS_DATA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_OBJECT))
#define DATA_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_OBJECT, DataObjectClass))

typedef struct _DataObject DataObject;
typedef struct _DataObjectClass DataObjectClass;
typedef struct _DataObjectPrivate DataObjectPrivate;

#define TYPE_ALTERATION (alteration_get_type ())
#define ALTERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ALTERATION, Alteration))
#define ALTERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ALTERATION, AlterationClass))
#define IS_ALTERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ALTERATION))
#define IS_ALTERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ALTERATION))
#define ALTERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ALTERATION, AlterationClass))

typedef struct _Alteration Alteration;
typedef struct _AlterationClass AlterationClass;

#define TYPE_DATA_COLLECTION (data_collection_get_type ())
#define DATA_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_COLLECTION, DataCollection))
#define DATA_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_COLLECTION, DataCollectionClass))
#define IS_DATA_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_COLLECTION))
#define IS_DATA_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_COLLECTION))
#define DATA_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_COLLECTION, DataCollectionClass))

typedef struct _DataCollection DataCollection;
typedef struct _DataCollectionClass DataCollectionClass;

#define TYPE_DATA_SOURCE (data_source_get_type ())
#define DATA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_SOURCE, DataSource))
#define DATA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_SOURCE, DataSourceClass))
#define IS_DATA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_SOURCE))
#define IS_DATA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_SOURCE))
#define DATA_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_SOURCE, DataSourceClass))

typedef struct _DataSource DataSource;
typedef struct _DataSourceClass DataSourceClass;
typedef struct _DataSourcePrivate DataSourcePrivate;

#define TYPE_SOURCE_HOLDING_TANK (source_holding_tank_get_type ())
#define SOURCE_HOLDING_TANK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SOURCE_HOLDING_TANK, SourceHoldingTank))
#define SOURCE_HOLDING_TANK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SOURCE_HOLDING_TANK, SourceHoldingTankClass))
#define IS_SOURCE_HOLDING_TANK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SOURCE_HOLDING_TANK))
#define IS_SOURCE_HOLDING_TANK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SOURCE_HOLDING_TANK))
#define SOURCE_HOLDING_TANK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SOURCE_HOLDING_TANK, SourceHoldingTankClass))

typedef struct _SourceHoldingTank SourceHoldingTank;
typedef struct _SourceHoldingTankClass SourceHoldingTankClass;

#define TYPE_SOURCE_COLLECTION (source_collection_get_type ())
#define SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SOURCE_COLLECTION, SourceCollection))
#define SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SOURCE_COLLECTION, SourceCollectionClass))
#define IS_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SOURCE_COLLECTION))
#define IS_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SOURCE_COLLECTION))
#define SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SOURCE_COLLECTION, SourceCollectionClass))

typedef struct _SourceCollection SourceCollection;
typedef struct _SourceCollectionClass SourceCollectionClass;

#define TYPE_SOURCE_SNAPSHOT (source_snapshot_get_type ())
#define SOURCE_SNAPSHOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SOURCE_SNAPSHOT, SourceSnapshot))
#define SOURCE_SNAPSHOT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SOURCE_SNAPSHOT, SourceSnapshotClass))
#define IS_SOURCE_SNAPSHOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SOURCE_SNAPSHOT))
#define IS_SOURCE_SNAPSHOT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SOURCE_SNAPSHOT))
#define SOURCE_SNAPSHOT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SOURCE_SNAPSHOT, SourceSnapshotClass))

typedef struct _SourceSnapshot SourceSnapshot;
typedef struct _SourceSnapshotClass SourceSnapshotClass;

#define TYPE_THUMBNAIL_SOURCE (thumbnail_source_get_type ())
#define THUMBNAIL_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THUMBNAIL_SOURCE, ThumbnailSource))
#define THUMBNAIL_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THUMBNAIL_SOURCE, ThumbnailSourceClass))
#define IS_THUMBNAIL_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THUMBNAIL_SOURCE))
#define IS_THUMBNAIL_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THUMBNAIL_SOURCE))
#define THUMBNAIL_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THUMBNAIL_SOURCE, ThumbnailSourceClass))

typedef struct _ThumbnailSource ThumbnailSource;
typedef struct _ThumbnailSourceClass ThumbnailSourceClass;
typedef struct _ThumbnailSourcePrivate ThumbnailSourcePrivate;

#define TYPE_PHOTO_FILE_FORMAT (photo_file_format_get_type ())

#define TYPE_INDEXABLE (indexable_get_type ())
#define INDEXABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_INDEXABLE, Indexable))
#define IS_INDEXABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_INDEXABLE))
#define INDEXABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_INDEXABLE, IndexableIface))

typedef struct _Indexable Indexable;
typedef struct _IndexableIface IndexableIface;

#define TYPE_MEDIA_SOURCE (media_source_get_type ())
#define MEDIA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_SOURCE, MediaSource))
#define MEDIA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_SOURCE, MediaSourceClass))
#define IS_MEDIA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_SOURCE))
#define IS_MEDIA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_SOURCE))
#define MEDIA_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_SOURCE, MediaSourceClass))

typedef struct _MediaSource MediaSource;
typedef struct _MediaSourceClass MediaSourceClass;
typedef struct _MediaSourcePrivate MediaSourcePrivate;

#define TYPE_EVENT_ID (event_id_get_type ())
typedef struct _EventID EventID;

#define TYPE_BACKING_FILE_STATE (backing_file_state_get_type ())
#define BACKING_FILE_STATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BACKING_FILE_STATE, BackingFileState))
#define BACKING_FILE_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BACKING_FILE_STATE, BackingFileStateClass))
#define IS_BACKING_FILE_STATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BACKING_FILE_STATE))
#define IS_BACKING_FILE_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BACKING_FILE_STATE))
#define BACKING_FILE_STATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BACKING_FILE_STATE, BackingFileStateClass))

typedef struct _BackingFileState BackingFileState;
typedef struct _BackingFileStateClass BackingFileStateClass;

#define PHOTO_TYPE_EXCEPTION (photo_exception_get_type ())

#define TYPE_DIMENSIONS (dimensions_get_type ())
typedef struct _Dimensions Dimensions;

#define TYPE_SCALING (scaling_get_type ())

#define TYPE_SCALE_CONSTRAINT (scale_constraint_get_type ())
typedef struct _Scaling Scaling;

#define TYPE_PHOTO_SOURCE (photo_source_get_type ())
#define PHOTO_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_SOURCE, PhotoSource))
#define PHOTO_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_SOURCE, PhotoSourceClass))
#define IS_PHOTO_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_SOURCE))
#define IS_PHOTO_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_SOURCE))
#define PHOTO_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_SOURCE, PhotoSourceClass))

typedef struct _PhotoSource PhotoSource;
typedef struct _PhotoSourceClass PhotoSourceClass;
typedef struct _PhotoSourcePrivate PhotoSourcePrivate;

#define TYPE_MEDIA_METADATA (media_metadata_get_type ())
#define MEDIA_METADATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_METADATA, MediaMetadata))
#define MEDIA_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_METADATA, MediaMetadataClass))
#define IS_MEDIA_METADATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_METADATA))
#define IS_MEDIA_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_METADATA))
#define MEDIA_METADATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_METADATA, MediaMetadataClass))

typedef struct _MediaMetadata MediaMetadata;
typedef struct _MediaMetadataClass MediaMetadataClass;

#define TYPE_PHOTO_METADATA (photo_metadata_get_type ())
#define PHOTO_METADATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_METADATA, PhotoMetadata))
#define PHOTO_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_METADATA, PhotoMetadataClass))
#define IS_PHOTO_METADATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_METADATA))
#define IS_PHOTO_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_METADATA))
#define PHOTO_METADATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_METADATA, PhotoMetadataClass))

typedef struct _PhotoMetadata PhotoMetadata;
typedef struct _PhotoMetadataClass PhotoMetadataClass;

#define TYPE_DATEABLE (dateable_get_type ())
#define DATEABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATEABLE, Dateable))
#define IS_DATEABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATEABLE))
#define DATEABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_DATEABLE, DateableIface))

typedef struct _Dateable Dateable;
typedef struct _DateableIface DateableIface;

#define TYPE_PHOTO (photo_get_type ())
#define PHOTO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO, Photo))
#define PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO, PhotoClass))
#define IS_PHOTO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO))
#define IS_PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO))
#define PHOTO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO, PhotoClass))

typedef struct _Photo Photo;
typedef struct _PhotoClass PhotoClass;
typedef struct _PhotoPrivate PhotoPrivate;

#define TYPE_ROTATION (rotation_get_type ())

#define TYPE_BACKING_PHOTO_ROW (backing_photo_row_get_type ())
#define BACKING_PHOTO_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BACKING_PHOTO_ROW, BackingPhotoRow))
#define BACKING_PHOTO_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BACKING_PHOTO_ROW, BackingPhotoRowClass))
#define IS_BACKING_PHOTO_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BACKING_PHOTO_ROW))
#define IS_BACKING_PHOTO_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BACKING_PHOTO_ROW))
#define BACKING_PHOTO_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BACKING_PHOTO_ROW, BackingPhotoRowClass))

typedef struct _BackingPhotoRow BackingPhotoRow;
typedef struct _BackingPhotoRowClass BackingPhotoRowClass;

#define PHOTO_TYPE_BACKING_READERS (photo_backing_readers_get_type ())
#define PHOTO_BACKING_READERS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PHOTO_TYPE_BACKING_READERS, PhotoBackingReaders))
#define PHOTO_BACKING_READERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PHOTO_TYPE_BACKING_READERS, PhotoBackingReadersClass))
#define PHOTO_IS_BACKING_READERS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PHOTO_TYPE_BACKING_READERS))
#define PHOTO_IS_BACKING_READERS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PHOTO_TYPE_BACKING_READERS))
#define PHOTO_BACKING_READERS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PHOTO_TYPE_BACKING_READERS, PhotoBackingReadersClass))

typedef struct _PhotoBackingReaders PhotoBackingReaders;
typedef struct _PhotoBackingReadersClass PhotoBackingReadersClass;

#define TYPE_ONE_SHOT_SCHEDULER (one_shot_scheduler_get_type ())
#define ONE_SHOT_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ONE_SHOT_SCHEDULER, OneShotScheduler))
#define ONE_SHOT_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ONE_SHOT_SCHEDULER, OneShotSchedulerClass))
#define IS_ONE_SHOT_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ONE_SHOT_SCHEDULER))
#define IS_ONE_SHOT_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ONE_SHOT_SCHEDULER))
#define ONE_SHOT_SCHEDULER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ONE_SHOT_SCHEDULER, OneShotSchedulerClass))

typedef struct _OneShotScheduler OneShotScheduler;
typedef struct _OneShotSchedulerClass OneShotSchedulerClass;

#define TYPE_RAW_DEVELOPER (raw_developer_get_type ())

#define PHOTO_TYPE_CACHED_PIXBUF (photo_cached_pixbuf_get_type ())
#define PHOTO_CACHED_PIXBUF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PHOTO_TYPE_CACHED_PIXBUF, PhotoCachedPixbuf))
#define PHOTO_CACHED_PIXBUF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PHOTO_TYPE_CACHED_PIXBUF, PhotoCachedPixbufClass))
#define PHOTO_IS_CACHED_PIXBUF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PHOTO_TYPE_CACHED_PIXBUF))
#define PHOTO_IS_CACHED_PIXBUF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PHOTO_TYPE_CACHED_PIXBUF))
#define PHOTO_CACHED_PIXBUF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PHOTO_TYPE_CACHED_PIXBUF, PhotoCachedPixbufClass))

typedef struct _PhotoCachedPixbuf PhotoCachedPixbuf;
typedef struct _PhotoCachedPixbufClass PhotoCachedPixbufClass;
#define _backing_photo_row_unref0(var) ((var == NULL) ? NULL : (var = (backing_photo_row_unref (var), NULL)))
#define _photo_backing_readers_unref0(var) ((var == NULL) ? NULL : (var = (photo_backing_readers_unref (var), NULL)))
#define _pixel_transformer_unref0(var) ((var == NULL) ? NULL : (var = (pixel_transformer_unref (var), NULL)))
#define _pixel_transformation_bundle_unref0(var) ((var == NULL) ? NULL : (var = (pixel_transformation_bundle_unref (var), NULL)))
#define _one_shot_scheduler_unref0(var) ((var == NULL) ? NULL : (var = (one_shot_scheduler_unref (var), NULL)))
typedef struct _PhotoRowPrivate PhotoRowPrivate;

#define TYPE_PHOTO_ID (photo_id_get_type ())
typedef struct _PhotoID PhotoID;

#define TYPE_ORIENTATION (orientation_get_type ())

#define TYPE_BACKING_PHOTO_ID (backing_photo_id_get_type ())
typedef struct _BackingPhotoID BackingPhotoID;
typedef struct _BackingPhotoRowPrivate BackingPhotoRowPrivate;

#define TYPE_PHOTO_FILE_ADAPTER (photo_file_adapter_get_type ())
#define PHOTO_FILE_ADAPTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter))
#define PHOTO_FILE_ADAPTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapterClass))
#define IS_PHOTO_FILE_ADAPTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_FILE_ADAPTER))
#define IS_PHOTO_FILE_ADAPTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_FILE_ADAPTER))
#define PHOTO_FILE_ADAPTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapterClass))

typedef struct _PhotoFileAdapter PhotoFileAdapter;
typedef struct _PhotoFileAdapterClass PhotoFileAdapterClass;

#define TYPE_PHOTO_FILE_READER (photo_file_reader_get_type ())
#define PHOTO_FILE_READER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_FILE_READER, PhotoFileReader))
#define PHOTO_FILE_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_FILE_READER, PhotoFileReaderClass))
#define IS_PHOTO_FILE_READER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_FILE_READER))
#define IS_PHOTO_FILE_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_FILE_READER))
#define PHOTO_FILE_READER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_FILE_READER, PhotoFileReaderClass))

typedef struct _PhotoFileReader PhotoFileReader;
typedef struct _PhotoFileReaderClass PhotoFileReaderClass;
typedef struct _PhotoBackingReadersPrivate PhotoBackingReadersPrivate;
#define _photo_file_adapter_unref0(var) ((var == NULL) ? NULL : (var = (photo_file_adapter_unref (var), NULL)))

#define TYPE_DATABASE_TABLE (database_table_get_type ())
#define DATABASE_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATABASE_TABLE, DatabaseTable))
#define DATABASE_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATABASE_TABLE, DatabaseTableClass))
#define IS_DATABASE_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATABASE_TABLE))
#define IS_DATABASE_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATABASE_TABLE))
#define DATABASE_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATABASE_TABLE, DatabaseTableClass))

typedef struct _DatabaseTable DatabaseTable;
typedef struct _DatabaseTableClass DatabaseTableClass;

#define TYPE_PHOTO_TABLE (photo_table_get_type ())
#define PHOTO_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_TABLE, PhotoTable))
#define PHOTO_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_TABLE, PhotoTableClass))
#define IS_PHOTO_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_TABLE))
#define IS_PHOTO_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_TABLE))
#define PHOTO_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_TABLE, PhotoTableClass))

typedef struct _PhotoTable PhotoTable;
typedef struct _PhotoTableClass PhotoTableClass;
#define _database_table_unref0(var) ((var == NULL) ? NULL : (var = (database_table_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define TYPE_BACKING_PHOTO_TABLE (backing_photo_table_get_type ())
#define BACKING_PHOTO_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BACKING_PHOTO_TABLE, BackingPhotoTable))
#define BACKING_PHOTO_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BACKING_PHOTO_TABLE, BackingPhotoTableClass))
#define IS_BACKING_PHOTO_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BACKING_PHOTO_TABLE))
#define IS_BACKING_PHOTO_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BACKING_PHOTO_TABLE))
#define BACKING_PHOTO_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BACKING_PHOTO_TABLE, BackingPhotoTableClass))

typedef struct _BackingPhotoTable BackingPhotoTable;
typedef struct _BackingPhotoTableClass BackingPhotoTableClass;

#define TYPE_PHOTO_PREVIEW (photo_preview_get_type ())
#define PHOTO_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_PREVIEW, PhotoPreview))
#define PHOTO_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_PREVIEW, PhotoPreviewClass))
#define IS_PHOTO_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_PREVIEW))
#define IS_PHOTO_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_PREVIEW))
#define PHOTO_PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_PREVIEW, PhotoPreviewClass))

typedef struct _PhotoPreview PhotoPreview;
typedef struct _PhotoPreviewClass PhotoPreviewClass;
#define _photo_preview_unref0(var) ((var == NULL) ? NULL : (var = (photo_preview_unref (var), NULL)))
#define _media_metadata_unref0(var) ((var == NULL) ? NULL : (var = (media_metadata_unref (var), NULL)))
#define _alteration_unref0(var) ((var == NULL) ? NULL : (var = (alteration_unref (var), NULL)))

#define TYPE_PHOTO_FILE_INTERROGATOR (photo_file_interrogator_get_type ())
#define PHOTO_FILE_INTERROGATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_FILE_INTERROGATOR, PhotoFileInterrogator))
#define PHOTO_FILE_INTERROGATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_FILE_INTERROGATOR, PhotoFileInterrogatorClass))
#define IS_PHOTO_FILE_INTERROGATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_FILE_INTERROGATOR))
#define IS_PHOTO_FILE_INTERROGATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_FILE_INTERROGATOR))
#define PHOTO_FILE_INTERROGATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_FILE_INTERROGATOR, PhotoFileInterrogatorClass))

typedef struct _PhotoFileInterrogator PhotoFileInterrogator;
typedef struct _PhotoFileInterrogatorClass PhotoFileInterrogatorClass;
#define _photo_file_interrogator_unref0(var) ((var == NULL) ? NULL : (var = (photo_file_interrogator_unref (var), NULL)))

#define TYPE_DETECTED_PHOTO_INFORMATION (detected_photo_information_get_type ())
#define DETECTED_PHOTO_INFORMATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DETECTED_PHOTO_INFORMATION, DetectedPhotoInformation))
#define DETECTED_PHOTO_INFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DETECTED_PHOTO_INFORMATION, DetectedPhotoInformationClass))
#define IS_DETECTED_PHOTO_INFORMATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DETECTED_PHOTO_INFORMATION))
#define IS_DETECTED_PHOTO_INFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DETECTED_PHOTO_INFORMATION))
#define DETECTED_PHOTO_INFORMATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DETECTED_PHOTO_INFORMATION, DetectedPhotoInformationClass))

typedef struct _DetectedPhotoInformation DetectedPhotoInformation;
typedef struct _DetectedPhotoInformationClass DetectedPhotoInformationClass;
#define _detected_photo_information_unref0(var) ((var == NULL) ? NULL : (var = (detected_photo_information_unref (var), NULL)))
typedef struct _DetectedPhotoInformationPrivate DetectedPhotoInformationPrivate;

#define TYPE_PHOTO_FILE_WRITER (photo_file_writer_get_type ())
#define PHOTO_FILE_WRITER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_FILE_WRITER, PhotoFileWriter))
#define PHOTO_FILE_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_FILE_WRITER, PhotoFileWriterClass))
#define IS_PHOTO_FILE_WRITER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_FILE_WRITER))
#define IS_PHOTO_FILE_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_FILE_WRITER))
#define PHOTO_FILE_WRITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_FILE_WRITER, PhotoFileWriterClass))

typedef struct _PhotoFileWriter PhotoFileWriter;
typedef struct _PhotoFileWriterClass PhotoFileWriterClass;

#define JPEG_TYPE_QUALITY (jpeg_quality_get_type ())

#define TYPE_PHOTO_FILE_METADATA_WRITER (photo_file_metadata_writer_get_type ())
#define PHOTO_FILE_METADATA_WRITER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_FILE_METADATA_WRITER, PhotoFileMetadataWriter))
#define PHOTO_FILE_METADATA_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_FILE_METADATA_WRITER, PhotoFileMetadataWriterClass))
#define IS_PHOTO_FILE_METADATA_WRITER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_FILE_METADATA_WRITER))
#define IS_PHOTO_FILE_METADATA_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_FILE_METADATA_WRITER))
#define PHOTO_FILE_METADATA_WRITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_FILE_METADATA_WRITER, PhotoFileMetadataWriterClass))

typedef struct _PhotoFileMetadataWriter PhotoFileMetadataWriter;
typedef struct _PhotoFileMetadataWriterClass PhotoFileMetadataWriterClass;

#define TYPE_EXPORT_FORMAT_PARAMETERS (export_format_parameters_get_type ())

#define TYPE_EXPORT_FORMAT_MODE (export_format_mode_get_type ())
typedef struct _ExportFormatParameters ExportFormatParameters;

#define TYPE_IMPORT_RESULT (import_result_get_type ())

#define TYPE_METADATA_DATE_TIME (metadata_date_time_get_type ())
#define METADATA_DATE_TIME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_METADATA_DATE_TIME, MetadataDateTime))
#define METADATA_DATE_TIME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_METADATA_DATE_TIME, MetadataDateTimeClass))
#define IS_METADATA_DATE_TIME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_METADATA_DATE_TIME))
#define IS_METADATA_DATE_TIME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_METADATA_DATE_TIME))
#define METADATA_DATE_TIME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_METADATA_DATE_TIME, MetadataDateTimeClass))

typedef struct _MetadataDateTime MetadataDateTime;
typedef struct _MetadataDateTimeClass MetadataDateTimeClass;
#define _metadata_date_time_unref0(var) ((var == NULL) ? NULL : (var = (metadata_date_time_unref (var), NULL)))

#define PHOTO_FILE_READER_TYPE_ROLE (photo_file_reader_role_get_type ())

#define PHOTO_TYPE_REIMPORT_MASTER_STATE (photo_reimport_master_state_get_type ())
#define PHOTO_REIMPORT_MASTER_STATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PHOTO_TYPE_REIMPORT_MASTER_STATE, PhotoReimportMasterState))
#define PHOTO_REIMPORT_MASTER_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PHOTO_TYPE_REIMPORT_MASTER_STATE, PhotoReimportMasterStateClass))
#define PHOTO_IS_REIMPORT_MASTER_STATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PHOTO_TYPE_REIMPORT_MASTER_STATE))
#define PHOTO_IS_REIMPORT_MASTER_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PHOTO_TYPE_REIMPORT_MASTER_STATE))
#define PHOTO_REIMPORT_MASTER_STATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PHOTO_TYPE_REIMPORT_MASTER_STATE, PhotoReimportMasterStateClass))

typedef struct _PhotoReimportMasterState PhotoReimportMasterState;
typedef struct _PhotoReimportMasterStateClass PhotoReimportMasterStateClass;
#define _photo_reimport_master_state_unref0(var) ((var == NULL) ? NULL : (var = (photo_reimport_master_state_unref (var), NULL)))

#define PHOTO_TYPE_REIMPORT_MASTER_STATE_IMPL (photo_reimport_master_state_impl_get_type ())
#define PHOTO_REIMPORT_MASTER_STATE_IMPL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PHOTO_TYPE_REIMPORT_MASTER_STATE_IMPL, PhotoReimportMasterStateImpl))
#define PHOTO_REIMPORT_MASTER_STATE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PHOTO_TYPE_REIMPORT_MASTER_STATE_IMPL, PhotoReimportMasterStateImplClass))
#define PHOTO_IS_REIMPORT_MASTER_STATE_IMPL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PHOTO_TYPE_REIMPORT_MASTER_STATE_IMPL))
#define PHOTO_IS_REIMPORT_MASTER_STATE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PHOTO_TYPE_REIMPORT_MASTER_STATE_IMPL))
#define PHOTO_REIMPORT_MASTER_STATE_IMPL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PHOTO_TYPE_REIMPORT_MASTER_STATE_IMPL, PhotoReimportMasterStateImplClass))

typedef struct _PhotoReimportMasterStateImpl PhotoReimportMasterStateImpl;
typedef struct _PhotoReimportMasterStateImplClass PhotoReimportMasterStateImplClass;
typedef struct _PhotoReimportMasterStatePrivate PhotoReimportMasterStatePrivate;
typedef struct _PhotoReimportMasterStateImplPrivate PhotoReimportMasterStateImplPrivate;

#define PHOTO_TYPE_REIMPORT_EDITABLE_STATE (photo_reimport_editable_state_get_type ())
#define PHOTO_REIMPORT_EDITABLE_STATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PHOTO_TYPE_REIMPORT_EDITABLE_STATE, PhotoReimportEditableState))
#define PHOTO_REIMPORT_EDITABLE_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PHOTO_TYPE_REIMPORT_EDITABLE_STATE, PhotoReimportEditableStateClass))
#define PHOTO_IS_REIMPORT_EDITABLE_STATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PHOTO_TYPE_REIMPORT_EDITABLE_STATE))
#define PHOTO_IS_REIMPORT_EDITABLE_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PHOTO_TYPE_REIMPORT_EDITABLE_STATE))
#define PHOTO_REIMPORT_EDITABLE_STATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PHOTO_TYPE_REIMPORT_EDITABLE_STATE, PhotoReimportEditableStateClass))

typedef struct _PhotoReimportEditableState PhotoReimportEditableState;
typedef struct _PhotoReimportEditableStateClass PhotoReimportEditableStateClass;
#define _photo_reimport_editable_state_unref0(var) ((var == NULL) ? NULL : (var = (photo_reimport_editable_state_unref (var), NULL)))

#define PHOTO_TYPE_REIMPORT_EDITABLE_STATE_IMPL (photo_reimport_editable_state_impl_get_type ())
#define PHOTO_REIMPORT_EDITABLE_STATE_IMPL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PHOTO_TYPE_REIMPORT_EDITABLE_STATE_IMPL, PhotoReimportEditableStateImpl))
#define PHOTO_REIMPORT_EDITABLE_STATE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PHOTO_TYPE_REIMPORT_EDITABLE_STATE_IMPL, PhotoReimportEditableStateImplClass))
#define PHOTO_IS_REIMPORT_EDITABLE_STATE_IMPL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PHOTO_TYPE_REIMPORT_EDITABLE_STATE_IMPL))
#define PHOTO_IS_REIMPORT_EDITABLE_STATE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PHOTO_TYPE_REIMPORT_EDITABLE_STATE_IMPL))
#define PHOTO_REIMPORT_EDITABLE_STATE_IMPL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PHOTO_TYPE_REIMPORT_EDITABLE_STATE_IMPL, PhotoReimportEditableStateImplClass))

typedef struct _PhotoReimportEditableStateImpl PhotoReimportEditableStateImpl;
typedef struct _PhotoReimportEditableStateImplClass PhotoReimportEditableStateImplClass;
typedef struct _PhotoReimportEditableStatePrivate PhotoReimportEditableStatePrivate;
typedef struct _PhotoReimportEditableStateImplPrivate PhotoReimportEditableStateImplPrivate;

#define PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE (photo_reimport_raw_development_state_get_type ())
#define PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE, PhotoReimportRawDevelopmentState))
#define PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE, PhotoReimportRawDevelopmentStateClass))
#define PHOTO_IS_REIMPORT_RAW_DEVELOPMENT_STATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE))
#define PHOTO_IS_REIMPORT_RAW_DEVELOPMENT_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE))
#define PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE, PhotoReimportRawDevelopmentStateClass))

typedef struct _PhotoReimportRawDevelopmentState PhotoReimportRawDevelopmentState;
typedef struct _PhotoReimportRawDevelopmentStateClass PhotoReimportRawDevelopmentStateClass;
#define _photo_reimport_raw_development_state_unref0(var) ((var == NULL) ? NULL : (var = (photo_reimport_raw_development_state_unref (var), NULL)))

#define PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL (photo_reimport_raw_development_state_impl_get_type ())
#define PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL, PhotoReimportRawDevelopmentStateImpl))
#define PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL, PhotoReimportRawDevelopmentStateImplClass))
#define PHOTO_IS_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL))
#define PHOTO_IS_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL))
#define PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL, PhotoReimportRawDevelopmentStateImplClass))

typedef struct _PhotoReimportRawDevelopmentStateImpl PhotoReimportRawDevelopmentStateImpl;
typedef struct _PhotoReimportRawDevelopmentStateImplClass PhotoReimportRawDevelopmentStateImplClass;

#define PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_TYPE_DEV_TO_REIMPORT (photo_reimport_raw_development_state_impl_dev_to_reimport_get_type ())
#define PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_DEV_TO_REIMPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_TYPE_DEV_TO_REIMPORT, PhotoReimportRawDevelopmentStateImplDevToReimport))
#define PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_DEV_TO_REIMPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_TYPE_DEV_TO_REIMPORT, PhotoReimportRawDevelopmentStateImplDevToReimportClass))
#define PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_IS_DEV_TO_REIMPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_TYPE_DEV_TO_REIMPORT))
#define PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_IS_DEV_TO_REIMPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_TYPE_DEV_TO_REIMPORT))
#define PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_DEV_TO_REIMPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_TYPE_DEV_TO_REIMPORT, PhotoReimportRawDevelopmentStateImplDevToReimportClass))

typedef struct _PhotoReimportRawDevelopmentStateImplDevToReimport PhotoReimportRawDevelopmentStateImplDevToReimport;
typedef struct _PhotoReimportRawDevelopmentStateImplDevToReimportClass PhotoReimportRawDevelopmentStateImplDevToReimportClass;
typedef struct _PhotoReimportRawDevelopmentStatePrivate PhotoReimportRawDevelopmentStatePrivate;
typedef struct _PhotoReimportRawDevelopmentStateImplPrivate PhotoReimportRawDevelopmentStateImplPrivate;
typedef struct _PhotoReimportRawDevelopmentStateImplDevToReimportPrivate PhotoReimportRawDevelopmentStateImplDevToReimportPrivate;
#define _photo_reimport_raw_development_state_impl_dev_to_reimport_unref0(var) ((var == NULL) ? NULL : (var = (photo_reimport_raw_development_state_impl_dev_to_reimport_unref (var), NULL)))

#define TYPE_LIBRARY_PHOTO (library_photo_get_type ())
#define LIBRARY_PHOTO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIBRARY_PHOTO, LibraryPhoto))
#define LIBRARY_PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIBRARY_PHOTO, LibraryPhotoClass))
#define IS_LIBRARY_PHOTO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIBRARY_PHOTO))
#define IS_LIBRARY_PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIBRARY_PHOTO))
#define LIBRARY_PHOTO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIBRARY_PHOTO, LibraryPhotoClass))

typedef struct _LibraryPhoto LibraryPhoto;
typedef struct _LibraryPhotoClass LibraryPhotoClass;

#define PHOTO_METADATA_TYPE_SET_OPTION (photo_metadata_set_option_get_type ())

#define TYPE_BOX (box_get_type ())
typedef struct _Box Box;
#define _key_value_map_unref0(var) ((var == NULL) ? NULL : (var = (key_value_map_unref (var), NULL)))
#define _pixel_transformation_unref0(var) ((var == NULL) ? NULL : (var = (pixel_transformation_unref (var), NULL)))

#define PHOTO_TYPE_PHOTO_TRANSFORMATION_STATE_IMPL (photo_photo_transformation_state_impl_get_type ())
#define PHOTO_PHOTO_TRANSFORMATION_STATE_IMPL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PHOTO_TYPE_PHOTO_TRANSFORMATION_STATE_IMPL, PhotoPhotoTransformationStateImpl))
#define PHOTO_PHOTO_TRANSFORMATION_STATE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PHOTO_TYPE_PHOTO_TRANSFORMATION_STATE_IMPL, PhotoPhotoTransformationStateImplClass))
#define PHOTO_IS_PHOTO_TRANSFORMATION_STATE_IMPL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PHOTO_TYPE_PHOTO_TRANSFORMATION_STATE_IMPL))
#define PHOTO_IS_PHOTO_TRANSFORMATION_STATE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PHOTO_TYPE_PHOTO_TRANSFORMATION_STATE_IMPL))
#define PHOTO_PHOTO_TRANSFORMATION_STATE_IMPL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PHOTO_TYPE_PHOTO_TRANSFORMATION_STATE_IMPL, PhotoPhotoTransformationStateImplClass))

typedef struct _PhotoPhotoTransformationStateImpl PhotoPhotoTransformationStateImpl;
typedef struct _PhotoPhotoTransformationStateImplClass PhotoPhotoTransformationStateImplClass;

#define EDITING_TOOLS_TYPE_REDEYE_INSTANCE (editing_tools_redeye_instance_get_type ())
typedef struct _EditingToolsRedeyeInstance EditingToolsRedeyeInstance;
typedef struct _PhotoCachedPixbufPrivate PhotoCachedPixbufPrivate;
#define _photo_cached_pixbuf_unref0(var) ((var == NULL) ? NULL : (var = (photo_cached_pixbuf_unref (var), NULL)))

#define TYPE_PHOTO_FILE_FORMAT_PROPERTIES (photo_file_format_properties_get_type ())
#define PHOTO_FILE_FORMAT_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_FILE_FORMAT_PROPERTIES, PhotoFileFormatProperties))
#define PHOTO_FILE_FORMAT_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_FILE_FORMAT_PROPERTIES, PhotoFileFormatPropertiesClass))
#define IS_PHOTO_FILE_FORMAT_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_FILE_FORMAT_PROPERTIES))
#define IS_PHOTO_FILE_FORMAT_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_FILE_FORMAT_PROPERTIES))
#define PHOTO_FILE_FORMAT_PROPERTIES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_FILE_FORMAT_PROPERTIES, PhotoFileFormatPropertiesClass))

typedef struct _PhotoFileFormatProperties PhotoFileFormatProperties;
typedef struct _PhotoFileFormatPropertiesClass PhotoFileFormatPropertiesClass;
#define _photo_file_format_properties_unref0(var) ((var == NULL) ? NULL : (var = (photo_file_format_properties_unref (var), NULL)))

#define TYPE_CONFIGURATION_FACADE (configuration_facade_get_type ())
#define CONFIGURATION_FACADE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONFIGURATION_FACADE, ConfigurationFacade))
#define CONFIGURATION_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONFIGURATION_FACADE, ConfigurationFacadeClass))
#define IS_CONFIGURATION_FACADE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONFIGURATION_FACADE))
#define IS_CONFIGURATION_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONFIGURATION_FACADE))
#define CONFIGURATION_FACADE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONFIGURATION_FACADE, ConfigurationFacadeClass))

typedef struct _ConfigurationFacade ConfigurationFacade;
typedef struct _ConfigurationFacadeClass ConfigurationFacadeClass;

#define CONFIG_TYPE_FACADE (config_facade_get_type ())
#define CONFIG_FACADE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONFIG_TYPE_FACADE, ConfigFacade))
#define CONFIG_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONFIG_TYPE_FACADE, ConfigFacadeClass))
#define CONFIG_IS_FACADE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONFIG_TYPE_FACADE))
#define CONFIG_IS_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONFIG_TYPE_FACADE))
#define CONFIG_FACADE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONFIG_TYPE_FACADE, ConfigFacadeClass))

typedef struct _ConfigFacade ConfigFacade;
typedef struct _ConfigFacadeClass ConfigFacadeClass;
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
typedef struct _PhotoPhotoTransformationStateImplPrivate PhotoPhotoTransformationStateImplPrivate;
typedef struct _PhotoParamSpecBackingReaders PhotoParamSpecBackingReaders;
#define _g_timer_destroy0(var) ((var == NULL) ? NULL : (var = (g_timer_destroy (var), NULL)))
typedef struct _PhotoParamSpecCachedPixbuf PhotoParamSpecCachedPixbuf;
typedef struct _PhotoParamSpecReimportMasterState PhotoParamSpecReimportMasterState;
typedef struct _PhotoParamSpecReimportEditableState PhotoParamSpecReimportEditableState;
typedef struct _PhotoParamSpecReimportRawDevelopmentState PhotoParamSpecReimportRawDevelopmentState;
typedef struct _PhotoReimportRawDevelopmentStateImplParamSpecDevToReimport PhotoReimportRawDevelopmentStateImplParamSpecDevToReimport;
typedef struct _DataCollectionPrivate DataCollectionPrivate;

#define TYPE_MARKER (marker_get_type ())
#define MARKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MARKER, Marker))
#define IS_MARKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MARKER))
#define MARKER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_MARKER, MarkerIface))

typedef struct _Marker Marker;
typedef struct _MarkerIface MarkerIface;
typedef struct _SourceCollectionPrivate SourceCollectionPrivate;

#define TYPE_SOURCE_BACKLINK (source_backlink_get_type ())
#define SOURCE_BACKLINK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SOURCE_BACKLINK, SourceBacklink))
#define SOURCE_BACKLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SOURCE_BACKLINK, SourceBacklinkClass))
#define IS_SOURCE_BACKLINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SOURCE_BACKLINK))
#define IS_SOURCE_BACKLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SOURCE_BACKLINK))
#define SOURCE_BACKLINK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SOURCE_BACKLINK, SourceBacklinkClass))

typedef struct _SourceBacklink SourceBacklink;
typedef struct _SourceBacklinkClass SourceBacklinkClass;

#define TYPE_DATABASE_SOURCE_COLLECTION (database_source_collection_get_type ())
#define DATABASE_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATABASE_SOURCE_COLLECTION, DatabaseSourceCollection))
#define DATABASE_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATABASE_SOURCE_COLLECTION, DatabaseSourceCollectionClass))
#define IS_DATABASE_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATABASE_SOURCE_COLLECTION))
#define IS_DATABASE_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATABASE_SOURCE_COLLECTION))
#define DATABASE_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATABASE_SOURCE_COLLECTION, DatabaseSourceCollectionClass))

typedef struct _DatabaseSourceCollection DatabaseSourceCollection;
typedef struct _DatabaseSourceCollectionClass DatabaseSourceCollectionClass;
typedef struct _DatabaseSourceCollectionPrivate DatabaseSourceCollectionPrivate;

#define TYPE_MEDIA_SOURCE_COLLECTION (media_source_collection_get_type ())
#define MEDIA_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection))
#define MEDIA_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollectionClass))
#define IS_MEDIA_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_SOURCE_COLLECTION))
#define IS_MEDIA_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_SOURCE_COLLECTION))
#define MEDIA_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollectionClass))

typedef struct _MediaSourceCollection MediaSourceCollection;
typedef struct _MediaSourceCollectionClass MediaSourceCollectionClass;
typedef struct _MediaSourceCollectionPrivate MediaSourceCollectionPrivate;

#define TYPE_DATABASE_SOURCE_HOLDING_TANK (database_source_holding_tank_get_type ())
#define DATABASE_SOURCE_HOLDING_TANK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATABASE_SOURCE_HOLDING_TANK, DatabaseSourceHoldingTank))
#define DATABASE_SOURCE_HOLDING_TANK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATABASE_SOURCE_HOLDING_TANK, DatabaseSourceHoldingTankClass))
#define IS_DATABASE_SOURCE_HOLDING_TANK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATABASE_SOURCE_HOLDING_TANK))
#define IS_DATABASE_SOURCE_HOLDING_TANK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATABASE_SOURCE_HOLDING_TANK))
#define DATABASE_SOURCE_HOLDING_TANK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATABASE_SOURCE_HOLDING_TANK, DatabaseSourceHoldingTankClass))

typedef struct _DatabaseSourceHoldingTank DatabaseSourceHoldingTank;
typedef struct _DatabaseSourceHoldingTankClass DatabaseSourceHoldingTankClass;

#define TYPE_MEDIA_SOURCE_HOLDING_TANK (media_source_holding_tank_get_type ())
#define MEDIA_SOURCE_HOLDING_TANK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_SOURCE_HOLDING_TANK, MediaSourceHoldingTank))
#define MEDIA_SOURCE_HOLDING_TANK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_SOURCE_HOLDING_TANK, MediaSourceHoldingTankClass))
#define IS_MEDIA_SOURCE_HOLDING_TANK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_SOURCE_HOLDING_TANK))
#define IS_MEDIA_SOURCE_HOLDING_TANK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_SOURCE_HOLDING_TANK))
#define MEDIA_SOURCE_HOLDING_TANK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_SOURCE_HOLDING_TANK, MediaSourceHoldingTankClass))

typedef struct _MediaSourceHoldingTank MediaSourceHoldingTank;
typedef struct _MediaSourceHoldingTankClass MediaSourceHoldingTankClass;

#define TYPE_WORKERS (workers_get_type ())
#define WORKERS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_WORKERS, Workers))
#define WORKERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_WORKERS, WorkersClass))
#define IS_WORKERS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_WORKERS))
#define IS_WORKERS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_WORKERS))
#define WORKERS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_WORKERS, WorkersClass))

typedef struct _Workers Workers;
typedef struct _WorkersClass WorkersClass;

#define TYPE_MEDIA_MONITOR (media_monitor_get_type ())
#define MEDIA_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_MONITOR, MediaMonitor))
#define MEDIA_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_MONITOR, MediaMonitorClass))
#define IS_MEDIA_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_MONITOR))
#define IS_MEDIA_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_MONITOR))
#define MEDIA_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_MONITOR, MediaMonitorClass))

typedef struct _MediaMonitor MediaMonitor;
typedef struct _MediaMonitorClass MediaMonitorClass;

#define TYPE_TRANSACTION_CONTROLLER (transaction_controller_get_type ())
#define TRANSACTION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TRANSACTION_CONTROLLER, TransactionController))
#define TRANSACTION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TRANSACTION_CONTROLLER, TransactionControllerClass))
#define IS_TRANSACTION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TRANSACTION_CONTROLLER))
#define IS_TRANSACTION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TRANSACTION_CONTROLLER))
#define TRANSACTION_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TRANSACTION_CONTROLLER, TransactionControllerClass))

typedef struct _TransactionController TransactionController;
typedef struct _TransactionControllerClass TransactionControllerClass;

#define TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION (library_photo_source_collection_get_type ())
#define LIBRARY_PHOTO_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollection))
#define LIBRARY_PHOTO_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollectionClass))
#define IS_LIBRARY_PHOTO_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION))
#define IS_LIBRARY_PHOTO_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION))
#define LIBRARY_PHOTO_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollectionClass))

typedef struct _LibraryPhotoSourceCollection LibraryPhotoSourceCollection;
typedef struct _LibraryPhotoSourceCollectionClass LibraryPhotoSourceCollectionClass;
typedef struct _LibraryPhotoSourceCollectionPrivate LibraryPhotoSourceCollectionPrivate;

#define LIBRARY_PHOTO_SOURCE_COLLECTION_TYPE_STATE (library_photo_source_collection_state_get_type ())
#define _transaction_controller_unref0(var) ((var == NULL) ? NULL : (var = (transaction_controller_unref (var), NULL)))
#define _source_holding_tank_unref0(var) ((var == NULL) ? NULL : (var = (source_holding_tank_unref (var), NULL)))

#define TYPE_LIBRARY_PHOTO_SOURCE_HOLDING_TANK (library_photo_source_holding_tank_get_type ())
#define LIBRARY_PHOTO_SOURCE_HOLDING_TANK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIBRARY_PHOTO_SOURCE_HOLDING_TANK, LibraryPhotoSourceHoldingTank))
#define LIBRARY_PHOTO_SOURCE_HOLDING_TANK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIBRARY_PHOTO_SOURCE_HOLDING_TANK, LibraryPhotoSourceHoldingTankClass))
#define IS_LIBRARY_PHOTO_SOURCE_HOLDING_TANK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIBRARY_PHOTO_SOURCE_HOLDING_TANK))
#define IS_LIBRARY_PHOTO_SOURCE_HOLDING_TANK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIBRARY_PHOTO_SOURCE_HOLDING_TANK))
#define LIBRARY_PHOTO_SOURCE_HOLDING_TANK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIBRARY_PHOTO_SOURCE_HOLDING_TANK, LibraryPhotoSourceHoldingTankClass))

typedef struct _LibraryPhotoSourceHoldingTank LibraryPhotoSourceHoldingTank;
typedef struct _LibraryPhotoSourceHoldingTankClass LibraryPhotoSourceHoldingTankClass;

#define TYPE_PHOTO_MONITOR (photo_monitor_get_type ())
#define PHOTO_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_MONITOR, PhotoMonitor))
#define PHOTO_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_MONITOR, PhotoMonitorClass))
#define IS_PHOTO_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_MONITOR))
#define IS_PHOTO_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_MONITOR))
#define PHOTO_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_MONITOR, PhotoMonitorClass))

typedef struct _PhotoMonitor PhotoMonitor;
typedef struct _PhotoMonitorClass PhotoMonitorClass;

#define TYPE_TAG (tag_get_type ())
#define TAG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG, Tag))
#define TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG, TagClass))
#define IS_TAG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG))
#define IS_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG))
#define TAG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG, TagClass))

typedef struct _Tag Tag;
typedef struct _TagClass TagClass;

#define TYPE_HIERARCHICAL_TAG_INDEX (hierarchical_tag_index_get_type ())
#define HIERARCHICAL_TAG_INDEX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_HIERARCHICAL_TAG_INDEX, HierarchicalTagIndex))
#define HIERARCHICAL_TAG_INDEX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_HIERARCHICAL_TAG_INDEX, HierarchicalTagIndexClass))
#define IS_HIERARCHICAL_TAG_INDEX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_HIERARCHICAL_TAG_INDEX))
#define IS_HIERARCHICAL_TAG_INDEX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_HIERARCHICAL_TAG_INDEX))
#define HIERARCHICAL_TAG_INDEX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_HIERARCHICAL_TAG_INDEX, HierarchicalTagIndexClass))

typedef struct _HierarchicalTagIndex HierarchicalTagIndex;
typedef struct _HierarchicalTagIndexClass HierarchicalTagIndexClass;
#define _hierarchical_tag_index_unref0(var) ((var == NULL) ? NULL : (var = (hierarchical_tag_index_unref (var), NULL)))

#define TYPE_MEDIA_SOURCE_TRANSACTION_CONTROLLER (media_source_transaction_controller_get_type ())
#define MEDIA_SOURCE_TRANSACTION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_SOURCE_TRANSACTION_CONTROLLER, MediaSourceTransactionController))
#define MEDIA_SOURCE_TRANSACTION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_SOURCE_TRANSACTION_CONTROLLER, MediaSourceTransactionControllerClass))
#define IS_MEDIA_SOURCE_TRANSACTION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_SOURCE_TRANSACTION_CONTROLLER))
#define IS_MEDIA_SOURCE_TRANSACTION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_SOURCE_TRANSACTION_CONTROLLER))
#define MEDIA_SOURCE_TRANSACTION_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_SOURCE_TRANSACTION_CONTROLLER, MediaSourceTransactionControllerClass))

typedef struct _MediaSourceTransactionController MediaSourceTransactionController;
typedef struct _MediaSourceTransactionControllerClass MediaSourceTransactionControllerClass;

#define TYPE_FLAGGABLE (flaggable_get_type ())
#define FLAGGABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FLAGGABLE, Flaggable))
#define IS_FLAGGABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FLAGGABLE))
#define FLAGGABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_FLAGGABLE, FlaggableIface))

typedef struct _Flaggable Flaggable;
typedef struct _FlaggableIface FlaggableIface;

#define TYPE_MONITORABLE (monitorable_get_type ())
#define MONITORABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MONITORABLE, Monitorable))
#define IS_MONITORABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MONITORABLE))
#define MONITORABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_MONITORABLE, MonitorableIface))

typedef struct _Monitorable Monitorable;
typedef struct _MonitorableIface MonitorableIface;
typedef struct _LibraryPhotoPrivate LibraryPhotoPrivate;
#define _data_collection_unref0(var) ((var == NULL) ? NULL : (var = (data_collection_unref (var), NULL)))

#define THUMBNAIL_CACHE_TYPE_SIZE (thumbnail_cache_size_get_type ())

#define TYPE_EVENT_SOURCE (event_source_get_type ())
#define EVENT_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EVENT_SOURCE, EventSource))
#define EVENT_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EVENT_SOURCE, EventSourceClass))
#define IS_EVENT_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EVENT_SOURCE))
#define IS_EVENT_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EVENT_SOURCE))
#define EVENT_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EVENT_SOURCE, EventSourceClass))

typedef struct _EventSource EventSource;
typedef struct _EventSourceClass EventSourceClass;

#define TYPE_EVENT (event_get_type ())
#define EVENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EVENT, Event))
#define EVENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EVENT, EventClass))
#define IS_EVENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EVENT))
#define IS_EVENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EVENT))
#define EVENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EVENT, EventClass))

typedef struct _Event Event;
typedef struct _EventClass EventClass;

#define TYPE_CONTAINER_SOURCE_COLLECTION (container_source_collection_get_type ())
#define CONTAINER_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollection))
#define CONTAINER_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollectionClass))
#define IS_CONTAINER_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONTAINER_SOURCE_COLLECTION))
#define IS_CONTAINER_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONTAINER_SOURCE_COLLECTION))
#define CONTAINER_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollectionClass))

typedef struct _ContainerSourceCollection ContainerSourceCollection;
typedef struct _ContainerSourceCollectionClass ContainerSourceCollectionClass;

#define TYPE_TAG_SOURCE_COLLECTION (tag_source_collection_get_type ())
#define TAG_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG_SOURCE_COLLECTION, TagSourceCollection))
#define TAG_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG_SOURCE_COLLECTION, TagSourceCollectionClass))
#define IS_TAG_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG_SOURCE_COLLECTION))
#define IS_TAG_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG_SOURCE_COLLECTION))
#define TAG_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG_SOURCE_COLLECTION, TagSourceCollectionClass))

typedef struct _TagSourceCollection TagSourceCollection;
typedef struct _TagSourceCollectionClass TagSourceCollectionClass;
typedef struct _SourceHoldingTankPrivate SourceHoldingTankPrivate;
typedef struct _DatabaseSourceHoldingTankPrivate DatabaseSourceHoldingTankPrivate;
typedef struct _MediaSourceHoldingTankPrivate MediaSourceHoldingTankPrivate;
typedef struct _LibraryPhotoSourceHoldingTankPrivate LibraryPhotoSourceHoldingTankPrivate;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

typedef enum  {
	BACKING_FETCH_MODE_SOURCE,
	BACKING_FETCH_MODE_BASELINE,
	BACKING_FETCH_MODE_MASTER,
	BACKING_FETCH_MODE_UNMODIFIED
} BackingFetchMode;

struct _ImportID {
	gint64 id;
};

typedef enum  {
	PHOTO_FILE_SNIFFER_OPTIONS_GET_ALL = 0x00000000,
	PHOTO_FILE_SNIFFER_OPTIONS_NO_MD5 = 0x00000001
} PhotoFileSnifferOptions;

struct _PhotoImportParams {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PhotoImportParamsPrivate * priv;
	GFile* file;
	GFile* final_associated_file;
	ImportID import_id;
	PhotoFileSnifferOptions sniffer_options;
	gchar* exif_md5;
	gchar* thumbnail_md5;
	gchar* full_md5;
	Thumbnails* thumbnails;
	PhotoRow* row;
	GeeCollection* keywords;
};

struct _PhotoImportParamsClass {
	GTypeClass parent_class;
	void (*finalize) (PhotoImportParams *self);
};

struct _ParamSpecPhotoImportParams {
	GParamSpec parent_instance;
};

struct _PhotoTransformationState {
	GObject parent_instance;
	PhotoTransformationStatePrivate * priv;
};

struct _PhotoTransformationStateClass {
	GObjectClass parent_class;
	void (*broken) (PhotoTransformationState* self);
};

struct _PhotoTransformationStatePrivate {
	gboolean is_broke;
};

typedef enum  {
	RATING_REJECTED = -1,
	RATING_UNRATED = 0,
	RATING_ONE = 1,
	RATING_TWO = 2,
	RATING_THREE = 3,
	RATING_FOUR = 4,
	RATING_FIVE = 5
} Rating;

struct _DataObject {
	GObject parent_instance;
	DataObjectPrivate * priv;
};

struct _DataObjectClass {
	GObjectClass parent_class;
	void (*notify_altered) (DataObject* self, Alteration* alteration);
	void (*notify_membership_changed) (DataObject* self, DataCollection* collection);
	void (*notify_collection_property_set) (DataObject* self, const gchar* name, GValue* old, GValue* val);
	void (*notify_collection_property_cleared) (DataObject* self, const gchar* name);
	gchar* (*get_name) (DataObject* self);
	gchar* (*to_string) (DataObject* self);
};

struct _DataSource {
	DataObject parent_instance;
	DataSourcePrivate * priv;
};

struct _DataSourceClass {
	DataObjectClass parent_class;
	void (*notify_held_in_tank) (DataSource* self, SourceHoldingTank* holding_tank);
	void (*notify_unlinking) (DataSource* self, SourceCollection* collection);
	void (*notify_unlinked) (DataSource* self);
	void (*notify_relinking) (DataSource* self, SourceCollection* collection);
	void (*notify_relinked) (DataSource* self);
	gchar* (*get_typename) (DataSource* self);
	gint64 (*get_instance_id) (DataSource* self);
	gchar* (*get_source_id) (DataSource* self);
	void (*commit_backlinks) (DataSource* self, SourceCollection* sources, const gchar* dehydrated);
	SourceSnapshot* (*save_snapshot) (DataSource* self);
	gboolean (*internal_delete_backing) (DataSource* self, GError** error);
	gboolean (*equals) (DataSource* self, DataSource* source);
	void (*destroy) (DataSource* self);
	void (*unlinked) (DataSource* self, SourceCollection* sources);
	void (*relinked) (DataSource* self, SourceCollection* sources);
	void (*destroyed) (DataSource* self);
};

typedef enum  {
	PHOTO_FILE_FORMAT_JFIF,
	PHOTO_FILE_FORMAT_RAW,
	PHOTO_FILE_FORMAT_PNG,
	PHOTO_FILE_FORMAT_TIFF,
	PHOTO_FILE_FORMAT_BMP,
	PHOTO_FILE_FORMAT_UNKNOWN
} PhotoFileFormat;

struct _ThumbnailSource {
	DataSource parent_instance;
	ThumbnailSourcePrivate * priv;
};

struct _ThumbnailSourceClass {
	DataSourceClass parent_class;
	void (*notify_thumbnail_altered) (ThumbnailSource* self);
	GdkPixbuf* (*get_thumbnail) (ThumbnailSource* self, gint scale, GError** error);
	GdkPixbuf* (*create_thumbnail) (ThumbnailSource* self, gint scale, GError** error);
	gchar* (*get_representative_id) (ThumbnailSource* self);
	PhotoFileFormat (*get_preferred_thumbnail_format) (ThumbnailSource* self);
	void (*thumbnail_altered) (ThumbnailSource* self);
};

struct _IndexableIface {
	GTypeInterface parent_iface;
	const gchar* (*get_indexable_keywords) (Indexable* self);
};

struct _EventID {
	gint64 id;
};

typedef enum  {
	PHOTO_EXCEPTION_NONE = 0,
	PHOTO_EXCEPTION_ORIENTATION = 1 << 0,
	PHOTO_EXCEPTION_CROP = 1 << 1,
	PHOTO_EXCEPTION_REDEYE = 1 << 2,
	PHOTO_EXCEPTION_ADJUST = 1 << 3,
	PHOTO_EXCEPTION_STRAIGHTEN = 1 << 4,
	PHOTO_EXCEPTION_ALL = 0xFFFFFFFFLL
} PhotoException;

struct _Dimensions {
	gint width;
	gint height;
};

typedef enum  {
	SCALE_CONSTRAINT_ORIGINAL,
	SCALE_CONSTRAINT_DIMENSIONS,
	SCALE_CONSTRAINT_WIDTH,
	SCALE_CONSTRAINT_HEIGHT,
	SCALE_CONSTRAINT_FILL_VIEWPORT
} ScaleConstraint;

struct _Scaling {
	ScaleConstraint constraint;
	gint scale;
	Dimensions viewport;
	gboolean scale_up;
};

struct _MediaSource {
	ThumbnailSource parent_instance;
	MediaSourcePrivate * priv;
};

struct _MediaSourceClass {
	ThumbnailSourceClass parent_class;
	void (*notify_master_replaced) (MediaSource* self, GFile* old_file, GFile* new_file);
	gboolean (*set_event_id) (MediaSource* self, EventID* id);
	gchar* (*get_basename) (MediaSource* self);
	GFile* (*get_file) (MediaSource* self);
	GFile* (*get_master_file) (MediaSource* self);
	guint64 (*get_master_filesize) (MediaSource* self);
	guint64 (*get_filesize) (MediaSource* self);
	time_t (*get_timestamp) (MediaSource* self);
	BackingFileState** (*get_backing_files_state) (MediaSource* self, int* result_length1);
	gchar* (*get_title) (MediaSource* self);
	gchar* (*get_comment) (MediaSource* self);
	void (*set_title) (MediaSource* self, const gchar* title);
	gboolean (*set_comment) (MediaSource* self, const gchar* comment);
	Rating (*get_rating) (MediaSource* self);
	void (*set_rating) (MediaSource* self, Rating rating);
	void (*increase_rating) (MediaSource* self);
	void (*decrease_rating) (MediaSource* self);
	void (*get_dimensions) (MediaSource* self, PhotoException disallowed_steps, Dimensions* result);
	GdkPixbuf* (*get_preview_pixbuf) (MediaSource* self, Scaling* scaling, GError** error);
	gboolean (*is_trashed) (MediaSource* self);
	void (*trash) (MediaSource* self);
	void (*untrash) (MediaSource* self);
	gboolean (*is_offline) (MediaSource* self);
	void (*mark_offline) (MediaSource* self);
	void (*mark_online) (MediaSource* self);
	gchar* (*get_master_md5) (MediaSource* self);
	void (*get_event_id) (MediaSource* self, EventID* result);
	time_t (*get_exposure_time) (MediaSource* self);
	void (*get_import_id) (MediaSource* self, ImportID* result);
	void (*master_replaced) (MediaSource* self, GFile* old_file, GFile* new_file);
};

struct _PhotoSource {
	MediaSource parent_instance;
	PhotoSourcePrivate * priv;
};

struct _PhotoSourceClass {
	MediaSourceClass parent_class;
	PhotoMetadata* (*get_metadata) (PhotoSource* self);
	GdkPixbuf* (*get_pixbuf) (PhotoSource* self, Scaling* scaling, GError** error);
};

struct _DateableIface {
	GTypeInterface parent_iface;
	void (*set_exposure_time) (Dateable* self, time_t target_time);
	time_t (*get_exposure_time) (Dateable* self);
};

typedef enum  {
	ROTATION_CLOCKWISE,
	ROTATION_COUNTERCLOCKWISE,
	ROTATION_MIRROR,
	ROTATION_UPSIDE_DOWN
} Rotation;

struct _Photo {
	PhotoSource parent_instance;
	PhotoPrivate * priv;
	PhotoRow* row;
	gboolean can_rotate_now;
	BackingPhotoRow* backing_photo_row;
};

struct _PhotoClass {
	PhotoSourceClass parent_class;
	void (*notify_editable_replaced) (Photo* self, GFile* old_file, GFile* new_file);
	void (*notify_raw_development_modified) (Photo* self);
	void (*notify_baseline_replaced) (Photo* self);
	void (*notify_master_reimported) (Photo* self, PhotoMetadata* metadata);
	void (*notify_editable_reimported) (Photo* self, PhotoMetadata* metadata);
	void (*notify_source_reimported) (Photo* self, PhotoMetadata* metadata);
	void (*notify_baseline_reimported) (Photo* self, PhotoMetadata* metadata);
	void (*apply_user_metadata_for_reimport) (Photo* self, PhotoMetadata* metadata);
	void (*rotate) (Photo* self, Rotation rotation);
	gboolean (*has_user_generated_metadata) (Photo* self);
	void (*set_user_metadata_for_export) (Photo* self, PhotoMetadata* metadata);
	void (*editable_replaced) (Photo* self, GFile* old_file, GFile* new_file);
	void (*raw_development_modified) (Photo* self);
	void (*baseline_replaced) (Photo* self);
	void (*master_reimported) (Photo* self, PhotoMetadata* metadata);
	void (*editable_reimported) (Photo* self, PhotoMetadata* metadata);
	void (*baseline_reimported) (Photo* self, PhotoMetadata* metadata);
	void (*source_reimported) (Photo* self, PhotoMetadata* metadata);
};

typedef enum  {
	RAW_DEVELOPER_SHOTWELL = 0,
	RAW_DEVELOPER_CAMERA,
	RAW_DEVELOPER_EMBEDDED
} RawDeveloper;

struct _PhotoPrivate {
	time_t cached_exposure_time;
	GRecMutex __lock_row;
	BackingPhotoRow* editable;
	PhotoBackingReaders* readers;
	GRecMutex __lock_readers;
	PixelTransformer* transformer;
	PixelTransformationBundle* adjustments;
	gchar* file_title;
	GFileMonitor* editable_monitor;
	OneShotScheduler* reimport_editable_scheduler;
	OneShotScheduler* update_editable_attributes_scheduler;
	OneShotScheduler* remove_editable_scheduler;
	GeeHashMap* developments;
	GRecMutex __lock_developments;
};

struct _PhotoID {
	gint64 id;
};

typedef enum  {
	ORIENTATION_MIN = 1,
	ORIENTATION_TOP_LEFT = 1,
	ORIENTATION_TOP_RIGHT = 2,
	ORIENTATION_BOTTOM_RIGHT = 3,
	ORIENTATION_BOTTOM_LEFT = 4,
	ORIENTATION_LEFT_TOP = 5,
	ORIENTATION_RIGHT_TOP = 6,
	ORIENTATION_RIGHT_BOTTOM = 7,
	ORIENTATION_LEFT_BOTTOM = 8,
	ORIENTATION_MAX = 8
} Orientation;

struct _BackingPhotoID {
	gint64 id;
};

struct _PhotoRow {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PhotoRowPrivate * priv;
	PhotoID photo_id;
	BackingPhotoRow* master;
	time_t exposure_time;
	ImportID import_id;
	EventID event_id;
	Orientation orientation;
	GeeHashMap* transformations;
	gchar* md5;
	gchar* thumbnail_md5;
	gchar* exif_md5;
	time_t time_created;
	guint64 flags;
	Rating rating;
	gchar* title;
	gchar* comment;
	gchar* backlinks;
	time_t time_reimported;
	BackingPhotoID editable_id;
	gboolean metadata_dirty;
	RawDeveloper developer;
	BackingPhotoID* development_ids;
	gint development_ids_length1;
};

struct _PhotoRowClass {
	GTypeClass parent_class;
	void (*finalize) (PhotoRow *self);
};

struct _BackingPhotoRow {
	GTypeInstance parent_instance;
	volatile int ref_count;
	BackingPhotoRowPrivate * priv;
	BackingPhotoID id;
	time_t time_created;
	gchar* filepath;
	gint64 filesize;
	time_t timestamp;
	PhotoFileFormat file_format;
	Dimensions dim;
	Orientation original_orientation;
};

struct _BackingPhotoRowClass {
	GTypeClass parent_class;
	void (*finalize) (BackingPhotoRow *self);
};

struct _PhotoBackingReaders {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PhotoBackingReadersPrivate * priv;
	PhotoFileReader* master;
	PhotoFileReader* developer;
	PhotoFileReader* editable;
};

struct _PhotoBackingReadersClass {
	GTypeClass parent_class;
	void (*finalize) (PhotoBackingReaders *self);
};

typedef enum  {
	DATABASE_ERROR_ERROR,
	DATABASE_ERROR_BACKING,
	DATABASE_ERROR_MEMORY,
	DATABASE_ERROR_ABORT,
	DATABASE_ERROR_LIMITS,
	DATABASE_ERROR_TYPESPEC
} DatabaseError;
#define DATABASE_ERROR database_error_quark ()
struct _DetectedPhotoInformation {
	GTypeInstance parent_instance;
	volatile int ref_count;
	DetectedPhotoInformationPrivate * priv;
	PhotoFileFormat file_format;
	PhotoMetadata* metadata;
	gchar* md5;
	gchar* exif_md5;
	gchar* thumbnail_md5;
	gchar* format_name;
	Dimensions image_dim;
	GdkColorspace colorspace;
	gint channels;
	gint bits_per_channel;
};

struct _DetectedPhotoInformationClass {
	GTypeClass parent_class;
	void (*finalize) (DetectedPhotoInformation *self);
};

typedef enum  {
	PHOTO_FORMAT_ERROR_READ_ONLY
} PhotoFormatError;
#define PHOTO_FORMAT_ERROR photo_format_error_quark ()
typedef enum  {
	JPEG_QUALITY_LOW = 50,
	JPEG_QUALITY_MEDIUM = 75,
	JPEG_QUALITY_HIGH = 90,
	JPEG_QUALITY_MAXIMUM = 100
} JpegQuality;

typedef enum  {
	EXPORT_FORMAT_MODE_UNMODIFIED,
	EXPORT_FORMAT_MODE_CURRENT,
	EXPORT_FORMAT_MODE_SPECIFIED,
	EXPORT_FORMAT_MODE_LAST
} ExportFormatMode;

struct _ExportFormatParameters {
	ExportFormatMode mode;
	PhotoFileFormat specified_format;
	JpegQuality quality;
	gboolean export_metadata;
};

typedef enum  {
	IMPORT_RESULT_SUCCESS,
	IMPORT_RESULT_FILE_ERROR,
	IMPORT_RESULT_DECODE_ERROR,
	IMPORT_RESULT_DATABASE_ERROR,
	IMPORT_RESULT_USER_ABORT,
	IMPORT_RESULT_NOT_A_FILE,
	IMPORT_RESULT_PHOTO_EXISTS,
	IMPORT_RESULT_UNSUPPORTED_FORMAT,
	IMPORT_RESULT_NOT_AN_IMAGE,
	IMPORT_RESULT_DISK_FAILURE,
	IMPORT_RESULT_DISK_FULL,
	IMPORT_RESULT_CAMERA_ERROR,
	IMPORT_RESULT_FILE_WRITE_ERROR,
	IMPORT_RESULT_PIXBUF_CORRUPT_IMAGE
} ImportResult;

typedef enum  {
	PHOTO_FILE_READER_ROLE_DEFAULT,
	PHOTO_FILE_READER_ROLE_THUMBNAIL
} PhotoFileReaderRole;

struct _PhotoReimportMasterState {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PhotoReimportMasterStatePrivate * priv;
};

struct _PhotoReimportMasterStateClass {
	GTypeClass parent_class;
	void (*finalize) (PhotoReimportMasterState *self);
};

struct _PhotoReimportMasterStateImpl {
	PhotoReimportMasterState parent_instance;
	PhotoReimportMasterStateImplPrivate * priv;
	PhotoRow* row;
	PhotoMetadata* metadata;
	gchar** alterations;
	gint alterations_length1;
	gint _alterations_size_;
	gboolean metadata_only;
};

struct _PhotoReimportMasterStateImplClass {
	PhotoReimportMasterStateClass parent_class;
};

struct _PhotoReimportEditableState {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PhotoReimportEditableStatePrivate * priv;
};

struct _PhotoReimportEditableStateClass {
	GTypeClass parent_class;
	void (*finalize) (PhotoReimportEditableState *self);
};

struct _PhotoReimportEditableStateImpl {
	PhotoReimportEditableState parent_instance;
	PhotoReimportEditableStateImplPrivate * priv;
	BackingPhotoRow* backing_state;
	PhotoMetadata* metadata;
	gboolean metadata_only;
};

struct _PhotoReimportEditableStateImplClass {
	PhotoReimportEditableStateClass parent_class;
};

struct _PhotoReimportRawDevelopmentState {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PhotoReimportRawDevelopmentStatePrivate * priv;
};

struct _PhotoReimportRawDevelopmentStateClass {
	GTypeClass parent_class;
	void (*finalize) (PhotoReimportRawDevelopmentState *self);
};

struct _PhotoReimportRawDevelopmentStateImpl {
	PhotoReimportRawDevelopmentState parent_instance;
	PhotoReimportRawDevelopmentStateImplPrivate * priv;
	GeeCollection* list;
	gboolean metadata_only;
};

struct _PhotoReimportRawDevelopmentStateImplClass {
	PhotoReimportRawDevelopmentStateClass parent_class;
};

struct _PhotoReimportRawDevelopmentStateImplDevToReimport {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PhotoReimportRawDevelopmentStateImplDevToReimportPrivate * priv;
	BackingPhotoRow* backing;
	PhotoMetadata* metadata;
};

struct _PhotoReimportRawDevelopmentStateImplDevToReimportClass {
	GTypeClass parent_class;
	void (*finalize) (PhotoReimportRawDevelopmentStateImplDevToReimport *self);
};

typedef enum  {
	PHOTO_METADATA_SET_OPTION_ALL_DOMAINS,
	PHOTO_METADATA_SET_OPTION_ONLY_IF_DOMAIN_PRESENT,
	PHOTO_METADATA_SET_OPTION_AT_LEAST_DEFAULT_DOMAIN
} PhotoMetadataSetOption;

struct _Box {
	gint left;
	gint top;
	gint right;
	gint bottom;
};

struct _EditingToolsRedeyeInstance {
	GdkPoint center;
	gint radius;
};

struct _PhotoCachedPixbuf {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PhotoCachedPixbufPrivate * priv;
	Photo* photo;
	GdkPixbuf* pixbuf;
	GTimer* last_touched;
};

struct _PhotoCachedPixbufClass {
	GTypeClass parent_class;
	void (*finalize) (PhotoCachedPixbuf *self);
};

typedef void (*OneShotCallback) (void* user_data);
struct _PhotoPhotoTransformationStateImpl {
	PhotoTransformationState parent_instance;
	PhotoPhotoTransformationStateImplPrivate * priv;
};

struct _PhotoPhotoTransformationStateImplClass {
	PhotoTransformationStateClass parent_class;
};

struct _PhotoPhotoTransformationStateImplPrivate {
	Photo* photo;
	Orientation orientation;
	GeeHashMap* transformations;
	PixelTransformer* transformer;
	PixelTransformationBundle* adjustments;
};

struct _PhotoParamSpecBackingReaders {
	GParamSpec parent_instance;
};

struct _PhotoParamSpecCachedPixbuf {
	GParamSpec parent_instance;
};

struct _PhotoParamSpecReimportMasterState {
	GParamSpec parent_instance;
};

struct _PhotoParamSpecReimportEditableState {
	GParamSpec parent_instance;
};

struct _PhotoParamSpecReimportRawDevelopmentState {
	GParamSpec parent_instance;
};

struct _PhotoReimportRawDevelopmentStateImplParamSpecDevToReimport {
	GParamSpec parent_instance;
};

typedef gint64 (*Comparator) (void* a, void* b, void* user_data);
typedef gboolean (*ComparatorPredicate) (DataObject* object, Alteration* alteration, void* user_data);
typedef gboolean (*ProgressMonitor) (guint64 current, guint64 total, gboolean do_event_loop, void* user_data);
struct _MarkerIface {
	GTypeInterface parent_iface;
	void (*mark) (Marker* self, DataObject* object);
	void (*unmark) (Marker* self, DataObject* object);
	gboolean (*toggle) (Marker* self, DataObject* object);
	void (*mark_many) (Marker* self, GeeCollection* list);
	void (*unmark_many) (Marker* self, GeeCollection* list);
	void (*mark_all) (Marker* self);
	gint (*get_count) (Marker* self);
	GeeCollection* (*get_all) (Marker* self);
};

struct _DataCollection {
	GTypeInstance parent_instance;
	volatile int ref_count;
	DataCollectionPrivate * priv;
};

struct _DataCollectionClass {
	GTypeClass parent_class;
	void (*finalize) (DataCollection *self);
	gchar* (*to_string) (DataCollection* self);
	void (*notify_items_added) (DataCollection* self, GeeIterable* added);
	void (*notify_items_removed) (DataCollection* self, GeeIterable* removed);
	void (*notify_contents_altered) (DataCollection* self, GeeIterable* added, GeeIterable* removed);
	void (*notify_items_altered) (DataCollection* self, GeeMap* items);
	void (*notify_ordering_changed) (DataCollection* self);
	void (*notify_property_set) (DataCollection* self, const gchar* name, GValue* old, GValue* val);
	void (*notify_property_cleared) (DataCollection* self, const gchar* name);
	gboolean (*valid_type) (DataCollection* self, DataObject* object);
	void (*set_comparator) (DataCollection* self, Comparator comparator, void* comparator_target, ComparatorPredicate predicate, void* predicate_target);
	void (*reset_comparator) (DataCollection* self);
	GeeCollection* (*get_all) (DataCollection* self);
	gint (*get_count) (DataCollection* self);
	DataObject* (*get_at) (DataCollection* self, gint index);
	gint (*index_of) (DataCollection* self, DataObject* object);
	gboolean (*contains) (DataCollection* self, DataObject* object);
	gboolean (*add) (DataCollection* self, DataObject* object);
	GeeCollection* (*add_many) (DataCollection* self, GeeCollection* objects, ProgressMonitor monitor, void* monitor_target);
	void (*remove_marked) (DataCollection* self, Marker* m);
	void (*clear) (DataCollection* self);
	void (*close) (DataCollection* self);
	void (*notify_frozen) (DataCollection* self);
	void (*notify_thawed) (DataCollection* self);
	void (*items_added) (DataCollection* self, GeeIterable* added);
	void (*items_removed) (DataCollection* self, GeeIterable* removed);
	void (*contents_altered) (DataCollection* self, GeeIterable* added, GeeIterable* removed);
	void (*items_altered) (DataCollection* self, GeeMap* items);
	void (*ordering_changed) (DataCollection* self);
	void (*property_set) (DataCollection* self, const gchar* name, GValue* old, GValue* val);
	void (*property_cleared) (DataCollection* self, const gchar* name);
	void (*frozen) (DataCollection* self);
	void (*thawed) (DataCollection* self);
};

struct _SourceCollection {
	DataCollection parent_instance;
	SourceCollectionPrivate * priv;
};

struct _SourceCollectionClass {
	DataCollectionClass parent_class;
	gboolean (*holds_type_of_source) (SourceCollection* self, DataSource* source);
	void (*notify_items_unlinking) (SourceCollection* self, GeeCollection* unlinking);
	void (*notify_items_relinked) (SourceCollection* self, GeeCollection* relinked);
	void (*notify_item_destroyed) (SourceCollection* self, DataSource* source);
	void (*notify_items_destroyed) (SourceCollection* self, GeeCollection* destroyed);
	void (*notify_unlinked_destroyed) (SourceCollection* self, DataSource* unlinked);
	void (*notify_backlink_removed) (SourceCollection* self, SourceBacklink* backlink, GeeCollection* sources);
	gboolean (*has_backlink) (SourceCollection* self, SourceBacklink* backlink);
	void (*remove_backlink) (SourceCollection* self, SourceBacklink* backlink);
	void (*items_unlinking) (SourceCollection* self, GeeCollection* unlinking);
	void (*items_relinked) (SourceCollection* self, GeeCollection* relinked);
	void (*item_destroyed) (SourceCollection* self, DataSource* source);
	void (*items_destroyed) (SourceCollection* self, GeeCollection* destroyed);
	void (*unlinked_destroyed) (SourceCollection* self, DataSource* source);
	void (*backlink_removed) (SourceCollection* self, SourceBacklink* backlink, GeeCollection* sources);
};

struct _DatabaseSourceCollection {
	SourceCollection parent_instance;
	DatabaseSourceCollectionPrivate * priv;
};

struct _DatabaseSourceCollectionClass {
	SourceCollectionClass parent_class;
};

struct _MediaSourceCollection {
	DatabaseSourceCollection parent_instance;
	MediaSourceCollectionPrivate * priv;
};

struct _MediaSourceCollectionClass {
	DatabaseSourceCollectionClass parent_class;
	MediaSourceHoldingTank* (*create_trashcan) (MediaSourceCollection* self);
	MediaSourceHoldingTank* (*create_offline_bin) (MediaSourceCollection* self);
	MediaMonitor* (*create_media_monitor) (MediaSourceCollection* self, Workers* workers, GCancellable* cancellable);
	gchar* (*get_typename) (MediaSourceCollection* self);
	gboolean (*is_file_recognized) (MediaSourceCollection* self, GFile* file);
	MediaSource* (*fetch_by_numeric_id) (MediaSourceCollection* self, gint64 numeric_id);
	void (*notify_import_roll_altered) (MediaSourceCollection* self);
	void (*notify_flagged_contents_altered) (MediaSourceCollection* self);
	void (*notify_media_import_starting) (MediaSourceCollection* self, GeeCollection* media);
	void (*notify_media_import_completed) (MediaSourceCollection* self, GeeCollection* media);
	MediaSource* (*fetch_by_source_id) (MediaSourceCollection* self, const gchar* source_id);
	GeeCollection* (*get_event_source_ids) (MediaSourceCollection* self, EventID* event_id);
	void (*import_many) (MediaSourceCollection* self, GeeCollection* media);
	void (*postprocess_imported_media) (MediaSourceCollection* self, GeeCollection* media);
	void (*media_import_starting) (MediaSourceCollection* self, GeeCollection* media);
	void (*media_import_completed) (MediaSourceCollection* self, GeeCollection* media);
	void (*master_file_replaced) (MediaSourceCollection* self, MediaSource* media, GFile* old_file, GFile* new_file);
	void (*trashcan_contents_altered) (MediaSourceCollection* self, GeeCollection* added, GeeCollection* removed);
	void (*import_roll_altered) (MediaSourceCollection* self);
	void (*offline_contents_altered) (MediaSourceCollection* self, GeeCollection* added, GeeCollection* removed);
	void (*flagged_contents_altered) (MediaSourceCollection* self);
	TransactionController* (*get_transaction_controller) (MediaSourceCollection* self);
};

struct _LibraryPhotoSourceCollection {
	MediaSourceCollection parent_instance;
	LibraryPhotoSourceCollectionPrivate * priv;
};

struct _LibraryPhotoSourceCollectionClass {
	MediaSourceCollectionClass parent_class;
	void (*notify_master_reimported) (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
	void (*notify_editable_reimported) (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
	void (*notify_source_reimported) (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
	void (*notify_baseline_reimported) (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
	void (*master_reimported) (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
	void (*editable_reimported) (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
	void (*baseline_reimported) (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
	void (*source_reimported) (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
};

struct _LibraryPhotoSourceCollectionPrivate {
	TransactionController* _transaction_controller;
	GeeHashMap* by_editable_file;
	GeeHashMap* by_raw_development_file;
	GeeMultiMap* filesize_to_photo;
	GeeHashMap* photo_to_master_filesize;
	GeeHashMap* photo_to_editable_filesize;
	GeeMultiMap* photo_to_raw_development_filesize;
};

typedef enum  {
	LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_UNKNOWN,
	LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_ONLINE,
	LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_OFFLINE,
	LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_TRASH,
	LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_EDITABLE,
	LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_DEVELOPER
} LibraryPhotoSourceCollectionState;

typedef gint64 (*GetSourceDatabaseKey) (DataSource* source, void* user_data);
typedef gboolean (*SourceHoldingTankCheckToKeep) (DataSource* source, Alteration* alteration, void* user_data);
struct _FlaggableIface {
	GTypeInterface parent_iface;
	gboolean (*is_flagged) (Flaggable* self);
	void (*mark_flagged) (Flaggable* self);
	void (*mark_unflagged) (Flaggable* self);
};

struct _MonitorableIface {
	GTypeInterface parent_iface;
	gboolean (*is_offline) (Monitorable* self);
	void (*mark_online) (Monitorable* self);
	void (*mark_offline) (Monitorable* self);
	void (*set_master_file) (Monitorable* self, GFile* file);
	void (*set_master_timestamp) (Monitorable* self, GFileInfo* info);
};

struct _LibraryPhoto {
	Photo parent_instance;
	LibraryPhotoPrivate * priv;
};

struct _LibraryPhotoClass {
	PhotoClass parent_class;
};

struct _LibraryPhotoPrivate {
	gboolean block_thumbnail_generation;
	OneShotScheduler* thumbnail_scheduler;
	GeeCollection* import_keywords;
};

typedef enum  {
	THUMBNAIL_CACHE_SIZE_LARGEST = 360,
	THUMBNAIL_CACHE_SIZE_BIG = 360,
	THUMBNAIL_CACHE_SIZE_MEDIUM = 128,
	THUMBNAIL_CACHE_SIZE_SMALLEST = 128
} ThumbnailCacheSize;

struct _SourceHoldingTank {
	GTypeInstance parent_instance;
	volatile int ref_count;
	SourceHoldingTankPrivate * priv;
};

struct _SourceHoldingTankClass {
	GTypeClass parent_class;
	void (*finalize) (SourceHoldingTank *self);
	void (*notify_contents_altered) (SourceHoldingTank* self, GeeCollection* added, GeeCollection* removed);
	void (*contents_altered) (SourceHoldingTank* self, GeeCollection* added, GeeCollection* removed);
};

struct _DatabaseSourceHoldingTank {
	SourceHoldingTank parent_instance;
	DatabaseSourceHoldingTankPrivate * priv;
};

struct _DatabaseSourceHoldingTankClass {
	SourceHoldingTankClass parent_class;
};

struct _MediaSourceHoldingTank {
	DatabaseSourceHoldingTank parent_instance;
	MediaSourceHoldingTankPrivate * priv;
};

struct _MediaSourceHoldingTankClass {
	DatabaseSourceHoldingTankClass parent_class;
};

struct _LibraryPhotoSourceHoldingTank {
	MediaSourceHoldingTank parent_instance;
	LibraryPhotoSourceHoldingTankPrivate * priv;
};

struct _LibraryPhotoSourceHoldingTankClass {
	MediaSourceHoldingTankClass parent_class;
};

struct _LibraryPhotoSourceHoldingTankPrivate {
	GeeHashMap* editable_file_map;
	GeeHashMap* development_file_map;
	GeeMultiMap* reverse_editable_file_map;
	GeeMultiMap* reverse_development_file_map;
};


static gpointer photo_import_params_parent_class = NULL;
static gpointer photo_transformation_state_parent_class = NULL;
static gpointer photo_parent_class = NULL;
static GeeLinkedList* photo_source_pixbuf_cache;
static GRecMutex __lock_photo_source_pixbuf_cache = {0};
static GeeLinkedList* photo_source_pixbuf_cache = NULL;
static guint photo_discard_source_id;
static guint photo_discard_source_id = (guint) 0;
static gboolean photo__develop_raw_photos_to_files;
static gboolean photo__develop_raw_photos_to_files = FALSE;
static gpointer photo_photo_transformation_state_impl_parent_class = NULL;
static gpointer photo_backing_readers_parent_class = NULL;
static gpointer photo_cached_pixbuf_parent_class = NULL;
static gpointer photo_reimport_master_state_parent_class = NULL;
static gpointer photo_reimport_master_state_impl_parent_class = NULL;
static gpointer photo_reimport_editable_state_parent_class = NULL;
static gpointer photo_reimport_editable_state_impl_parent_class = NULL;
static gpointer photo_reimport_raw_development_state_parent_class = NULL;
static gpointer photo_reimport_raw_development_state_impl_parent_class = NULL;
static gpointer photo_reimport_raw_development_state_impl_dev_to_reimport_parent_class = NULL;
static DateableIface* photo_dateable_parent_iface = NULL;
static gpointer library_photo_source_collection_parent_class = NULL;
static gpointer library_photo_parent_class = NULL;
extern LibraryPhotoSourceCollection* library_photo_global;
LibraryPhotoSourceCollection* library_photo_global = NULL;
extern TagSourceCollection* tag_global;
static FlaggableIface* library_photo_flaggable_parent_iface = NULL;
static MonitorableIface* library_photo_monitorable_parent_iface = NULL;
static gpointer library_photo_source_holding_tank_parent_class = NULL;

GType backing_fetch_mode_get_type (void) G_GNUC_CONST;
gpointer photo_import_params_ref (gpointer instance);
void photo_import_params_unref (gpointer instance);
GParamSpec* param_spec_photo_import_params (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_photo_import_params (GValue* value, gpointer v_object);
void value_take_photo_import_params (GValue* value, gpointer v_object);
gpointer value_get_photo_import_params (const GValue* value);
GType photo_import_params_get_type (void) G_GNUC_CONST;
GType import_id_get_type (void) G_GNUC_CONST;
ImportID* import_id_dup (const ImportID* self);
void import_id_free (ImportID* self);
GType photo_file_sniffer_options_get_type (void) G_GNUC_CONST;
gpointer thumbnails_ref (gpointer instance);
void thumbnails_unref (gpointer instance);
GParamSpec* param_spec_thumbnails (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_thumbnails (GValue* value, gpointer v_object);
void value_take_thumbnails (GValue* value, gpointer v_object);
gpointer value_get_thumbnails (const GValue* value);
GType thumbnails_get_type (void) G_GNUC_CONST;
gpointer photo_row_ref (gpointer instance);
void photo_row_unref (gpointer instance);
GParamSpec* param_spec_photo_row (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_photo_row (GValue* value, gpointer v_object);
void value_take_photo_row (GValue* value, gpointer v_object);
gpointer value_get_photo_row (const GValue* value);
GType photo_row_get_type (void) G_GNUC_CONST;
enum  {
	PHOTO_IMPORT_PARAMS_DUMMY_PROPERTY
};
PhotoRow* photo_row_new (void);
PhotoRow* photo_row_construct (GType object_type);
PhotoImportParams* photo_import_params_new (GFile* file, GFile* final_associated_file, ImportID* import_id, PhotoFileSnifferOptions sniffer_options, const gchar* exif_md5, const gchar* thumbnail_md5, const gchar* full_md5, Thumbnails* thumbnails);
PhotoImportParams* photo_import_params_construct (GType object_type, GFile* file, GFile* final_associated_file, ImportID* import_id, PhotoFileSnifferOptions sniffer_options, const gchar* exif_md5, const gchar* thumbnail_md5, const gchar* full_md5, Thumbnails* thumbnails);
PhotoImportParams* photo_import_params_new_create_placeholder (GFile* file, ImportID* import_id);
PhotoImportParams* photo_import_params_construct_create_placeholder (GType object_type, GFile* file, ImportID* import_id);
static void photo_import_params_finalize (PhotoImportParams* obj);
GType photo_transformation_state_get_type (void) G_GNUC_CONST;
#define PHOTO_TRANSFORMATION_STATE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PHOTO_TRANSFORMATION_STATE, PhotoTransformationStatePrivate))
enum  {
	PHOTO_TRANSFORMATION_STATE_DUMMY_PROPERTY
};
PhotoTransformationState* photo_transformation_state_construct (GType object_type);
gboolean photo_transformation_state_is_broken (PhotoTransformationState* self);
static void photo_transformation_state_real_broken (PhotoTransformationState* self);
static void photo_transformation_state_finalize (GObject* obj);
GType rating_get_type (void) G_GNUC_CONST;
gboolean rating_can_increase (Rating self);
gboolean rating_can_decrease (Rating self);
gboolean rating_is_valid (Rating self);
Rating rating_increase (Rating self);
Rating rating_decrease (Rating self);
gint rating_serialize (Rating self);
Rating rating_unserialize (gint value);
GType data_object_get_type (void) G_GNUC_CONST;
gpointer alteration_ref (gpointer instance);
void alteration_unref (gpointer instance);
GParamSpec* param_spec_alteration (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_alteration (GValue* value, gpointer v_object);
void value_take_alteration (GValue* value, gpointer v_object);
gpointer value_get_alteration (const GValue* value);
GType alteration_get_type (void) G_GNUC_CONST;
gpointer data_collection_ref (gpointer instance);
void data_collection_unref (gpointer instance);
GParamSpec* param_spec_data_collection (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_data_collection (GValue* value, gpointer v_object);
void value_take_data_collection (GValue* value, gpointer v_object);
gpointer value_get_data_collection (const GValue* value);
GType data_collection_get_type (void) G_GNUC_CONST;
GType data_source_get_type (void) G_GNUC_CONST;
gpointer source_holding_tank_ref (gpointer instance);
void source_holding_tank_unref (gpointer instance);
GParamSpec* param_spec_source_holding_tank (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_source_holding_tank (GValue* value, gpointer v_object);
void value_take_source_holding_tank (GValue* value, gpointer v_object);
gpointer value_get_source_holding_tank (const GValue* value);
GType source_holding_tank_get_type (void) G_GNUC_CONST;
GType source_collection_get_type (void) G_GNUC_CONST;
gpointer source_snapshot_ref (gpointer instance);
void source_snapshot_unref (gpointer instance);
GParamSpec* param_spec_source_snapshot (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_source_snapshot (GValue* value, gpointer v_object);
void value_take_source_snapshot (GValue* value, gpointer v_object);
gpointer value_get_source_snapshot (const GValue* value);
GType source_snapshot_get_type (void) G_GNUC_CONST;
GType thumbnail_source_get_type (void) G_GNUC_CONST;
GType photo_file_format_get_type (void) G_GNUC_CONST;
GType indexable_get_type (void) G_GNUC_CONST;
GType media_source_get_type (void) G_GNUC_CONST;
GType event_id_get_type (void) G_GNUC_CONST;
EventID* event_id_dup (const EventID* self);
void event_id_free (EventID* self);
gpointer backing_file_state_ref (gpointer instance);
void backing_file_state_unref (gpointer instance);
GParamSpec* param_spec_backing_file_state (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_backing_file_state (GValue* value, gpointer v_object);
void value_take_backing_file_state (GValue* value, gpointer v_object);
gpointer value_get_backing_file_state (const GValue* value);
GType backing_file_state_get_type (void) G_GNUC_CONST;
GType photo_exception_get_type (void) G_GNUC_CONST;
GType dimensions_get_type (void) G_GNUC_CONST;
Dimensions* dimensions_dup (const Dimensions* self);
void dimensions_free (Dimensions* self);
GType scaling_get_type (void) G_GNUC_CONST;
GType scale_constraint_get_type (void) G_GNUC_CONST;
Scaling* scaling_dup (const Scaling* self);
void scaling_free (Scaling* self);
GType photo_source_get_type (void) G_GNUC_CONST;
gpointer media_metadata_ref (gpointer instance);
void media_metadata_unref (gpointer instance);
GParamSpec* param_spec_media_metadata (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_media_metadata (GValue* value, gpointer v_object);
void value_take_media_metadata (GValue* value, gpointer v_object);
gpointer value_get_media_metadata (const GValue* value);
GType media_metadata_get_type (void) G_GNUC_CONST;
GType photo_metadata_get_type (void) G_GNUC_CONST;
GType dateable_get_type (void) G_GNUC_CONST;
GType photo_get_type (void) G_GNUC_CONST;
GType rotation_get_type (void) G_GNUC_CONST;
gpointer backing_photo_row_ref (gpointer instance);
void backing_photo_row_unref (gpointer instance);
GParamSpec* param_spec_backing_photo_row (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_backing_photo_row (GValue* value, gpointer v_object);
void value_take_backing_photo_row (GValue* value, gpointer v_object);
gpointer value_get_backing_photo_row (const GValue* value);
GType backing_photo_row_get_type (void) G_GNUC_CONST;
static gpointer photo_backing_readers_ref (gpointer instance);
static void photo_backing_readers_unref (gpointer instance);
static GParamSpec* photo_param_spec_backing_readers (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) G_GNUC_UNUSED;
static void photo_value_set_backing_readers (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static void photo_value_take_backing_readers (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static gpointer photo_value_get_backing_readers (const GValue* value) G_GNUC_UNUSED;
static GType photo_backing_readers_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
gpointer one_shot_scheduler_ref (gpointer instance);
void one_shot_scheduler_unref (gpointer instance);
GParamSpec* param_spec_one_shot_scheduler (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_one_shot_scheduler (GValue* value, gpointer v_object);
void value_take_one_shot_scheduler (GValue* value, gpointer v_object);
gpointer value_get_one_shot_scheduler (const GValue* value);
GType one_shot_scheduler_get_type (void) G_GNUC_CONST;
GType raw_developer_get_type (void) G_GNUC_CONST;
#define PHOTO_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PHOTO, PhotoPrivate))
enum  {
	PHOTO_DUMMY_PROPERTY
};
gboolean photo_exception_prohibits (PhotoException self, PhotoException exception);
gboolean photo_exception_allows (PhotoException self, PhotoException exception);
static gpointer photo_cached_pixbuf_ref (gpointer instance);
static void photo_cached_pixbuf_unref (gpointer instance);
static GParamSpec* photo_param_spec_cached_pixbuf (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) G_GNUC_UNUSED;
static void photo_value_set_cached_pixbuf (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static void photo_value_take_cached_pixbuf (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static gpointer photo_value_get_cached_pixbuf (const GValue* value) G_GNUC_UNUSED;
static GType photo_cached_pixbuf_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
BackingPhotoRow* backing_photo_row_new (void);
BackingPhotoRow* backing_photo_row_construct (GType object_type);
static PhotoBackingReaders* photo_backing_readers_new (void);
static PhotoBackingReaders* photo_backing_readers_construct (GType object_type);
#define PHOTO_TYPENAME "thumb"
#define PHOTO_SCALING_FUDGE 64
#define PHOTO_SOURCE_PIXBUF_TIME_TO_LIVE_SEC 10
#define PHOTO_SOURCE_PIXBUF_MIN_LRU_COUNT 1
#define PHOTO_SOURCE_PIXBUF_MAX_LRU_COUNT 3
#define PHOTO_MIN_EMBEDDED_SIZE 1024
Photo* photo_construct (GType object_type, PhotoRow* row);
#define DATA_OBJECT_INVALID_OBJECT_ID ((gint64) -1)
PhotoSource* photo_source_construct (GType object_type, gint64 object_id);
gchar* media_source_prep_title (const gchar* title);
GType photo_id_get_type (void) G_GNUC_CONST;
PhotoID* photo_id_dup (const PhotoID* self);
void photo_id_free (PhotoID* self);
GType orientation_get_type (void) G_GNUC_CONST;
GType backing_photo_id_get_type (void) G_GNUC_CONST;
BackingPhotoID* backing_photo_id_dup (const BackingPhotoID* self);
void backing_photo_id_free (BackingPhotoID* self);
gchar* media_source_prep_comment (const gchar* comment);
gpointer photo_file_adapter_ref (gpointer instance);
void photo_file_adapter_unref (gpointer instance);
GParamSpec* param_spec_photo_file_adapter (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_photo_file_adapter (GValue* value, gpointer v_object);
void value_take_photo_file_adapter (GValue* value, gpointer v_object);
gpointer value_get_photo_file_adapter (const GValue* value);
GType photo_file_adapter_get_type (void) G_GNUC_CONST;
GType photo_file_reader_get_type (void) G_GNUC_CONST;
PhotoFileReader* photo_file_format_create_reader (PhotoFileFormat self, const gchar* filepath);
gchar* string_sliced_at_last_char (const gchar* haystack, gunichar ch, gint start_index);
gchar* string_sliced_at (const gchar* str, gint index);
gboolean is_string_empty (const gchar* s);
#define BACKING_PHOTO_ID_INVALID ((gint64) -1)
static BackingPhotoRow* photo_get_backing_row (Photo* self, BackingPhotoID* id);
gpointer database_table_ref (gpointer instance);
void database_table_unref (gpointer instance);
GParamSpec* param_spec_database_table (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_database_table (GValue* value, gpointer v_object);
void value_take_database_table (GValue* value, gpointer v_object);
gpointer value_get_database_table (const GValue* value);
GType database_table_get_type (void) G_GNUC_CONST;
GType photo_table_get_type (void) G_GNUC_CONST;
PhotoTable* photo_table_get_instance (void);
GQuark database_error_quark (void);
void photo_table_detach_editable (PhotoTable* self, PhotoRow* row, GError** error);
static void photo_internal_remove_all_transformations (Photo* self, gboolean notify);
RawDeveloper* raw_developer_as_array (int* result_length1);
void photo_init_photo (void);
void photo_terminate_photo (void);
void photo_notify_editable_replaced (Photo* self, GFile* old_file, GFile* new_file);
static void photo_real_notify_editable_replaced (Photo* self, GFile* old_file, GFile* new_file);
void photo_notify_raw_development_modified (Photo* self);
static void photo_real_notify_raw_development_modified (Photo* self);
void photo_notify_baseline_replaced (Photo* self);
static void photo_real_notify_baseline_replaced (Photo* self);
void photo_notify_master_reimported (Photo* self, PhotoMetadata* metadata);
static void photo_real_notify_master_reimported (Photo* self, PhotoMetadata* metadata);
void photo_notify_editable_reimported (Photo* self, PhotoMetadata* metadata);
static void photo_real_notify_editable_reimported (Photo* self, PhotoMetadata* metadata);
void photo_notify_source_reimported (Photo* self, PhotoMetadata* metadata);
static void photo_real_notify_source_reimported (Photo* self, PhotoMetadata* metadata);
void photo_notify_baseline_reimported (Photo* self, PhotoMetadata* metadata);
static void photo_real_notify_baseline_reimported (Photo* self, PhotoMetadata* metadata);
static gboolean photo_real_internal_delete_backing (DataSource* base, GError** error);
GFile* photo_file_adapter_get_file (PhotoFileAdapter* self);
static void photo_detach_editable (Photo* self, gboolean delete_editable, gboolean remove_transformations, gboolean notify);
PhotoFileFormat photo_get_master_file_format (Photo* self);
static gboolean photo_delete_raw_development (Photo* self, RawDeveloper d);
gchar* data_object_to_string (DataObject* self);
gboolean data_source_internal_delete_backing (DataSource* self, GError** error);
GType backing_photo_table_get_type (void) G_GNUC_CONST;
BackingPhotoTable* backing_photo_table_get_instance (void);
BackingPhotoRow* backing_photo_table_fetch (BackingPhotoTable* self, BackingPhotoID* id, GError** error);
void backing_photo_table_remove (BackingPhotoTable* self, BackingPhotoID* backing_id, GError** error);
gboolean photo_is_raw_developer_complete (Photo* self, RawDeveloper d);
gboolean photo_is_raw_developer_available (Photo* self, RawDeveloper d);
PhotoMetadata* photo_get_master_metadata (Photo* self, GError** error);
guint photo_metadata_get_preview_count (PhotoMetadata* self);
gpointer photo_preview_ref (gpointer instance);
void photo_preview_unref (gpointer instance);
GParamSpec* param_spec_photo_preview (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_photo_preview (GValue* value, gpointer v_object);
void value_take_photo_preview (GValue* value, gpointer v_object);
gpointer value_get_photo_preview (const GValue* value);
GType photo_preview_get_type (void) G_GNUC_CONST;
PhotoPreview* photo_metadata_get_preview (PhotoMetadata* self, guint number);
void photo_preview_get_pixel_dimensions (PhotoPreview* self, Dimensions* result);
void photo_add_backing_photo_for_development (Photo* self, RawDeveloper d, BackingPhotoRow* bpr, GError** error);
void photo_import_developed_backing_photo (PhotoRow* row, RawDeveloper d, BackingPhotoRow* bpr, GError** error);
void data_object_notify_altered (DataObject* self, Alteration* alteration);
Alteration* alteration_new (const gchar* subject, const gchar* detail);
Alteration* alteration_construct (GType object_type, const gchar* subject, const gchar* detail);
#define UTIL_FILE_ATTRIBUTES "standard::*,time::*,id::file,id::filesystem,etag::value"
#define DIRECTORY_MONITOR_SUPPLIED_ATTRIBUTES UTIL_FILE_ATTRIBUTES
gpointer photo_file_interrogator_ref (gpointer instance);
void photo_file_interrogator_unref (gpointer instance);
GParamSpec* param_spec_photo_file_interrogator (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_photo_file_interrogator (GValue* value, gpointer v_object);
void value_take_photo_file_interrogator (GValue* value, gpointer v_object);
gpointer value_get_photo_file_interrogator (const GValue* value);
GType photo_file_interrogator_get_type (void) G_GNUC_CONST;
PhotoFileInterrogator* photo_file_interrogator_new (GFile* file, PhotoFileSnifferOptions options);
PhotoFileInterrogator* photo_file_interrogator_construct (GType object_type, GFile* file, PhotoFileSnifferOptions options);
void photo_file_interrogator_interrogate (PhotoFileInterrogator* self, GError** error);
gpointer detected_photo_information_ref (gpointer instance);
void detected_photo_information_unref (gpointer instance);
GParamSpec* param_spec_detected_photo_information (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_detected_photo_information (GValue* value, gpointer v_object);
void value_take_detected_photo_information (GValue* value, gpointer v_object);
gpointer value_get_detected_photo_information (const GValue* value);
GType detected_photo_information_get_type (void) G_GNUC_CONST;
DetectedPhotoInformation* photo_file_interrogator_get_detected_photo_information (PhotoFileInterrogator* self);
gboolean photo_file_interrogator_get_is_photo_corrupted (PhotoFileInterrogator* self);
Orientation photo_metadata_get_orientation (PhotoMetadata* self);
void backing_photo_table_add (BackingPhotoTable* self, BackingPhotoRow* state, GError** error);
void photo_table_update_raw_development (PhotoTable* self, PhotoRow* row, RawDeveloper rd, BackingPhotoID* backing_photo_id, GError** error);
static void photo_develop_photo (Photo* self, RawDeveloper d);
BackingPhotoRow* raw_developer_create_backing_row_for_development (RawDeveloper self, const gchar* raw_filepath, const gchar* camera_development_filename, GError** error);
GdkPixbuf* photo_get_master_pixbuf (Photo* self, Scaling* scaling, gboolean rotate, GError** error);
void scaling_for_original (Scaling* result);
GType photo_file_writer_get_type (void) G_GNUC_CONST;
GQuark photo_format_error_quark (void);
PhotoFileWriter* photo_file_format_create_writer (PhotoFileFormat self, const gchar* filepath, GError** error);
GType jpeg_quality_get_type (void) G_GNUC_CONST;
void photo_file_writer_write (PhotoFileWriter* self, GdkPixbuf* pixbuf, JpegQuality quality, GError** error);
GType photo_file_metadata_writer_get_type (void) G_GNUC_CONST;
PhotoFileMetadataWriter* photo_file_format_create_metadata_writer (PhotoFileFormat self, const gchar* filepath, GError** error);
void photo_file_metadata_writer_write_metadata (PhotoFileMetadataWriter* self, PhotoMetadata* metadata, GError** error);
GdkPixbuf* photo_preview_get_pixbuf (PhotoPreview* self, GError** error);
void photo_set_default_raw_developer (Photo* self, RawDeveloper d);
void photo_set_raw_developer (Photo* self, RawDeveloper d);
void photo_revert_to_master (Photo* self, gboolean notify);
GdkPixbuf* photo_get_prefetched_copy (Photo* self, GError** error);
gboolean photo_set_orientation (Photo* self, Orientation orientation);
void photo_discard_prefetched (Photo* self);
RawDeveloper photo_get_raw_developer (Photo* self);
gchar* raw_developer_to_string (RawDeveloper self);
void photo_table_remove_development (PhotoTable* self, PhotoRow* row, RawDeveloper rd, GError** error);
void photo_redevelop_raw (Photo* self, RawDeveloper d);
static BackingFileState** photo_real_get_backing_files_state (MediaSource* base, int* result_length1);
BackingFileState* backing_file_state_new_from_photo_row (BackingPhotoRow* photo_row, const gchar* md5);
BackingFileState* backing_file_state_construct_from_photo_row (GType object_type, BackingPhotoRow* photo_row, const gchar* md5);
static void _vala_array_add86 (BackingFileState*** array, int* length, int* size, BackingFileState* value);
gboolean photo_has_editable (Photo* self);
static void _vala_array_add87 (BackingFileState*** array, int* length, int* size, BackingFileState* value);
gboolean photo_is_developed (Photo* self);
GeeCollection* photo_get_raw_development_photo_rows (Photo* self);
static void _vala_array_add88 (BackingFileState*** array, int* length, int* size, BackingFileState* value);
static PhotoFileReader* photo_get_backing_reader (Photo* self, BackingFetchMode mode);
static PhotoFileReader* photo_get_master_reader (Photo* self);
static PhotoFileReader* photo_get_baseline_reader (Photo* self);
static PhotoFileReader* photo_get_source_reader (Photo* self);
static PhotoFileReader* photo_get_raw_developer_reader (Photo* self);
const gchar* backing_fetch_mode_to_string (BackingFetchMode self);
PhotoFileReader* photo_get_editable_reader (Photo* self);
gboolean photo_does_master_exist (Photo* self);
gboolean photo_file_adapter_file_exists (PhotoFileAdapter* self);
gboolean photo_does_editable_exist (Photo* self);
gboolean photo_is_master_baseline (Photo* self);
gboolean photo_is_master_source (Photo* self);
gboolean photo_is_editable_baseline (Photo* self);
gboolean photo_is_editable_source (Photo* self);
BackingPhotoRow* photo_get_master_photo_row (Photo* self);
BackingPhotoRow* photo_get_editable_photo_row (Photo* self);
gboolean backing_photo_id_is_valid (BackingPhotoID *self);
BackingPhotoRow* photo_get_raw_development_photo_row (Photo* self, RawDeveloper d);
PhotoFileFormat* photo_get_editable_file_format (Photo* self);
PhotoFileFormat photo_file_adapter_get_file_format (PhotoFileAdapter* self);
static PhotoFileFormat* _photo_file_format_dup (PhotoFileFormat* self);
GType export_format_parameters_get_type (void) G_GNUC_CONST;
GType export_format_mode_get_type (void) G_GNUC_CONST;
ExportFormatParameters* export_format_parameters_dup (const ExportFormatParameters* self);
void export_format_parameters_free (ExportFormatParameters* self);
PhotoFileFormat photo_get_export_format_for_parameters (Photo* self, ExportFormatParameters* params);
PhotoFileFormat photo_file_format_get_system_default_format (void);
PhotoFileFormat photo_get_best_export_file_format (Photo* self);
gchar* photo_get_export_basename_for_parameters (Photo* self, ExportFormatParameters* params);
GFile* media_source_get_master_file (MediaSource* self);
gchar* photo_get_export_basename (Photo* self, PhotoFileFormat* file_format);
GType import_result_get_type (void) G_GNUC_CONST;
ImportResult photo_prepare_for_import (PhotoImportParams* params);
gboolean photo_is_file_image (GFile* file);
gboolean photo_file_format_is_file_supported (GFile* file);
gpointer metadata_date_time_ref (gpointer instance);
void metadata_date_time_unref (gpointer instance);
GParamSpec* param_spec_metadata_date_time (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_metadata_date_time (GValue* value, gpointer v_object);
void value_take_metadata_date_time (GValue* value, gpointer v_object);
gpointer value_get_metadata_date_time (const GValue* value);
GType metadata_date_time_get_type (void) G_GNUC_CONST;
MetadataDateTime* photo_metadata_get_exposure_date_time (PhotoMetadata* self);
time_t metadata_date_time_get_timestamp (MetadataDateTime* self);
gchar* media_metadata_get_title (MediaMetadata* self);
gchar* media_metadata_get_comment (MediaMetadata* self);
GeeSet* photo_metadata_get_keywords (PhotoMetadata* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify);
Rating photo_metadata_get_rating (PhotoMetadata* self);
#define PHOTO_ID_INVALID ((gint64) -1)
void photo_id_init (PhotoID *self, gint64 id);
#define EVENT_ID_INVALID ((gint64) -1)
void event_id_init (EventID *self, gint64 id);
GType photo_file_reader_role_get_type (void) G_GNUC_CONST;
void photo_file_reader_set_role (PhotoFileReader* self, PhotoFileReaderRole role);
void thumbnail_cache_generate_for_photo (Thumbnails* thumbnails, PhotoFileReader* reader, Orientation orientation, Dimensions* original_dim, GError** error);
ImportResult import_result_convert_error (GError* err, ImportResult default_result);
void photo_create_pre_import (PhotoImportParams* params);
void dimensions_init (Dimensions *self, gint width, gint height);
BackingPhotoRow* photo_query_backing_photo_row (Photo* self, GFile* file, PhotoFileSnifferOptions options, DetectedPhotoInformation** detected, GError** error);
gpointer photo_reimport_master_state_ref (gpointer instance);
void photo_reimport_master_state_unref (gpointer instance);
GParamSpec* photo_param_spec_reimport_master_state (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void photo_value_set_reimport_master_state (GValue* value, gpointer v_object);
void photo_value_take_reimport_master_state (GValue* value, gpointer v_object);
gpointer photo_value_get_reimport_master_state (const GValue* value);
GType photo_reimport_master_state_get_type (void) G_GNUC_CONST;
gboolean photo_prepare_for_reimport_master (Photo* self, PhotoReimportMasterState** reimport_state, GError** error);
static void _vala_array_add89 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add90 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add91 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add92 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add93 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add94 (gchar*** array, int* length, int* size, gchar* value);
static PhotoReimportMasterStateImpl* photo_reimport_master_state_impl_new (PhotoRow* row, PhotoMetadata* metadata, gchar** alterations, int alterations_length1);
static PhotoReimportMasterStateImpl* photo_reimport_master_state_impl_construct (GType object_type, PhotoRow* row, PhotoMetadata* metadata, gchar** alterations, int alterations_length1);
static GType photo_reimport_master_state_impl_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
void photo_apply_user_metadata_for_reimport (Photo* self, PhotoMetadata* metadata);
static void photo_real_apply_user_metadata_for_reimport (Photo* self, PhotoMetadata* metadata);
void photo_finish_reimport_master (Photo* self, PhotoReimportMasterState* state, GError** error);
void photo_table_reimport (PhotoTable* self, PhotoRow* row, GError** error);
void backing_photo_row_copy_from (BackingPhotoRow* self, BackingPhotoRow* from);
static void _vala_array_add95 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add96 (gchar*** array, int* length, int* size, gchar* value);
Alteration* alteration_new_from_array (gchar** array, int array_length1);
Alteration* alteration_construct_from_array (GType object_type, gchar** array, int array_length1);
static gboolean photo_verify_file_for_reimport (Photo* self, GFile* file, BackingPhotoRow** backing, DetectedPhotoInformation** detected, GError** error);
gpointer photo_reimport_editable_state_ref (gpointer instance);
void photo_reimport_editable_state_unref (gpointer instance);
GParamSpec* photo_param_spec_reimport_editable_state (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void photo_value_set_reimport_editable_state (GValue* value, gpointer v_object);
void photo_value_take_reimport_editable_state (GValue* value, gpointer v_object);
gpointer photo_value_get_reimport_editable_state (const GValue* value);
GType photo_reimport_editable_state_get_type (void) G_GNUC_CONST;
gboolean photo_prepare_for_reimport_editable (Photo* self, PhotoReimportEditableState** state, GError** error);
GFile* photo_get_editable_file (Photo* self);
static PhotoReimportEditableStateImpl* photo_reimport_editable_state_impl_new (BackingPhotoRow* backing_state, PhotoMetadata* metadata);
static PhotoReimportEditableStateImpl* photo_reimport_editable_state_impl_construct (GType object_type, BackingPhotoRow* backing_state, PhotoMetadata* metadata);
static GType photo_reimport_editable_state_impl_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
void photo_finish_reimport_editable (Photo* self, PhotoReimportEditableState* state, GError** error);
void photo_get_editable_id (Photo* self, BackingPhotoID* result);
gboolean backing_photo_id_is_invalid (BackingPhotoID *self);
void backing_photo_table_update (BackingPhotoTable* self, BackingPhotoRow* row, GError** error);
void media_source_set_title (MediaSource* self, const gchar* title);
gboolean media_source_set_comment (MediaSource* self, const gchar* comment);
void media_source_set_rating (MediaSource* self, Rating rating);
Alteration* alteration_new_from_list (const gchar* list);
Alteration* alteration_construct_from_list (GType object_type, const gchar* list);
gpointer photo_reimport_raw_development_state_ref (gpointer instance);
void photo_reimport_raw_development_state_unref (gpointer instance);
GParamSpec* photo_param_spec_reimport_raw_development_state (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void photo_value_set_reimport_raw_development_state (GValue* value, gpointer v_object);
void photo_value_take_reimport_raw_development_state (GValue* value, gpointer v_object);
gpointer photo_value_get_reimport_raw_development_state (const GValue* value);
GType photo_reimport_raw_development_state_get_type (void) G_GNUC_CONST;
gboolean photo_prepare_for_reimport_raw_development (Photo* self, PhotoReimportRawDevelopmentState** state, GError** error);
GeeCollection* photo_get_raw_developer_files (Photo* self);
static GType photo_reimport_raw_development_state_impl_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static PhotoReimportRawDevelopmentStateImpl* photo_reimport_raw_development_state_impl_new (void);
static PhotoReimportRawDevelopmentStateImpl* photo_reimport_raw_development_state_impl_construct (GType object_type);
static void photo_reimport_raw_development_state_impl_add (PhotoReimportRawDevelopmentStateImpl* self, BackingPhotoRow* backing, PhotoMetadata* metadata);
static gint photo_reimport_raw_development_state_impl_get_size (PhotoReimportRawDevelopmentStateImpl* self);
void photo_finish_reimport_raw_development (Photo* self, PhotoReimportRawDevelopmentState* state, GError** error);
static gpointer photo_reimport_raw_development_state_impl_dev_to_reimport_ref (gpointer instance);
static void photo_reimport_raw_development_state_impl_dev_to_reimport_unref (gpointer instance);
static GParamSpec* photo_reimport_raw_development_state_impl_param_spec_dev_to_reimport (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) G_GNUC_UNUSED;
static void photo_reimport_raw_development_state_impl_value_set_dev_to_reimport (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static void photo_reimport_raw_development_state_impl_value_take_dev_to_reimport (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static gpointer photo_reimport_raw_development_state_impl_value_get_dev_to_reimport (const GValue* value) G_GNUC_UNUSED;
GType photo_reimport_raw_development_state_impl_dev_to_reimport_get_type (void) G_GNUC_CONST;
static gchar* photo_real_get_typename (DataSource* base);
static gint64 photo_real_get_instance_id (DataSource* base);
void photo_get_photo_id (Photo* self, PhotoID* result);
static gchar* photo_real_get_source_id (DataSource* base);
gchar* data_source_get_typename (DataSource* self);
gint64 data_source_get_instance_id (DataSource* self);
void photo_set_master_timestamp (Photo* self, GFileInfo* info);
void photo_table_update_timestamp (PhotoTable* self, PhotoID* photo_id, time_t timestamp, GError** error);
void app_window_database_error (GError* err);
void photo_update_editable_modification_time (Photo* self, GFileInfo* info, GError** error);
void backing_photo_table_update_timestamp (BackingPhotoTable* self, BackingPhotoID* id, time_t timestamp, GError** error);
void photo_update_many_editable_timestamps (GeeMap* map, GError** error);
void database_table_begin_transaction (void);
void database_table_commit_transaction (GError** error);
static PhotoFileFormat photo_real_get_preferred_thumbnail_format (ThumbnailSource* base);
PhotoFileFormat photo_get_file_format (Photo* self);
gboolean photo_file_format_can_write_image (PhotoFileFormat self);
static GdkPixbuf* photo_real_create_thumbnail (ThumbnailSource* base, gint scale, GError** error);
GdkPixbuf* photo_source_get_pixbuf (PhotoSource* self, Scaling* scaling, GError** error);
void scaling_for_best_fit (gint pixels, gboolean scale_up, Scaling* result);
static gboolean photo_is_extension_found (const gchar* basename, gchar** extensions, int extensions_length1);
void disassemble_filename (const gchar* basename, gchar** name, gchar** ext);
gboolean photo_is_duplicate (GFile* file, const gchar* thumbnail_md5, const gchar* full_md5, PhotoFileFormat file_format);
gboolean photo_table_has_duplicate (PhotoTable* self, GFile* file, const gchar* thumbnail_md5, const gchar* md5, PhotoFileFormat file_format);
PhotoID* photo_get_duplicate_ids (GFile* file, const gchar* thumbnail_md5, const gchar* full_md5, PhotoFileFormat file_format, int* result_length1);
PhotoID* photo_table_get_duplicate_ids (PhotoTable* self, GFile* file, const gchar* thumbnail_md5, const gchar* md5, PhotoFileFormat file_format, int* result_length1);
gint64 photo_get_photo_key (DataSource* source);
GType library_photo_get_type (void) G_GNUC_CONST;
static GFile* photo_real_get_file (MediaSource* base);
void photo_set_master_file (Photo* self, GFile* file);
void photo_table_set_filepath (PhotoTable* self, PhotoID* photo_id, const gchar* filepath, GError** error);
void media_source_notify_master_replaced (MediaSource* self, GFile* old_file, GFile* new_file);
static void _vala_array_add97 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add98 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add99 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add100 (gchar*** array, int* length, int* size, gchar* value);
void photo_set_editable_file (Photo* self, GFile* file);
void backing_photo_table_set_filepath (BackingPhotoTable* self, BackingPhotoID* id, const gchar* filepath, GError** error);
static void _vala_array_add101 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add102 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add103 (gchar*** array, int* length, int* size, gchar* value);
void photo_set_many_editable_file (GeeMap* map, GError** error);
GFile* photo_get_actual_file (Photo* self);
static GFile* photo_real_get_master_file (MediaSource* base);
GFile* photo_get_source_file (Photo* self);
gboolean photo_file_format_can_write (PhotoFileFormat self);
static time_t photo_real_get_timestamp (MediaSource* base);
static inline void photo_real_get_event_id (MediaSource* base, EventID* result);
gint64 photo_get_raw_event_id (Photo* self);
static void photo_real_get_import_id (MediaSource* base, ImportID* result);
static gchar* photo_real_get_master_md5 (MediaSource* base);
guint64 photo_get_flags (Photo* self);
static void photo_notify_flags_altered (Photo* self, Alteration* additional_alteration);
Alteration* alteration_compress (Alteration* self, Alteration* other);
guint64 photo_replace_flags (Photo* self, guint64 flags, Alteration* additional_alteration);
gboolean photo_table_replace_flags (PhotoTable* self, PhotoID* photo_id, guint64 flags);
gboolean photo_is_flag_set (Photo* self, guint64 mask);
gboolean media_source_internal_is_flag_set (guint64 flags, guint64 selector);
guint64 photo_add_flags (Photo* self, guint64 mask, Alteration* additional_alteration);
guint64 media_source_internal_add_flags (guint64 flags, guint64 selector);
guint64 photo_remove_flags (Photo* self, guint64 mask, Alteration* additional_alteration);
guint64 media_source_internal_remove_flags (guint64 flags, guint64 selector);
guint64 photo_add_remove_flags (Photo* self, guint64 add, guint64 remove, Alteration* additional_alteration);
void photo_add_remove_many_flags (GeeCollection* add, guint64 add_mask, Alteration* additional_add_alteration, GeeCollection* remove, guint64 remove_mask, Alteration* additional_remove_alteration, GError** error);
guint64 photo_toggle_flags (Photo* self, guint64 mask, Alteration* additional_alteration);
gboolean photo_is_master_metadata_dirty (Photo* self);
void photo_set_master_metadata_dirty (Photo* self, gboolean dirty, GError** error);
void photo_table_set_metadata_dirty (PhotoTable* self, PhotoID* photo_id, gboolean dirty, GError** error);
static Rating photo_real_get_rating (MediaSource* base);
static void photo_real_set_rating (MediaSource* base, Rating rating);
gboolean photo_table_set_rating (PhotoTable* self, PhotoID* photo_id, Rating rating);
static void photo_real_increase_rating (MediaSource* base);
static void photo_real_decrease_rating (MediaSource* base);
static void photo_real_commit_backlinks (DataSource* base, SourceCollection* sources, const gchar* backlinks);
void photo_table_update_backlinks (PhotoTable* self, PhotoID* photo_id, const gchar* backlinks, GError** error);
static gboolean photo_real_set_event_id (MediaSource* base, EventID* event_id);
gboolean photo_table_set_event (PhotoTable* self, PhotoID* photo_id, EventID* event_id);
static gchar* photo_real_to_string (DataObject* base);
gchar* photo_file_adapter_get_filepath (PhotoFileAdapter* self);
static gboolean photo_real_equals (DataSource* base, DataSource* source);
gboolean data_source_equals (DataSource* self, DataSource* source);
static void photo_file_exif_updated (Photo* self);
GFile* media_source_get_file (MediaSource* self);
gboolean photo_table_master_exif_updated (PhotoTable* self, PhotoID* photoID, gint64 filesize, glong timestamp, const gchar* md5, const gchar* exif_md5, const gchar* thumbnail_md5, PhotoRow* row);
static guint64 photo_real_get_filesize (MediaSource* base);
static guint64 photo_real_get_master_filesize (MediaSource* base);
guint64 photo_get_editable_filesize (Photo* self);
static time_t photo_real_get_exposure_time (Dateable* base);
static gchar* photo_real_get_basename (MediaSource* base);
static gchar* photo_real_get_title (MediaSource* base);
static gchar* photo_real_get_comment (MediaSource* base);
static void photo_real_set_title (MediaSource* base, const gchar* title);
gboolean photo_table_set_title (PhotoTable* self, PhotoID* photo_id, const gchar* new_title);
static gboolean photo_real_set_comment (MediaSource* base, const gchar* comment);
gboolean photo_table_set_comment (PhotoTable* self, PhotoID* photo_id, const gchar* new_comment);
void photo_set_import_id (Photo* self, ImportID* import_id);
void photo_table_set_import_id (PhotoTable* self, PhotoID* photo_id, ImportID* import_id, GError** error);
void photo_set_title_persistent (Photo* self, const gchar* title, GError** error);
gboolean photo_file_format_can_write_metadata (PhotoFileFormat self);
PhotoMetadata* photo_file_reader_read_metadata (PhotoFileReader* self, GError** error);
GType photo_metadata_set_option_get_type (void) G_GNUC_CONST;
void photo_metadata_set_title (PhotoMetadata* self, const gchar* title, PhotoMetadataSetOption option);
PhotoFileMetadataWriter* photo_file_reader_create_metadata_writer (PhotoFileReader* self, GError** error);
void library_monitor_blacklist_file (GFile* file, const gchar* reason);
void library_monitor_unblacklist_file (GFile* file);
void photo_set_comment_persistent (Photo* self, const gchar* comment, GError** error);
void photo_metadata_set_comment (PhotoMetadata* self, const gchar* comment, PhotoMetadataSetOption option);
static void photo_real_set_exposure_time (Dateable* base, time_t time);
gboolean photo_table_set_exposure_time (PhotoTable* self, PhotoID* photo_id, time_t time);
void photo_set_exposure_time_persistent (Photo* self, time_t time, GError** error);
void dateable_set_exposure_time (Dateable* self, time_t target_time);
void photo_metadata_set_exposure_date_time (PhotoMetadata* self, MetadataDateTime* date_time, PhotoMetadataSetOption option);
MetadataDateTime* metadata_date_time_new (time_t timestamp);
MetadataDateTime* metadata_date_time_construct (GType object_type, time_t timestamp);
static void photo_real_get_dimensions (MediaSource* base, PhotoException disallowed_steps, Dimensions* result);
void photo_get_raw_dimensions (Photo* self, Dimensions* result);
Orientation photo_get_orientation (Photo* self);
gboolean photo_get_straighten (Photo* self, gdouble* theta);
void compute_arb_rotated_size (gdouble src_width, gdouble src_height, gdouble angle, gdouble* dest_width, gdouble* dest_height);
GType box_get_type (void) G_GNUC_CONST;
Box* box_dup (const Box* self);
void box_free (Box* self);
gboolean photo_get_crop (Photo* self, Box* crop, PhotoException exceptions);
void box_get_dimensions (Box *self, Dimensions* result);
static void photo_locked_create_adjustments_from_data (Photo* self);
static KeyValueMap* photo_get_transformation (Photo* self, const gchar* name);
PixelTransformationBundle* photo_get_color_adjustments (Photo* self);
PixelTransformer* photo_get_pixel_transformer (Photo* self);
gboolean photo_has_color_adjustments (Photo* self);
static gboolean photo_has_transformation (Photo* self, const gchar* name);
PixelTransformation* photo_get_color_adjustment (Photo* self, PixelTransformationType type);
void photo_set_color_adjustments (Photo* self, PixelTransformationBundle* new_adjustments);
static gboolean photo_remove_transformation (Photo* self, const gchar* name);
static gboolean photo_set_transformation (Photo* self, KeyValueMap* trans);
static PhotoMetadata* photo_real_get_metadata (PhotoSource* base);
PhotoMetadata* photo_get_editable_metadata (Photo* self, GError** error);
gboolean photo_persist_master_metadata (Photo* self, PhotoMetadata* metadata, PhotoReimportMasterState** state, GError** error);
void photo_finish_update_master_metadata (Photo* self, PhotoReimportMasterState* state, GError** error);
gboolean photo_persist_editable_metadata (Photo* self, PhotoMetadata* metadata, PhotoReimportEditableState** state, GError** error);
void photo_finish_update_editable_metadata (Photo* self, PhotoReimportEditableState* state, GError** error);
gboolean photo_has_transformations (Photo* self);
gboolean photo_only_metadata_changed (Photo* self);
PhotoMetadata* photo_source_get_metadata (PhotoSource* self);
gboolean photo_has_alterations (Photo* self);
gchar* media_source_get_comment (MediaSource* self);
gchar* media_source_get_title (MediaSource* self);
PhotoTransformationState* photo_save_transformation_state (Photo* self);
static PhotoPhotoTransformationStateImpl* photo_photo_transformation_state_impl_new (Photo* photo, Orientation orientation, GeeHashMap* transformations, PixelTransformer* transformer, PixelTransformationBundle* adjustments);
static PhotoPhotoTransformationStateImpl* photo_photo_transformation_state_impl_construct (GType object_type, Photo* photo, Orientation orientation, GeeHashMap* transformations, PixelTransformer* transformer, PixelTransformationBundle* adjustments);
static GType photo_photo_transformation_state_impl_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
gboolean photo_load_transformation_state (Photo* self, PhotoTransformationState* state);
static Orientation photo_photo_transformation_state_impl_get_orientation (PhotoPhotoTransformationStateImpl* self);
static GeeHashMap* photo_photo_transformation_state_impl_get_transformations (PhotoPhotoTransformationStateImpl* self);
static PixelTransformer* photo_photo_transformation_state_impl_get_transformer (PhotoPhotoTransformationStateImpl* self);
static PixelTransformationBundle* photo_photo_transformation_state_impl_get_color_adjustments (PhotoPhotoTransformationStateImpl* self);
gboolean photo_table_set_transformation_state (PhotoTable* self, PhotoID* photo_id, Orientation orientation, GeeHashMap* transformations);
void photo_remove_all_transformations (Photo* self);
gboolean photo_table_remove_all_transformations (PhotoTable* self, PhotoID* photo_id);
gboolean photo_table_set_orientation (PhotoTable* self, PhotoID* photo_id, Orientation orientation);
Orientation photo_get_original_orientation (Photo* self);
gboolean photo_check_can_rotate (Photo* self);
void photo_rotate (Photo* self, Rotation rotation);
static void photo_real_rotate (Photo* self, Rotation rotation);
Orientation orientation_perform (Orientation self, Rotation rotation);
gboolean photo_table_set_transformation (PhotoTable* self, PhotoID* photo_id, KeyValueMap* map);
gboolean photo_table_remove_transformation (PhotoTable* self, PhotoID* photo_id, const gchar* object);
gboolean photo_has_crop (Photo* self);
gboolean photo_get_raw_crop (Photo* self, Box* crop);
void box_init (Box *self, gint left, gint top, gint right, gint bottom);
static void photo_set_raw_crop (Photo* self, Box* crop);
static gboolean photo_get_raw_straighten (Photo* self, gdouble* angle);
static void photo_set_raw_straighten (Photo* self, gdouble theta);
GType editing_tools_redeye_instance_get_type (void) G_GNUC_CONST;
EditingToolsRedeyeInstance* editing_tools_redeye_instance_dup (const EditingToolsRedeyeInstance* self);
void editing_tools_redeye_instance_free (EditingToolsRedeyeInstance* self);
static EditingToolsRedeyeInstance* photo_get_raw_redeye_instances (Photo* self, int* result_length1);
gboolean photo_has_redeye_transformations (Photo* self);
void photo_add_redeye_instance (Photo* self, EditingToolsRedeyeInstance* redeye);
static gboolean photo_calculate_pixbuf_dimensions (Photo* self, Scaling* scaling, PhotoException exceptions, Dimensions* scaled_image, Dimensions* scaled_to_viewport);
static gboolean photo_locked_calculate_pixbuf_dimensions (Photo* self, Scaling* scaling, PhotoException exceptions, Dimensions* scaled_image, Dimensions* scaled_to_viewport);
gboolean scaling_is_unscaled (Scaling *self);
void orientation_rotate_box (Orientation self, Dimensions* space, Box* box, Box* result);
void orientation_rotate_dimensions (Orientation self, Dimensions* dim, Dimensions* result);
void box_get_scaled (Box *self, Dimensions* scaled, Box* result);
void scaling_get_scaled_dimensions (Scaling *self, Dimensions* original, Dimensions* result);
gint box_get_width (Box *self);
gint box_get_height (Box *self);
void dimensions_get_scaled_similar (Dimensions *self, Dimensions* original, Dimensions* scaled, Dimensions* result);
void orientation_derotate_dimensions (Orientation self, Dimensions* dim, Dimensions* result);
gboolean dimensions_has_area (Dimensions *self);
static GdkPixbuf* photo_load_raw_pixbuf (Photo* self, Scaling* scaling, PhotoException exceptions, BackingFetchMode fetch_mode, GError** error);
GdkPixbuf* photo_file_reader_unscaled_read (PhotoFileReader* self, GError** error);
GdkPixbuf* photo_file_reader_scaled_read (PhotoFileReader* self, Dimensions* full, Dimensions* scaled, GError** error);
gboolean dimensions_approx_equals (Dimensions *self, Dimensions* dim, gint fudge);
void dimensions_for_pixbuf (GdkPixbuf* pixbuf, Dimensions* result);
static GdkPixbuf* photo_get_untransformed_pixbuf (Photo* self, Scaling* scaling, gboolean rotate, BackingFetchMode fetch_mode, GError** error);
GdkPixbuf* photo_get_unmodified_pixbuf (Photo* self, Scaling* scaling, gboolean rotate, GError** error);
GdkPixbuf* orientation_rotate_pixbuf (Orientation self, GdkPixbuf* pixbuf);
static GdkPixbuf* photo_real_get_pixbuf (PhotoSource* base, Scaling* scaling, GError** error);
GdkPixbuf* photo_get_pixbuf_with_options (Photo* self, Scaling* scaling, PhotoException exceptions, BackingFetchMode fetch_mode, GError** error);
static GdkPixbuf* photo_run_source_pixbuf_cache (Photo* locate, gboolean keep, GError** error);
static PhotoCachedPixbuf* photo_cached_pixbuf_new (Photo* photo, GdkPixbuf* pixbuf);
static PhotoCachedPixbuf* photo_cached_pixbuf_construct (GType object_type, Photo* photo, GdkPixbuf* pixbuf);
static gboolean photo_trim_source_pixbuf_cache (void);
static gboolean _photo_trim_source_pixbuf_cache_gsource_func (gpointer self);
gboolean photo_get_develop_raw_photos_to_files (void);
void media_source_get_dimensions (MediaSource* self, PhotoException disallowed_steps, Dimensions* result);
gboolean dimensions_equals (Dimensions *self, Dimensions* dim);
static GdkPixbuf* photo_do_redeye (Photo* self, GdkPixbuf* pixbuf, EditingToolsRedeyeInstance* inst);
GdkPixbuf* rotate_arb (GdkPixbuf* source_pixbuf, gdouble angle);
gboolean photo_has_user_generated_metadata (Photo* self);
static gboolean photo_real_has_user_generated_metadata (Photo* self);
void photo_set_user_metadata_for_export (Photo* self, PhotoMetadata* metadata);
static void photo_real_set_user_metadata_for_export (Photo* self, PhotoMetadata* metadata);
gpointer photo_file_format_properties_ref (gpointer instance);
void photo_file_format_properties_unref (gpointer instance);
GParamSpec* param_spec_photo_file_format_properties (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_photo_file_format_properties (GValue* value, gpointer v_object);
void value_take_photo_file_format_properties (GValue* value, gpointer v_object);
gpointer value_get_photo_file_format_properties (const GValue* value);
GType photo_file_format_properties_get_type (void) G_GNUC_CONST;
PhotoFileFormatProperties* photo_file_format_get_properties (PhotoFileFormat self);
GFile* photo_file_format_properties_convert_file_extension (PhotoFileFormatProperties* self, GFile* file);
static gboolean photo_export_fullsized_backing (Photo* self, GFile* file, gboolean export_metadata, GError** error);
PhotoMetadata* photo_file_format_create_metadata (PhotoFileFormat self);
time_t media_source_get_exposure_time (MediaSource* self);
void photo_metadata_set_pixel_dimensions (PhotoMetadata* self, Dimensions* dim, PhotoMetadataSetOption option);
void photo_metadata_set_orientation (PhotoMetadata* self, Orientation orientation);
void photo_metadata_set_software (PhotoMetadata* self, const gchar* software, const gchar* version);
#define RESOURCES_APP_TITLE "Shotwell"
#define RESOURCES_APP_VERSION _VERSION
void photo_metadata_remove_exif_thumbnail (PhotoMetadata* self);
void photo_metadata_clear (PhotoMetadata* self);
gboolean photo_is_export_required (Photo* self, Scaling* scaling, PhotoFileFormat export_format);
void photo_export (Photo* self, GFile* dest_file, Scaling* scaling, JpegQuality quality, PhotoFileFormat export_format, gboolean direct_copy_unmodified, gboolean export_metadata, GError** error);
const gchar* photo_file_format_to_string (PhotoFileFormat self);
void photo_metadata_remove_tag (PhotoMetadata* self, const gchar* tag);
static GFile* photo_generate_new_editable_file (Photo* self, PhotoFileFormat* file_format, GError** error);
gboolean photo_file_format_properties_is_recognized_extension (PhotoFileFormatProperties* self, const gchar* ext);
gchar* photo_file_format_properties_get_default_extension (PhotoFileFormatProperties* self);
GFile* generate_unique_file (GFile* dir, const gchar* basename, gboolean* collision, GError** error);
static gboolean photo_launch_editor (GFile* file, PhotoFileFormat file_format, GError** error);
GType configuration_facade_get_type (void) G_GNUC_CONST;
GType config_facade_get_type (void) G_GNUC_CONST;
ConfigFacade* config_facade_get_instance (void);
gchar* configuration_facade_get_external_raw_app (ConfigurationFacade* self);
gchar* configuration_facade_get_external_photo_app (ConfigurationFacade* self);
static void _g_object_unref0_ (gpointer var);
static void _g_list_free__g_object_unref0_ (GList* self);
void photo_open_with_raw_external_editor (Photo* self, GError** error);
void photo_open_with_external_editor (Photo* self, GError** error);
static void photo_halt_monitoring_editable (Photo* self);
static void photo_attach_editable (Photo* self, PhotoFileFormat file_format, GFile* file, GError** error);
static void photo_start_monitoring_editable (Photo* self, GFile* file, GError** error);
static void photo_on_editable_file_changed (Photo* self, GFile* file, GFile* other_file, GFileMonitorEvent event);
static void _photo_on_editable_file_changed_g_file_monitor_changed (GFileMonitor* _sender, GFile* file, GFile* other_file, GFileMonitorEvent event_type, gpointer self);
static void photo_update_editable (Photo* self, gboolean only_attributes, PhotoFileReader* new_reader, GError** error);
static void photo_update_editable_attributes (Photo* self, GError** error);
void photo_reimport_editable (Photo* self, GError** error);
void photo_table_attach_editable (PhotoTable* self, PhotoRow* row, BackingPhotoID* editable_id, GError** error);
void backing_photo_table_update_attributes (BackingPhotoTable* self, BackingPhotoID* id, time_t timestamp, gint64 filesize, GError** error);
static void _vala_array_add104 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add105 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add106 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add107 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add108 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add109 (gchar*** array, int* length, int* size, gchar* value);
void backing_photo_id_init (BackingPhotoID *self, gint64 id);
const gchar* g_file_monitor_event_to_string (GFileMonitorEvent self);
static void photo_on_reimport_editable (Photo* self);
static void _photo_on_reimport_editable_one_shot_callback (gpointer self);
OneShotScheduler* one_shot_scheduler_new (const gchar* name, OneShotCallback callback, void* callback_target);
OneShotScheduler* one_shot_scheduler_construct (GType object_type, const gchar* name, OneShotCallback callback, void* callback_target);
void one_shot_scheduler_after_timeout (OneShotScheduler* self, guint msec, gboolean reschedule);
static void photo_on_update_editable_attributes (Photo* self);
static void _photo_on_update_editable_attributes_one_shot_callback (gpointer self);
static void photo_on_remove_editable (Photo* self);
static void _photo_on_remove_editable_one_shot_callback (gpointer self);
void photo_get_original_dimensions (Photo* self, Dimensions* result);
void photo_get_master_dimensions (Photo* self, Dimensions* result);
void photo_set_crop (Photo* self, Box* crop);
void orientation_derotate_box (Orientation self, Dimensions* space, Box* box, Box* result);
void photo_set_straighten (Photo* self, gdouble theta);
static GdkPixbuf* photo_red_reduce_pixel (Photo* self, GdkPixbuf* pixbuf, gint x, gint y);
void photo_unscaled_to_raw_point (Photo* self, GdkPoint* unscaled_point, GdkPoint* result);
void orientation_derotate_point (Orientation self, Dimensions* space, GdkPoint* point, GdkPoint* result);
void photo_unscaled_to_raw_rect (Photo* self, GdkRectangle* unscaled_rect, GdkRectangle* result);
PixelTransformationBundle* photo_get_enhance_transformations (Photo* self);
gboolean photo_enhance (Photo* self);
void photo_set_develop_raw_photos_to_files (gboolean value);
static void photo_real_editable_replaced (Photo* self, GFile* old_file, GFile* new_file);
static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void photo_real_raw_development_modified (Photo* self);
static void photo_real_baseline_replaced (Photo* self);
static void photo_real_master_reimported (Photo* self, PhotoMetadata* metadata);
static void g_cclosure_user_marshal_VOID__MEDIA_METADATA (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void photo_real_editable_reimported (Photo* self, PhotoMetadata* metadata);
static void photo_real_baseline_reimported (Photo* self, PhotoMetadata* metadata);
static void photo_real_source_reimported (Photo* self, PhotoMetadata* metadata);
#define PHOTO_PHOTO_TRANSFORMATION_STATE_IMPL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PHOTO_TYPE_PHOTO_TRANSFORMATION_STATE_IMPL, PhotoPhotoTransformationStateImplPrivate))
enum  {
	PHOTO_PHOTO_TRANSFORMATION_STATE_IMPL_DUMMY_PROPERTY
};
static void photo_photo_transformation_state_impl_on_photo_baseline_replaced (PhotoPhotoTransformationStateImpl* self);
static void _photo_photo_transformation_state_impl_on_photo_baseline_replaced_photo_baseline_replaced (Photo* _sender, gpointer self);
static GeeHashMap* photo_photo_transformation_state_impl_copy_transformations (GeeHashMap* original);
static void photo_photo_transformation_state_impl_finalize (GObject* obj);
enum  {
	PHOTO_BACKING_READERS_DUMMY_PROPERTY
};
static void photo_backing_readers_finalize (PhotoBackingReaders* obj);
enum  {
	PHOTO_CACHED_PIXBUF_DUMMY_PROPERTY
};
static void photo_cached_pixbuf_finalize (PhotoCachedPixbuf* obj);
enum  {
	PHOTO_REIMPORT_MASTER_STATE_DUMMY_PROPERTY
};
PhotoReimportMasterState* photo_reimport_master_state_construct (GType object_type);
static void photo_reimport_master_state_finalize (PhotoReimportMasterState* obj);
enum  {
	PHOTO_REIMPORT_MASTER_STATE_IMPL_DUMMY_PROPERTY
};
static gchar** _vala_array_dup23 (gchar** self, int length);
static void photo_reimport_master_state_impl_finalize (PhotoReimportMasterState* obj);
enum  {
	PHOTO_REIMPORT_EDITABLE_STATE_DUMMY_PROPERTY
};
PhotoReimportEditableState* photo_reimport_editable_state_construct (GType object_type);
static void photo_reimport_editable_state_finalize (PhotoReimportEditableState* obj);
enum  {
	PHOTO_REIMPORT_EDITABLE_STATE_IMPL_DUMMY_PROPERTY
};
static void photo_reimport_editable_state_impl_finalize (PhotoReimportEditableState* obj);
enum  {
	PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_DUMMY_PROPERTY
};
PhotoReimportRawDevelopmentState* photo_reimport_raw_development_state_construct (GType object_type);
static void photo_reimport_raw_development_state_finalize (PhotoReimportRawDevelopmentState* obj);
enum  {
	PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_DUMMY_PROPERTY
};
static PhotoReimportRawDevelopmentStateImplDevToReimport* photo_reimport_raw_development_state_impl_dev_to_reimport_new (BackingPhotoRow* backing, PhotoMetadata* metadata);
static PhotoReimportRawDevelopmentStateImplDevToReimport* photo_reimport_raw_development_state_impl_dev_to_reimport_construct (GType object_type, BackingPhotoRow* backing, PhotoMetadata* metadata);
enum  {
	PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_DEV_TO_REIMPORT_DUMMY_PROPERTY
};
static void photo_reimport_raw_development_state_impl_dev_to_reimport_finalize (PhotoReimportRawDevelopmentStateImplDevToReimport* obj);
static void photo_reimport_raw_development_state_impl_finalize (PhotoReimportRawDevelopmentState* obj);
static void photo_finalize (GObject* obj);
static void _vala_photo_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_photo_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType marker_get_type (void) G_GNUC_CONST;
gpointer source_backlink_ref (gpointer instance);
void source_backlink_unref (gpointer instance);
GParamSpec* param_spec_source_backlink (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_source_backlink (GValue* value, gpointer v_object);
void value_take_source_backlink (GValue* value, gpointer v_object);
gpointer value_get_source_backlink (const GValue* value);
GType source_backlink_get_type (void) G_GNUC_CONST;
GType database_source_collection_get_type (void) G_GNUC_CONST;
GType media_source_collection_get_type (void) G_GNUC_CONST;
GType database_source_holding_tank_get_type (void) G_GNUC_CONST;
GType media_source_holding_tank_get_type (void) G_GNUC_CONST;
gpointer workers_ref (gpointer instance);
void workers_unref (gpointer instance);
GParamSpec* param_spec_workers (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_workers (GValue* value, gpointer v_object);
void value_take_workers (GValue* value, gpointer v_object);
gpointer value_get_workers (const GValue* value);
GType workers_get_type (void) G_GNUC_CONST;
GType media_monitor_get_type (void) G_GNUC_CONST;
gpointer transaction_controller_ref (gpointer instance);
void transaction_controller_unref (gpointer instance);
GParamSpec* param_spec_transaction_controller (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_transaction_controller (GValue* value, gpointer v_object);
void value_take_transaction_controller (GValue* value, gpointer v_object);
gpointer value_get_transaction_controller (const GValue* value);
GType transaction_controller_get_type (void) G_GNUC_CONST;
GType library_photo_source_collection_get_type (void) G_GNUC_CONST;
#define LIBRARY_PHOTO_SOURCE_COLLECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollectionPrivate))
enum  {
	LIBRARY_PHOTO_SOURCE_COLLECTION_DUMMY_PROPERTY
};
GType library_photo_source_collection_state_get_type (void) G_GNUC_CONST;
guint file_hash (GFile* file);
static guint _file_hash_gee_hash_data_func (gconstpointer v, gpointer self);
gboolean file_equal (GFile* a, GFile* b);
static gboolean _file_equal_gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self);
gint int64_compare (gint64* a, gint64* b);
static gint _int64_compare_gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self);
static gint64* _int64_dup (gint64* self);
gboolean int64_equal (gint64* a, gint64* b);
static gboolean _int64_equal_gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self);
LibraryPhotoSourceCollection* library_photo_source_collection_new (void);
LibraryPhotoSourceCollection* library_photo_source_collection_construct (GType object_type);
static gint64 _photo_get_photo_key_get_source_database_key (DataSource* source, gpointer self);
MediaSourceCollection* media_source_collection_construct (GType object_type, const gchar* name, GetSourceDatabaseKey source_key_func, void* source_key_func_target);
MediaSourceHoldingTank* media_source_collection_get_trashcan (MediaSourceCollection* self);
static void library_photo_source_collection_on_trashcan_contents_altered (LibraryPhotoSourceCollection* self, GeeCollection* added, GeeCollection* removed);
static void _library_photo_source_collection_on_trashcan_contents_altered_source_holding_tank_contents_altered (SourceHoldingTank* _sender, GeeCollection* added, GeeCollection* removed, gpointer self);
MediaSourceHoldingTank* media_source_collection_get_offline_bin (MediaSourceCollection* self);
static void library_photo_source_collection_on_offline_contents_altered (LibraryPhotoSourceCollection* self, GeeCollection* added, GeeCollection* removed);
static void _library_photo_source_collection_on_offline_contents_altered_source_holding_tank_contents_altered (SourceHoldingTank* _sender, GeeCollection* added, GeeCollection* removed, gpointer self);
static MediaSourceHoldingTank* library_photo_source_collection_real_create_trashcan (MediaSourceCollection* base);
static gboolean library_photo_source_collection_check_if_trashed_photo (LibraryPhotoSourceCollection* self, DataSource* source, Alteration* alteration);
static gboolean _library_photo_source_collection_check_if_trashed_photo_source_holding_tank_check_to_keep (DataSource* source, Alteration* alteration, gpointer self);
LibraryPhotoSourceHoldingTank* library_photo_source_holding_tank_new (LibraryPhotoSourceCollection* sources, SourceHoldingTankCheckToKeep check_to_keep, void* check_to_keep_target, GetSourceDatabaseKey get_key, void* get_key_target);
LibraryPhotoSourceHoldingTank* library_photo_source_holding_tank_construct (GType object_type, LibraryPhotoSourceCollection* sources, SourceHoldingTankCheckToKeep check_to_keep, void* check_to_keep_target, GetSourceDatabaseKey get_key, void* get_key_target);
GType library_photo_source_holding_tank_get_type (void) G_GNUC_CONST;
static MediaSourceHoldingTank* library_photo_source_collection_real_create_offline_bin (MediaSourceCollection* base);
static gboolean library_photo_source_collection_check_if_offline_photo (LibraryPhotoSourceCollection* self, DataSource* source, Alteration* alteration);
static gboolean _library_photo_source_collection_check_if_offline_photo_source_holding_tank_check_to_keep (DataSource* source, Alteration* alteration, gpointer self);
static MediaMonitor* library_photo_source_collection_real_create_media_monitor (MediaSourceCollection* base, Workers* workers, GCancellable* cancellable);
PhotoMonitor* photo_monitor_new (Workers* workers, GCancellable* cancellable);
PhotoMonitor* photo_monitor_construct (GType object_type, Workers* workers, GCancellable* cancellable);
GType photo_monitor_get_type (void) G_GNUC_CONST;
static gboolean library_photo_source_collection_real_holds_type_of_source (SourceCollection* base, DataSource* source);
static gchar* library_photo_source_collection_real_get_typename (MediaSourceCollection* base);
static gboolean library_photo_source_collection_real_is_file_recognized (MediaSourceCollection* base, GFile* file);
static void library_photo_source_collection_real_notify_contents_altered (DataCollection* base, GeeIterable* added, GeeIterable* removed);
static void library_photo_source_collection_on_editable_replaced (LibraryPhotoSourceCollection* self, Photo* photo, GFile* old_file, GFile* new_file);
static void _library_photo_source_collection_on_editable_replaced_photo_editable_replaced (Photo* _sender, GFile* old_file, GFile* new_file, gpointer self);
static void library_photo_source_collection_on_raw_development_modified (LibraryPhotoSourceCollection* self, Photo* _photo);
static void _library_photo_source_collection_on_raw_development_modified_photo_raw_development_modified (Photo* _sender, gpointer self);
void data_collection_notify_contents_altered (DataCollection* self, GeeIterable* added, GeeIterable* removed);
static void library_photo_source_collection_real_items_altered (DataCollection* base, GeeMap* items);
gboolean alteration_has_detail (Alteration* self, const gchar* subject, const gchar* detail);
static void library_photo_source_collection_real_postprocess_imported_media (MediaSourceCollection* base, GeeCollection* media_sources);
GType tag_get_type (void) G_GNUC_CONST;
gpointer hierarchical_tag_index_ref (gpointer instance);
void hierarchical_tag_index_unref (gpointer instance);
GParamSpec* param_spec_hierarchical_tag_index (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_hierarchical_tag_index (GValue* value, gpointer v_object);
void value_take_hierarchical_tag_index (GValue* value, gpointer v_object);
gpointer value_get_hierarchical_tag_index (const GValue* value);
GType hierarchical_tag_index_get_type (void) G_GNUC_CONST;
HierarchicalTagIndex* hierarchical_tag_index_get_global_index (void);
gboolean photo_metadata_has_hierarchical_keywords (PhotoMetadata* self);
HierarchicalTagIndex* hierarchical_tag_utilities_process_hierarchical_import_keywords (GeeCollection* h_keywords);
GeeSet* photo_metadata_get_hierarchical_keywords (PhotoMetadata* self);
GeeCollection* library_photo_get_import_keywords (LibraryPhoto* self);
gboolean hierarchical_tag_index_is_tag_in_index (HierarchicalTagIndex* self, const gchar* tag);
gchar* tag_prep_tag_name (const gchar* name);
gchar* hierarchical_tag_index_get_path_for_name (HierarchicalTagIndex* self, const gchar* name);
Tag* tag_for_path (const gchar* name);
GeeCollection* hierarchical_tag_index_get_all_paths (HierarchicalTagIndex* self);
void library_photo_clear_import_keywords (LibraryPhoto* self);
void tag_attach_many (Tag* self, GeeCollection* sources);
void media_source_collection_postprocess_imported_media (MediaSourceCollection* self, GeeCollection* media);
void library_photo_source_collection_notify_master_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
static void library_photo_source_collection_real_notify_master_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
void library_photo_source_collection_notify_editable_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
static void library_photo_source_collection_real_notify_editable_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
void library_photo_source_collection_notify_source_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
static void library_photo_source_collection_real_notify_source_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
void library_photo_source_collection_notify_baseline_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
static void library_photo_source_collection_real_notify_baseline_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
static MediaSource* library_photo_source_collection_real_fetch_by_numeric_id (MediaSourceCollection* base, gint64 numeric_id);
LibraryPhoto* library_photo_source_collection_fetch (LibraryPhotoSourceCollection* self, PhotoID* photo_id);
gboolean media_source_is_trashed (MediaSource* self);
gboolean media_source_is_offline (MediaSource* self);
static MediaSource* library_photo_source_collection_real_fetch_by_source_id (MediaSourceCollection* base, const gchar* source_id);
MediaSource* media_source_collection_fetch_by_numeric_id (MediaSourceCollection* self, gint64 numeric_id);
gint64 parse_int64 (const gchar* str, gint num_base);
static GeeCollection* library_photo_source_collection_real_get_event_source_ids (MediaSourceCollection* base, EventID* event_id);
GeeArrayList* photo_table_get_event_source_ids (PhotoTable* self, EventID* event_id);
DataSource* database_source_collection_fetch_by_key (DatabaseSourceCollection* self, gint64 key);
LibraryPhoto* library_photo_source_collection_fetch_by_editable_file (LibraryPhotoSourceCollection* self, GFile* file);
LibraryPhoto* library_photo_source_collection_fetch_by_raw_development_file (LibraryPhotoSourceCollection* self, GFile* file);
static void library_photo_source_collection_compare_backing (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, GFileInfo* info, GeeCollection* matches_master, GeeCollection* matches_editable, GeeCollection* matches_development);
gboolean backing_photo_row_matches_file_info (BackingPhotoRow* self, GFileInfo* info);
void library_photo_source_collection_fetch_by_matching_backing (LibraryPhotoSourceCollection* self, GFileInfo* info, GeeCollection* matches_master, GeeCollection* matches_editable, GeeCollection* matched_development);
GeeCollection* media_source_collection_get_offline_bin_contents (MediaSourceCollection* self);
void library_photo_source_collection_get_basename_filesize_duplicate (LibraryPhotoSourceCollection* self, const gchar* basename, gint64 filesize, PhotoID* result);
gint utf8_ci_compare (void* a, void* b);
gboolean library_photo_source_collection_has_basename_filesize_duplicate (LibraryPhotoSourceCollection* self, const gchar* basename, gint64 filesize);
gboolean photo_id_is_valid (PhotoID *self);
LibraryPhoto* library_photo_source_collection_get_trashed_by_file (LibraryPhotoSourceCollection* self, GFile* file);
MediaSource* media_source_holding_tank_fetch_by_master_file (MediaSourceHoldingTank* self, GFile* file);
LibraryPhoto* library_photo_source_holding_tank_fetch_by_backing_file (LibraryPhotoSourceHoldingTank* self, GFile* file);
LibraryPhoto* library_photo_source_collection_get_trashed_by_md5 (LibraryPhotoSourceCollection* self, const gchar* md5);
MediaSource* media_source_holding_tank_fetch_by_md5 (MediaSourceHoldingTank* self, const gchar* md5);
LibraryPhoto* library_photo_source_collection_get_offline_by_file (LibraryPhotoSourceCollection* self, GFile* file);
LibraryPhoto* library_photo_source_collection_get_offline_by_md5 (LibraryPhotoSourceCollection* self, const gchar* md5);
gint library_photo_source_collection_get_offline_count (LibraryPhotoSourceCollection* self);
gint source_holding_tank_get_count (SourceHoldingTank* self);
LibraryPhoto* library_photo_source_collection_get_state_by_file (LibraryPhotoSourceCollection* self, GFile* file, LibraryPhotoSourceCollectionState* state);
MediaSource* media_source_collection_fetch_by_master_file (MediaSourceCollection* self, GFile* file);
static gboolean library_photo_source_collection_real_has_backlink (SourceCollection* base, SourceBacklink* backlink);
gboolean source_collection_has_backlink (SourceCollection* self, SourceBacklink* backlink);
gboolean source_holding_tank_has_backlink (SourceHoldingTank* self, SourceBacklink* backlink);
static void library_photo_source_collection_real_remove_backlink (SourceCollection* base, SourceBacklink* backlink);
void source_holding_tank_remove_backlink (SourceHoldingTank* self, SourceBacklink* backlink);
void source_collection_remove_backlink (SourceCollection* self, SourceBacklink* backlink);
MediaSourceTransactionController* media_source_transaction_controller_new (MediaSourceCollection* sources);
MediaSourceTransactionController* media_source_transaction_controller_construct (GType object_type, MediaSourceCollection* sources);
GType media_source_transaction_controller_get_type (void) G_GNUC_CONST;
static void library_photo_source_collection_real_master_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
static void g_cclosure_user_marshal_VOID__OBJECT_MEDIA_METADATA (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void library_photo_source_collection_real_editable_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
static void library_photo_source_collection_real_baseline_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
static void library_photo_source_collection_real_source_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata);
static void library_photo_source_collection_finalize (DataCollection* obj);
GType flaggable_get_type (void) G_GNUC_CONST;
GType monitorable_get_type (void) G_GNUC_CONST;
#define LIBRARY_PHOTO_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_LIBRARY_PHOTO, LibraryPhotoPrivate))
enum  {
	LIBRARY_PHOTO_DUMMY_PROPERTY
};
#define LIBRARY_PHOTO_FLAG_HIDDEN ((guint64) 0x0000000000000001)
#define LIBRARY_PHOTO_FLAG_FAVORITE ((guint64) 0x0000000000000002)
#define LIBRARY_PHOTO_FLAG_TRASH ((guint64) 0x0000000000000004)
#define LIBRARY_PHOTO_FLAG_OFFLINE ((guint64) 0x0000000000000008)
#define LIBRARY_PHOTO_FLAG_FLAGGED ((guint64) 0x0000000000000010)
static LibraryPhoto* library_photo_new (PhotoRow* row);
static LibraryPhoto* library_photo_construct (GType object_type, PhotoRow* row);
static void library_photo_generate_thumbnails (LibraryPhoto* self);
static void _library_photo_generate_thumbnails_one_shot_callback (gpointer self);
void data_source_rehydrate_backlinks (DataSource* self, SourceCollection* unlinked_from, const gchar* dehydrated);
static void library_photo_upgrade_rating_flags (LibraryPhoto* self, guint64 flags);
static LibraryPhoto* library_photo_new_from_import_params (PhotoImportParams* import_params);
static LibraryPhoto* library_photo_construct_from_import_params (GType object_type, PhotoImportParams* import_params);
void library_photo_init (ProgressMonitor monitor, void* monitor_target);
GeeArrayList* photo_table_get_all (PhotoTable* self);
GeeCollection* data_collection_add_many (DataCollection* self, GeeCollection* objects, ProgressMonitor monitor, void* monitor_target);
void media_source_collection_add_many_to_trash (MediaSourceCollection* self, GeeCollection* sources);
void media_source_collection_add_many_to_offline (MediaSourceCollection* self, GeeCollection* sources);
void library_photo_terminate (void);
ImportResult library_photo_import_create (PhotoImportParams* params, LibraryPhoto** photo);
void photo_table_add (PhotoTable* self, PhotoRow* photo_row, PhotoID* result);
gboolean photo_id_is_invalid (PhotoID *self);
void library_photo_import_failed (LibraryPhoto* photo);
void photo_table_remove (PhotoTable* self, PhotoID* photo_id, GError** error);
static void library_photo_real_notify_master_reimported (Photo* base, PhotoMetadata* metadata);
static void library_photo_real_notify_editable_reimported (Photo* base, PhotoMetadata* metadata);
static void library_photo_real_notify_source_reimported (Photo* base, PhotoMetadata* metadata);
static void library_photo_real_notify_baseline_reimported (Photo* base, PhotoMetadata* metadata);
void thumbnail_cache_import_from_source (ThumbnailSource* source, gboolean force, GError** error);
void thumbnail_source_notify_thumbnail_altered (ThumbnailSource* self);
static void library_photo_real_notify_altered (DataObject* base, Alteration* alteration);
gboolean alteration_has_subject (Alteration* self, const gchar* subject);
void one_shot_scheduler_at_priority_idle (OneShotScheduler* self, gint priority);
static GdkPixbuf* library_photo_real_get_preview_pixbuf (MediaSource* base, Scaling* scaling, GError** error);
GdkPixbuf* thumbnail_source_get_thumbnail (ThumbnailSource* self, gint scale, GError** error);
GType thumbnail_cache_size_get_type (void) G_GNUC_CONST;
GdkPixbuf* scaling_perform_on_pixbuf (Scaling *self, GdkPixbuf* pixbuf, GdkInterpType interp, gboolean scale_up);
static void library_photo_real_rotate (Photo* base, Rotation rotation);
void thumbnail_cache_rotate (ThumbnailSource* source, Rotation rotation, GError** error);
static GdkPixbuf* library_photo_real_get_thumbnail (ThumbnailSource* base, gint scale, GError** error);
GdkPixbuf* thumbnail_cache_fetch (ThumbnailSource* source, gint scale, GError** error);
static void library_photo_duplicate_backing_photo (LibraryPhoto* self, BackingPhotoRow* backing, BackingPhotoID* result, GError** error);
GFile* library_files_duplicate (GFile* src, GFileProgressCallback progress_callback, void* progress_callback_target, gboolean blacklist, GError** error);
static void library_photo_on_duplicate_progress (LibraryPhoto* self, gint64 current, gint64 total);
static void _library_photo_on_duplicate_progress_gfile_progress_callback (gint64 current_num_bytes, gint64 total_num_bytes, gpointer self);
LibraryPhoto* library_photo_duplicate (LibraryPhoto* self, GError** error);
void photo_table_duplicate (PhotoTable* self, PhotoID* photo_id, const gchar* new_filename, BackingPhotoID* editable_id, BackingPhotoID* develop_shotwell, BackingPhotoID* develop_camera_id, BackingPhotoID* develop_embedded_id, PhotoID* result);
PhotoRow* photo_table_get_row (PhotoTable* self, PhotoID* photo_id);
void thumbnail_cache_duplicate (ThumbnailSource* src_source, ThumbnailSource* dest_source);
gboolean data_collection_add (DataCollection* self, DataObject* object);
GType event_source_get_type (void) G_GNUC_CONST;
GType event_get_type (void) G_GNUC_CONST;
Event* media_source_get_event (MediaSource* self);
void event_attach (Event* self, MediaSource* source);
GType container_source_collection_get_type (void) G_GNUC_CONST;
GType tag_source_collection_get_type (void) G_GNUC_CONST;
GeeList* tag_source_collection_fetch_for_source (TagSourceCollection* self, MediaSource* source);
void tag_attach (Tag* self, MediaSource* source);
void spin_event_loop (void);
static gboolean library_photo_real_is_trashed (MediaSource* base);
static void library_photo_real_trash (MediaSource* base);
static void library_photo_real_untrash (MediaSource* base);
static gboolean library_photo_real_is_offline (Monitorable* base);
static void library_photo_real_mark_offline (Monitorable* base);
static void library_photo_real_mark_online (Monitorable* base);
static gboolean library_photo_real_is_flagged (Flaggable* base);
static void library_photo_real_mark_flagged (Flaggable* base);
static void library_photo_real_mark_unflagged (Flaggable* base);
static gboolean library_photo_real_internal_delete_backing (DataSource* base, GError** error);
gboolean media_source_delete_original_file (MediaSource* self);
static void library_photo_real_destroy (DataSource* base);
void thumbnail_cache_remove (ThumbnailSource* source);
void data_source_destroy (DataSource* self);
gboolean library_photo_has_nontrash_duplicate (GFile* file, const gchar* thumbnail_md5, const gchar* full_md5, PhotoFileFormat file_format);
void library_photo_get_nontrash_duplicate (GFile* file, const gchar* thumbnail_md5, const gchar* full_md5, PhotoFileFormat file_format, PhotoID* result);
static gboolean library_photo_real_has_user_generated_metadata (Photo* base);
Rating media_source_get_rating (MediaSource* self);
gchar* data_object_get_name (DataObject* self);
static void library_photo_real_set_user_metadata_for_export (Photo* base, PhotoMetadata* metadata);
void photo_metadata_set_keywords (PhotoMetadata* self, GeeCollection* keywords, PhotoMetadataSetOption option);
void photo_metadata_set_rating (PhotoMetadata* self, Rating rating);
static void library_photo_real_apply_user_metadata_for_reimport (Photo* base, PhotoMetadata* metadata);
gchar* hierarchical_tag_utilities_make_flat_tag_safe (const gchar* in_tag);
gchar* hierarchical_tag_utilities_flat_to_hierarchical (const gchar* name);
gboolean tag_source_collection_exists (TagSourceCollection* self, const gchar* name, gboolean treat_htags_as_root);
static void library_photo_finalize (GObject* obj);
#define LIBRARY_PHOTO_SOURCE_HOLDING_TANK_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_LIBRARY_PHOTO_SOURCE_HOLDING_TANK, LibraryPhotoSourceHoldingTankPrivate))
enum  {
	LIBRARY_PHOTO_SOURCE_HOLDING_TANK_DUMMY_PROPERTY
};
MediaSourceHoldingTank* media_source_holding_tank_new (MediaSourceCollection* sources, SourceHoldingTankCheckToKeep check_to_keep, void* check_to_keep_target, GetSourceDatabaseKey get_key, void* get_key_target);
MediaSourceHoldingTank* media_source_holding_tank_construct (GType object_type, MediaSourceCollection* sources, SourceHoldingTankCheckToKeep check_to_keep, void* check_to_keep_target, GetSourceDatabaseKey get_key, void* get_key_target);
static void library_photo_source_holding_tank_real_notify_contents_altered (SourceHoldingTank* base, GeeCollection* added, GeeCollection* removed);
static void library_photo_source_holding_tank_on_editable_replaced (LibraryPhotoSourceHoldingTank* self, Photo* _photo, GFile* old_file, GFile* new_file);
static void _library_photo_source_holding_tank_on_editable_replaced_photo_editable_replaced (Photo* _sender, GFile* old_file, GFile* new_file, gpointer self);
static void library_photo_source_holding_tank_on_raw_development_modified (LibraryPhotoSourceHoldingTank* self, Photo* _photo);
static void _library_photo_source_holding_tank_on_raw_development_modified_photo_raw_development_modified (Photo* _sender, gpointer self);
void source_holding_tank_notify_contents_altered (SourceHoldingTank* self, GeeCollection* added, GeeCollection* removed);
static void library_photo_source_holding_tank_finalize (SourceHoldingTank* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);

static const gchar* PHOTO_IMAGE_EXTENSIONS[69] = {"jpg", "jpeg", "jpe", "tiff", "tif", "png", "gif", "bmp", "ppm", "pgm", "pbm", "pnm", "thm", "tga", "ilbm", "pcx", "ecw", "img", "sid", "cd5", "fits", "pgf", "cgm", "svg", "odg", "eps", "pdf", "swf", "wmf", "emf", "xps", "pns", "jps", "mpo", "3fr", "arw", "srf", "sr2", "bay", "crw", "cr2", "cap", "iiq", "eip", "dcs", "dcr", "drf", "k25", "kdc", "dng", "erf", "fff", "mef", "mos", "mrw", "nef", "nrw", "orf", "ptx", "pef", "pxn", "r3d", "raf", "raw", "rw2", "rwl", "rwz", "x3f", "srw"};

GType backing_fetch_mode_get_type (void) {
	static volatile gsize backing_fetch_mode_type_id__volatile = 0;
	if (g_once_init_enter (&backing_fetch_mode_type_id__volatile)) {
		static const GEnumValue values[] = {{BACKING_FETCH_MODE_SOURCE, "BACKING_FETCH_MODE_SOURCE", "source"}, {BACKING_FETCH_MODE_BASELINE, "BACKING_FETCH_MODE_BASELINE", "baseline"}, {BACKING_FETCH_MODE_MASTER, "BACKING_FETCH_MODE_MASTER", "master"}, {BACKING_FETCH_MODE_UNMODIFIED, "BACKING_FETCH_MODE_UNMODIFIED", "unmodified"}, {0, NULL, NULL}};
		GType backing_fetch_mode_type_id;
		backing_fetch_mode_type_id = g_enum_register_static ("BackingFetchMode", values);
		g_once_init_leave (&backing_fetch_mode_type_id__volatile, backing_fetch_mode_type_id);
	}
	return backing_fetch_mode_type_id__volatile;
}


static gpointer _g_object_ref0 (gpointer self) {
#line 41 "/home/jens/Source/shotwell/src/Photo.vala"
	return self ? g_object_ref (self) : NULL;
#line 2782 "Photo.c"
}


static gpointer _thumbnails_ref0 (gpointer self) {
#line 48 "/home/jens/Source/shotwell/src/Photo.vala"
	return self ? thumbnails_ref (self) : NULL;
#line 2789 "Photo.c"
}


PhotoImportParams* photo_import_params_construct (GType object_type, GFile* file, GFile* final_associated_file, ImportID* import_id, PhotoFileSnifferOptions sniffer_options, const gchar* exif_md5, const gchar* thumbnail_md5, const gchar* full_md5, Thumbnails* thumbnails) {
	PhotoImportParams* self = NULL;
	GFile* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	GFile* _tmp3_ = NULL;
	ImportID _tmp4_ = {0};
	PhotoFileSnifferOptions _tmp5_ = 0;
	const gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	const gchar* _tmp8_ = NULL;
	gchar* _tmp9_ = NULL;
	const gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	Thumbnails* _tmp12_ = NULL;
	Thumbnails* _tmp13_ = NULL;
#line 38 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_IS_FILE (file), NULL);
#line 38 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail ((final_associated_file == NULL) || G_IS_FILE (final_associated_file), NULL);
#line 38 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (import_id != NULL, NULL);
#line 38 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail ((thumbnails == NULL) || IS_THUMBNAILS (thumbnails), NULL);
#line 38 "/home/jens/Source/shotwell/src/Photo.vala"
	self = (PhotoImportParams*) g_type_create_instance (object_type);
#line 41 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = file;
#line 41 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 41 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->file);
#line 41 "/home/jens/Source/shotwell/src/Photo.vala"
	self->file = _tmp1_;
#line 42 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = final_associated_file;
#line 42 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 42 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->final_associated_file);
#line 42 "/home/jens/Source/shotwell/src/Photo.vala"
	self->final_associated_file = _tmp3_;
#line 43 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = *import_id;
#line 43 "/home/jens/Source/shotwell/src/Photo.vala"
	self->import_id = _tmp4_;
#line 44 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = sniffer_options;
#line 44 "/home/jens/Source/shotwell/src/Photo.vala"
	self->sniffer_options = _tmp5_;
#line 45 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = exif_md5;
#line 45 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = g_strdup (_tmp6_);
#line 45 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (self->exif_md5);
#line 45 "/home/jens/Source/shotwell/src/Photo.vala"
	self->exif_md5 = _tmp7_;
#line 46 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = thumbnail_md5;
#line 46 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = g_strdup (_tmp8_);
#line 46 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (self->thumbnail_md5);
#line 46 "/home/jens/Source/shotwell/src/Photo.vala"
	self->thumbnail_md5 = _tmp9_;
#line 47 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = full_md5;
#line 47 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = g_strdup (_tmp10_);
#line 47 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (self->full_md5);
#line 47 "/home/jens/Source/shotwell/src/Photo.vala"
	self->full_md5 = _tmp11_;
#line 48 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = thumbnails;
#line 48 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = _thumbnails_ref0 (_tmp12_);
#line 48 "/home/jens/Source/shotwell/src/Photo.vala"
	_thumbnails_unref0 (self->thumbnails);
#line 48 "/home/jens/Source/shotwell/src/Photo.vala"
	self->thumbnails = _tmp13_;
#line 38 "/home/jens/Source/shotwell/src/Photo.vala"
	return self;
#line 2877 "Photo.c"
}


PhotoImportParams* photo_import_params_new (GFile* file, GFile* final_associated_file, ImportID* import_id, PhotoFileSnifferOptions sniffer_options, const gchar* exif_md5, const gchar* thumbnail_md5, const gchar* full_md5, Thumbnails* thumbnails) {
#line 38 "/home/jens/Source/shotwell/src/Photo.vala"
	return photo_import_params_construct (TYPE_PHOTO_IMPORT_PARAMS, file, final_associated_file, import_id, sniffer_options, exif_md5, thumbnail_md5, full_md5, thumbnails);
#line 2884 "Photo.c"
}


PhotoImportParams* photo_import_params_construct_create_placeholder (GType object_type, GFile* file, ImportID* import_id) {
	PhotoImportParams* self = NULL;
	GFile* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	ImportID _tmp2_ = {0};
#line 52 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_IS_FILE (file), NULL);
#line 52 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (import_id != NULL, NULL);
#line 52 "/home/jens/Source/shotwell/src/Photo.vala"
	self = (PhotoImportParams*) g_type_create_instance (object_type);
#line 53 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = file;
#line 53 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 53 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->file);
#line 53 "/home/jens/Source/shotwell/src/Photo.vala"
	self->file = _tmp1_;
#line 54 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = *import_id;
#line 54 "/home/jens/Source/shotwell/src/Photo.vala"
	self->import_id = _tmp2_;
#line 55 "/home/jens/Source/shotwell/src/Photo.vala"
	self->sniffer_options = PHOTO_FILE_SNIFFER_OPTIONS_NO_MD5;
#line 56 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (self->exif_md5);
#line 56 "/home/jens/Source/shotwell/src/Photo.vala"
	self->exif_md5 = NULL;
#line 57 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (self->thumbnail_md5);
#line 57 "/home/jens/Source/shotwell/src/Photo.vala"
	self->thumbnail_md5 = NULL;
#line 58 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (self->full_md5);
#line 58 "/home/jens/Source/shotwell/src/Photo.vala"
	self->full_md5 = NULL;
#line 59 "/home/jens/Source/shotwell/src/Photo.vala"
	_thumbnails_unref0 (self->thumbnails);
#line 59 "/home/jens/Source/shotwell/src/Photo.vala"
	self->thumbnails = NULL;
#line 52 "/home/jens/Source/shotwell/src/Photo.vala"
	return self;
#line 2931 "Photo.c"
}


PhotoImportParams* photo_import_params_new_create_placeholder (GFile* file, ImportID* import_id) {
#line 52 "/home/jens/Source/shotwell/src/Photo.vala"
	return photo_import_params_construct_create_placeholder (TYPE_PHOTO_IMPORT_PARAMS, file, import_id);
#line 2938 "Photo.c"
}


static void value_photo_import_params_init (GValue* value) {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	value->data[0].v_pointer = NULL;
#line 2945 "Photo.c"
}


static void value_photo_import_params_free_value (GValue* value) {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	if (value->data[0].v_pointer) {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_import_params_unref (value->data[0].v_pointer);
#line 2954 "Photo.c"
	}
}


static void value_photo_import_params_copy_value (const GValue* src_value, GValue* dest_value) {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	if (src_value->data[0].v_pointer) {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		dest_value->data[0].v_pointer = photo_import_params_ref (src_value->data[0].v_pointer);
#line 2964 "Photo.c"
	} else {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		dest_value->data[0].v_pointer = NULL;
#line 2968 "Photo.c"
	}
}


static gpointer value_photo_import_params_peek_pointer (const GValue* value) {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	return value->data[0].v_pointer;
#line 2976 "Photo.c"
}


static gchar* value_photo_import_params_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	if (collect_values[0].v_pointer) {
#line 2983 "Photo.c"
		PhotoImportParams* object;
		object = collect_values[0].v_pointer;
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		if (object->parent_instance.g_class == NULL) {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 2990 "Photo.c"
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 2994 "Photo.c"
		}
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = photo_import_params_ref (object);
#line 2998 "Photo.c"
	} else {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 3002 "Photo.c"
	}
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	return NULL;
#line 3006 "Photo.c"
}


static gchar* value_photo_import_params_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	PhotoImportParams** object_p;
	object_p = collect_values[0].v_pointer;
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!object_p) {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 3017 "Photo.c"
	}
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!value->data[0].v_pointer) {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = NULL;
#line 3023 "Photo.c"
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = value->data[0].v_pointer;
#line 3027 "Photo.c"
	} else {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = photo_import_params_ref (value->data[0].v_pointer);
#line 3031 "Photo.c"
	}
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	return NULL;
#line 3035 "Photo.c"
}


GParamSpec* param_spec_photo_import_params (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	ParamSpecPhotoImportParams* spec;
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (g_type_is_a (object_type, TYPE_PHOTO_IMPORT_PARAMS), NULL);
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	G_PARAM_SPEC (spec)->value_type = object_type;
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	return G_PARAM_SPEC (spec);
#line 3049 "Photo.c"
}


gpointer value_get_photo_import_params (const GValue* value) {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PHOTO_IMPORT_PARAMS), NULL);
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	return value->data[0].v_pointer;
#line 3058 "Photo.c"
}


void value_set_photo_import_params (GValue* value, gpointer v_object) {
	PhotoImportParams* old;
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PHOTO_IMPORT_PARAMS));
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	old = value->data[0].v_pointer;
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	if (v_object) {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_PHOTO_IMPORT_PARAMS));
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = v_object;
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_import_params_ref (value->data[0].v_pointer);
#line 3078 "Photo.c"
	} else {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 3082 "Photo.c"
	}
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	if (old) {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_import_params_unref (old);
#line 3088 "Photo.c"
	}
}


void value_take_photo_import_params (GValue* value, gpointer v_object) {
	PhotoImportParams* old;
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PHOTO_IMPORT_PARAMS));
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	old = value->data[0].v_pointer;
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	if (v_object) {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_PHOTO_IMPORT_PARAMS));
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = v_object;
#line 3107 "Photo.c"
	} else {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 3111 "Photo.c"
	}
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	if (old) {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_import_params_unref (old);
#line 3117 "Photo.c"
	}
}


static void photo_import_params_class_init (PhotoImportParamsClass * klass) {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_import_params_parent_class = g_type_class_peek_parent (klass);
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoImportParamsClass *) klass)->finalize = photo_import_params_finalize;
#line 3127 "Photo.c"
}


static void photo_import_params_instance_init (PhotoImportParams * self) {
	PhotoRow* _tmp0_ = NULL;
#line 24 "/home/jens/Source/shotwell/src/Photo.vala"
	self->final_associated_file = NULL;
#line 35 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_row_new ();
#line 35 "/home/jens/Source/shotwell/src/Photo.vala"
	self->row = _tmp0_;
#line 36 "/home/jens/Source/shotwell/src/Photo.vala"
	self->keywords = NULL;
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	self->ref_count = 1;
#line 3143 "Photo.c"
}


static void photo_import_params_finalize (PhotoImportParams* obj) {
	PhotoImportParams * self;
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PHOTO_IMPORT_PARAMS, PhotoImportParams);
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_handlers_destroy (self);
#line 23 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->file);
#line 24 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->final_associated_file);
#line 27 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (self->exif_md5);
#line 28 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (self->thumbnail_md5);
#line 29 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (self->full_md5);
#line 32 "/home/jens/Source/shotwell/src/Photo.vala"
	_thumbnails_unref0 (self->thumbnails);
#line 35 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_row_unref0 (self->row);
#line 36 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->keywords);
#line 3169 "Photo.c"
}


GType photo_import_params_get_type (void) {
	static volatile gsize photo_import_params_type_id__volatile = 0;
	if (g_once_init_enter (&photo_import_params_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { value_photo_import_params_init, value_photo_import_params_free_value, value_photo_import_params_copy_value, value_photo_import_params_peek_pointer, "p", value_photo_import_params_collect_value, "p", value_photo_import_params_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (PhotoImportParamsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) photo_import_params_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PhotoImportParams), 0, (GInstanceInitFunc) photo_import_params_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType photo_import_params_type_id;
		photo_import_params_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PhotoImportParams", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&photo_import_params_type_id__volatile, photo_import_params_type_id);
	}
	return photo_import_params_type_id__volatile;
}


gpointer photo_import_params_ref (gpointer instance) {
	PhotoImportParams* self;
	self = instance;
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	g_atomic_int_inc (&self->ref_count);
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	return instance;
#line 3194 "Photo.c"
}


void photo_import_params_unref (gpointer instance) {
	PhotoImportParams* self;
	self = instance;
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		PHOTO_IMPORT_PARAMS_GET_CLASS (self)->finalize (self);
#line 21 "/home/jens/Source/shotwell/src/Photo.vala"
		g_type_free_instance ((GTypeInstance *) self);
#line 3207 "Photo.c"
	}
}


PhotoTransformationState* photo_transformation_state_construct (GType object_type) {
	PhotoTransformationState * self = NULL;
#line 72 "/home/jens/Source/shotwell/src/Photo.vala"
	self = (PhotoTransformationState*) g_object_new (object_type, NULL);
#line 72 "/home/jens/Source/shotwell/src/Photo.vala"
	return self;
#line 3218 "Photo.c"
}


gboolean photo_transformation_state_is_broken (PhotoTransformationState* self) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
#line 75 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO_TRANSFORMATION_STATE (self), FALSE);
#line 76 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = self->priv->is_broke;
#line 76 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 76 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 3233 "Photo.c"
}


static void photo_transformation_state_real_broken (PhotoTransformationState* self) {
#line 69 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->is_broke = TRUE;
#line 3240 "Photo.c"
}


static void photo_transformation_state_class_init (PhotoTransformationStateClass * klass) {
#line 63 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_transformation_state_parent_class = g_type_class_peek_parent (klass);
#line 63 "/home/jens/Source/shotwell/src/Photo.vala"
	g_type_class_add_private (klass, sizeof (PhotoTransformationStatePrivate));
#line 63 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoTransformationStateClass *) klass)->broken = photo_transformation_state_real_broken;
#line 63 "/home/jens/Source/shotwell/src/Photo.vala"
	G_OBJECT_CLASS (klass)->finalize = photo_transformation_state_finalize;
#line 63 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_new ("broken", TYPE_PHOTO_TRANSFORMATION_STATE, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (PhotoTransformationStateClass, broken), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
#line 3255 "Photo.c"
}


static void photo_transformation_state_instance_init (PhotoTransformationState * self) {
#line 63 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv = PHOTO_TRANSFORMATION_STATE_GET_PRIVATE (self);
#line 64 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->is_broke = FALSE;
#line 3264 "Photo.c"
}


static void photo_transformation_state_finalize (GObject* obj) {
	PhotoTransformationState * self;
#line 63 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PHOTO_TRANSFORMATION_STATE, PhotoTransformationState);
#line 63 "/home/jens/Source/shotwell/src/Photo.vala"
	G_OBJECT_CLASS (photo_transformation_state_parent_class)->finalize (obj);
#line 3274 "Photo.c"
}


GType photo_transformation_state_get_type (void) {
	static volatile gsize photo_transformation_state_type_id__volatile = 0;
	if (g_once_init_enter (&photo_transformation_state_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PhotoTransformationStateClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) photo_transformation_state_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PhotoTransformationState), 0, (GInstanceInitFunc) photo_transformation_state_instance_init, NULL };
		GType photo_transformation_state_type_id;
		photo_transformation_state_type_id = g_type_register_static (G_TYPE_OBJECT, "PhotoTransformationState", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
		g_once_init_leave (&photo_transformation_state_type_id__volatile, photo_transformation_state_type_id);
	}
	return photo_transformation_state_type_id__volatile;
}


gboolean rating_can_increase (Rating self) {
	gboolean result = FALSE;
#line 90 "/home/jens/Source/shotwell/src/Photo.vala"
	result = self < RATING_FIVE;
#line 90 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 3296 "Photo.c"
}


gboolean rating_can_decrease (Rating self) {
	gboolean result = FALSE;
#line 94 "/home/jens/Source/shotwell/src/Photo.vala"
	result = self > RATING_REJECTED;
#line 94 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 3306 "Photo.c"
}


gboolean rating_is_valid (Rating self) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
#line 98 "/home/jens/Source/shotwell/src/Photo.vala"
	if (self >= RATING_REJECTED) {
#line 98 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self <= RATING_FIVE;
#line 3317 "Photo.c"
	} else {
#line 98 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = FALSE;
#line 3321 "Photo.c"
	}
#line 98 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 98 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 3327 "Photo.c"
}


Rating rating_increase (Rating self) {
	Rating result = 0;
	Rating _tmp0_ = 0;
	gboolean _tmp1_ = FALSE;
#line 102 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = rating_can_increase (self);
#line 102 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_) {
#line 102 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self + 1;
#line 3341 "Photo.c"
	} else {
#line 102 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self;
#line 3345 "Photo.c"
	}
#line 102 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 102 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 3351 "Photo.c"
}


Rating rating_decrease (Rating self) {
	Rating result = 0;
	Rating _tmp0_ = 0;
	gboolean _tmp1_ = FALSE;
#line 106 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = rating_can_decrease (self);
#line 106 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_) {
#line 106 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self - 1;
#line 3365 "Photo.c"
	} else {
#line 106 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self;
#line 3369 "Photo.c"
	}
#line 106 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 106 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 3375 "Photo.c"
}


gint rating_serialize (Rating self) {
	gint result = 0;
#line 110 "/home/jens/Source/shotwell/src/Photo.vala"
	switch (self) {
#line 110 "/home/jens/Source/shotwell/src/Photo.vala"
		case RATING_REJECTED:
#line 3385 "Photo.c"
		{
#line 112 "/home/jens/Source/shotwell/src/Photo.vala"
			result = -1;
#line 112 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 3391 "Photo.c"
		}
#line 110 "/home/jens/Source/shotwell/src/Photo.vala"
		case RATING_UNRATED:
#line 3395 "Photo.c"
		{
#line 114 "/home/jens/Source/shotwell/src/Photo.vala"
			result = 0;
#line 114 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 3401 "Photo.c"
		}
#line 110 "/home/jens/Source/shotwell/src/Photo.vala"
		case RATING_ONE:
#line 3405 "Photo.c"
		{
#line 116 "/home/jens/Source/shotwell/src/Photo.vala"
			result = 1;
#line 116 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 3411 "Photo.c"
		}
#line 110 "/home/jens/Source/shotwell/src/Photo.vala"
		case RATING_TWO:
#line 3415 "Photo.c"
		{
#line 118 "/home/jens/Source/shotwell/src/Photo.vala"
			result = 2;
#line 118 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 3421 "Photo.c"
		}
#line 110 "/home/jens/Source/shotwell/src/Photo.vala"
		case RATING_THREE:
#line 3425 "Photo.c"
		{
#line 120 "/home/jens/Source/shotwell/src/Photo.vala"
			result = 3;
#line 120 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 3431 "Photo.c"
		}
#line 110 "/home/jens/Source/shotwell/src/Photo.vala"
		case RATING_FOUR:
#line 3435 "Photo.c"
		{
#line 122 "/home/jens/Source/shotwell/src/Photo.vala"
			result = 4;
#line 122 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 3441 "Photo.c"
		}
#line 110 "/home/jens/Source/shotwell/src/Photo.vala"
		case RATING_FIVE:
#line 3445 "Photo.c"
		{
#line 124 "/home/jens/Source/shotwell/src/Photo.vala"
			result = 5;
#line 124 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 3451 "Photo.c"
		}
		default:
		{
#line 126 "/home/jens/Source/shotwell/src/Photo.vala"
			result = 0;
#line 126 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 3459 "Photo.c"
		}
	}
}


Rating rating_unserialize (gint value) {
	Rating result = 0;
	gint _tmp0_ = 0;
	gint _tmp2_ = 0;
#line 131 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = value;
#line 131 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp0_ > ((gint) RATING_FIVE)) {
#line 132 "/home/jens/Source/shotwell/src/Photo.vala"
		result = RATING_FIVE;
#line 132 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 3477 "Photo.c"
	} else {
		gint _tmp1_ = 0;
#line 133 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = value;
#line 133 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp1_ < ((gint) RATING_REJECTED)) {
#line 134 "/home/jens/Source/shotwell/src/Photo.vala"
			result = RATING_REJECTED;
#line 134 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 3488 "Photo.c"
		}
	}
#line 136 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = value;
#line 136 "/home/jens/Source/shotwell/src/Photo.vala"
	switch (_tmp2_) {
#line 136 "/home/jens/Source/shotwell/src/Photo.vala"
		case -1:
#line 3497 "Photo.c"
		{
#line 138 "/home/jens/Source/shotwell/src/Photo.vala"
			result = RATING_REJECTED;
#line 138 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 3503 "Photo.c"
		}
#line 136 "/home/jens/Source/shotwell/src/Photo.vala"
		case 0:
#line 3507 "Photo.c"
		{
#line 140 "/home/jens/Source/shotwell/src/Photo.vala"
			result = RATING_UNRATED;
#line 140 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 3513 "Photo.c"
		}
#line 136 "/home/jens/Source/shotwell/src/Photo.vala"
		case 1:
#line 3517 "Photo.c"
		{
#line 142 "/home/jens/Source/shotwell/src/Photo.vala"
			result = RATING_ONE;
#line 142 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 3523 "Photo.c"
		}
#line 136 "/home/jens/Source/shotwell/src/Photo.vala"
		case 2:
#line 3527 "Photo.c"
		{
#line 144 "/home/jens/Source/shotwell/src/Photo.vala"
			result = RATING_TWO;
#line 144 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 3533 "Photo.c"
		}
#line 136 "/home/jens/Source/shotwell/src/Photo.vala"
		case 3:
#line 3537 "Photo.c"
		{
#line 146 "/home/jens/Source/shotwell/src/Photo.vala"
			result = RATING_THREE;
#line 146 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 3543 "Photo.c"
		}
#line 136 "/home/jens/Source/shotwell/src/Photo.vala"
		case 4:
#line 3547 "Photo.c"
		{
#line 148 "/home/jens/Source/shotwell/src/Photo.vala"
			result = RATING_FOUR;
#line 148 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 3553 "Photo.c"
		}
#line 136 "/home/jens/Source/shotwell/src/Photo.vala"
		case 5:
#line 3557 "Photo.c"
		{
#line 150 "/home/jens/Source/shotwell/src/Photo.vala"
			result = RATING_FIVE;
#line 150 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 3563 "Photo.c"
		}
		default:
		{
#line 152 "/home/jens/Source/shotwell/src/Photo.vala"
			result = RATING_UNRATED;
#line 152 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 3571 "Photo.c"
		}
	}
}


GType rating_get_type (void) {
	static volatile gsize rating_type_id__volatile = 0;
	if (g_once_init_enter (&rating_type_id__volatile)) {
		static const GEnumValue values[] = {{RATING_REJECTED, "RATING_REJECTED", "rejected"}, {RATING_UNRATED, "RATING_UNRATED", "unrated"}, {RATING_ONE, "RATING_ONE", "one"}, {RATING_TWO, "RATING_TWO", "two"}, {RATING_THREE, "RATING_THREE", "three"}, {RATING_FOUR, "RATING_FOUR", "four"}, {RATING_FIVE, "RATING_FIVE", "five"}, {0, NULL, NULL}};
		GType rating_type_id;
		rating_type_id = g_enum_register_static ("Rating", values);
		g_once_init_leave (&rating_type_id__volatile, rating_type_id);
	}
	return rating_type_id__volatile;
}


gboolean photo_exception_prohibits (PhotoException self, PhotoException exception) {
	gboolean result = FALSE;
	PhotoException _tmp0_ = 0;
#line 228 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = exception;
#line 228 "/home/jens/Source/shotwell/src/Photo.vala"
	result = (self & _tmp0_) != 0;
#line 228 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 3598 "Photo.c"
}


gboolean photo_exception_allows (PhotoException self, PhotoException exception) {
	gboolean result = FALSE;
	PhotoException _tmp0_ = 0;
#line 232 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = exception;
#line 232 "/home/jens/Source/shotwell/src/Photo.vala"
	result = (self & _tmp0_) == 0;
#line 232 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 3611 "Photo.c"
}


GType photo_exception_get_type (void) {
	static volatile gsize photo_exception_type_id__volatile = 0;
	if (g_once_init_enter (&photo_exception_type_id__volatile)) {
		static const GEnumValue values[] = {{PHOTO_EXCEPTION_NONE, "PHOTO_EXCEPTION_NONE", "none"}, {PHOTO_EXCEPTION_ORIENTATION, "PHOTO_EXCEPTION_ORIENTATION", "orientation"}, {PHOTO_EXCEPTION_CROP, "PHOTO_EXCEPTION_CROP", "crop"}, {PHOTO_EXCEPTION_REDEYE, "PHOTO_EXCEPTION_REDEYE", "redeye"}, {PHOTO_EXCEPTION_ADJUST, "PHOTO_EXCEPTION_ADJUST", "adjust"}, {PHOTO_EXCEPTION_STRAIGHTEN, "PHOTO_EXCEPTION_STRAIGHTEN", "straighten"}, {PHOTO_EXCEPTION_ALL, "PHOTO_EXCEPTION_ALL", "all"}, {0, NULL, NULL}};
		GType photo_exception_type_id;
		photo_exception_type_id = g_enum_register_static ("PhotoException", values);
		g_once_init_leave (&photo_exception_type_id__volatile, photo_exception_type_id);
	}
	return photo_exception_type_id__volatile;
}


static gpointer _photo_row_ref0 (gpointer self) {
#line 400 "/home/jens/Source/shotwell/src/Photo.vala"
	return self ? photo_row_ref (self) : NULL;
#line 3630 "Photo.c"
}


static gpointer _backing_photo_row_ref0 (gpointer self) {
#line 421 "/home/jens/Source/shotwell/src/Photo.vala"
	return self ? backing_photo_row_ref (self) : NULL;
#line 3637 "Photo.c"
}


Photo* photo_construct (GType object_type, PhotoRow* row) {
	Photo * self = NULL;
	PhotoRow* _tmp0_ = NULL;
	PhotoRow* _tmp1_ = NULL;
	PhotoRow* _tmp2_ = NULL;
	PhotoRow* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	PhotoRow* _tmp6_ = NULL;
	PhotoRow* _tmp7_ = NULL;
	const gchar* _tmp8_ = NULL;
	gchar* _tmp9_ = NULL;
	PhotoBackingReaders* _tmp10_ = NULL;
	PhotoRow* _tmp11_ = NULL;
	BackingPhotoRow* _tmp12_ = NULL;
	PhotoFileFormat _tmp13_ = 0;
	PhotoRow* _tmp14_ = NULL;
	BackingPhotoRow* _tmp15_ = NULL;
	const gchar* _tmp16_ = NULL;
	PhotoFileReader* _tmp17_ = NULL;
	gchar* basename = NULL;
	PhotoRow* _tmp18_ = NULL;
	BackingPhotoRow* _tmp19_ = NULL;
	const gchar* _tmp20_ = NULL;
	gchar* _tmp21_ = NULL;
	const gchar* _tmp22_ = NULL;
	const gchar* _tmp25_ = NULL;
	gboolean _tmp26_ = FALSE;
	PhotoRow* _tmp31_ = NULL;
	BackingPhotoID _tmp32_ = {0};
	gint64 _tmp33_ = 0LL;
	PhotoRow* _tmp49_ = NULL;
	BackingPhotoRow* _tmp50_ = NULL;
	PhotoFileFormat _tmp51_ = 0;
	gboolean _tmp67_ = FALSE;
	PhotoRow* _tmp68_ = NULL;
	BackingPhotoRow* _tmp69_ = NULL;
	PhotoFileFormat _tmp70_ = 0;
	PhotoBackingReaders* _tmp85_ = NULL;
	PhotoFileReader* _tmp86_ = NULL;
	PhotoRow* _tmp106_ = NULL;
	time_t _tmp107_ = 0;
	GError * _inner_error_ = NULL;
#line 399 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO_ROW (row), NULL);
#line 399 "/home/jens/Source/shotwell/src/Photo.vala"
	self = (Photo*) photo_source_construct (object_type, DATA_OBJECT_INVALID_OBJECT_ID);
#line 400 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = row;
#line 400 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _photo_row_ref0 (_tmp0_);
#line 400 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_row_unref0 (self->row);
#line 400 "/home/jens/Source/shotwell/src/Photo.vala"
	self->row = _tmp1_;
#line 403 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = self->row;
#line 403 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = self->row;
#line 403 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = _tmp3_->title;
#line 403 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = media_source_prep_title (_tmp4_);
#line 403 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp2_->title);
#line 403 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_->title = _tmp5_;
#line 404 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = self->row;
#line 404 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = self->row;
#line 404 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = _tmp7_->comment;
#line 404 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = media_source_prep_comment (_tmp8_);
#line 404 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp6_->comment);
#line 404 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_->comment = _tmp9_;
#line 408 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = self->priv->readers;
#line 408 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = row;
#line 408 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = _tmp11_->master;
#line 408 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = _tmp12_->file_format;
#line 408 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = row;
#line 408 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = _tmp14_->master;
#line 408 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_ = _tmp15_->filepath;
#line 408 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = photo_file_format_create_reader (_tmp13_, _tmp16_);
#line 408 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (_tmp10_->master);
#line 408 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_->master = _tmp17_;
#line 411 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp18_ = row;
#line 411 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp19_ = _tmp18_->master;
#line 411 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp20_ = _tmp19_->filepath;
#line 411 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp21_ = string_sliced_at_last_char (_tmp20_, (gunichar) G_DIR_SEPARATOR, 0);
#line 411 "/home/jens/Source/shotwell/src/Photo.vala"
	basename = _tmp21_;
#line 412 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_ = basename;
#line 412 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp22_ != NULL) {
#line 3754 "Photo.c"
		const gchar* _tmp23_ = NULL;
		gchar* _tmp24_ = NULL;
#line 413 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp23_ = basename;
#line 413 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp24_ = string_sliced_at (_tmp23_, 1);
#line 413 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (self->priv->file_title);
#line 413 "/home/jens/Source/shotwell/src/Photo.vala"
		self->priv->file_title = _tmp24_;
#line 3765 "Photo.c"
	}
#line 415 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp25_ = self->priv->file_title;
#line 415 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp26_ = is_string_empty (_tmp25_);
#line 415 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp26_) {
#line 3773 "Photo.c"
		PhotoRow* _tmp27_ = NULL;
		BackingPhotoRow* _tmp28_ = NULL;
		const gchar* _tmp29_ = NULL;
		gchar* _tmp30_ = NULL;
#line 416 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp27_ = row;
#line 416 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp28_ = _tmp27_->master;
#line 416 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp29_ = _tmp28_->filepath;
#line 416 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp30_ = g_strdup (_tmp29_);
#line 416 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (self->priv->file_title);
#line 416 "/home/jens/Source/shotwell/src/Photo.vala"
		self->priv->file_title = _tmp30_;
#line 3790 "Photo.c"
	}
#line 418 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp31_ = row;
#line 418 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp32_ = _tmp31_->editable_id;
#line 418 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp33_ = _tmp32_.id;
#line 418 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp33_ != BACKING_PHOTO_ID_INVALID) {
#line 3800 "Photo.c"
		BackingPhotoRow* e = NULL;
		PhotoRow* _tmp34_ = NULL;
		BackingPhotoID _tmp35_ = {0};
		BackingPhotoRow* _tmp36_ = NULL;
		BackingPhotoRow* _tmp37_ = NULL;
#line 419 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp34_ = row;
#line 419 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp35_ = _tmp34_->editable_id;
#line 419 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp36_ = photo_get_backing_row (self, &_tmp35_);
#line 419 "/home/jens/Source/shotwell/src/Photo.vala"
		e = _tmp36_;
#line 420 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp37_ = e;
#line 420 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp37_ != NULL) {
#line 3818 "Photo.c"
			BackingPhotoRow* _tmp38_ = NULL;
			BackingPhotoRow* _tmp39_ = NULL;
			PhotoBackingReaders* _tmp40_ = NULL;
			BackingPhotoRow* _tmp41_ = NULL;
			PhotoFileFormat _tmp42_ = 0;
			BackingPhotoRow* _tmp43_ = NULL;
			const gchar* _tmp44_ = NULL;
			PhotoFileReader* _tmp45_ = NULL;
#line 421 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp38_ = e;
#line 421 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp39_ = _backing_photo_row_ref0 (_tmp38_);
#line 421 "/home/jens/Source/shotwell/src/Photo.vala"
			_backing_photo_row_unref0 (self->priv->editable);
#line 421 "/home/jens/Source/shotwell/src/Photo.vala"
			self->priv->editable = _tmp39_;
#line 422 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp40_ = self->priv->readers;
#line 422 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp41_ = self->priv->editable;
#line 422 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp42_ = _tmp41_->file_format;
#line 422 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp43_ = self->priv->editable;
#line 422 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp44_ = _tmp43_->filepath;
#line 422 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp45_ = photo_file_format_create_reader (_tmp42_, _tmp44_);
#line 422 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_adapter_unref0 (_tmp40_->editable);
#line 422 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp40_->editable = _tmp45_;
#line 3851 "Photo.c"
		} else {
			{
				PhotoTable* _tmp46_ = NULL;
				PhotoTable* _tmp47_ = NULL;
				PhotoRow* _tmp48_ = NULL;
#line 425 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp46_ = photo_table_get_instance ();
#line 425 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp47_ = _tmp46_;
#line 425 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp48_ = self->row;
#line 425 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_table_detach_editable (_tmp47_, _tmp48_, &_inner_error_);
#line 425 "/home/jens/Source/shotwell/src/Photo.vala"
				_database_table_unref0 (_tmp47_);
#line 425 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 425 "/home/jens/Source/shotwell/src/Photo.vala"
					if (_inner_error_->domain == DATABASE_ERROR) {
#line 3871 "Photo.c"
						goto __catch259_database_error;
					}
#line 425 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (e);
#line 425 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_free0 (basename);
#line 425 "/home/jens/Source/shotwell/src/Photo.vala"
					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 425 "/home/jens/Source/shotwell/src/Photo.vala"
					g_clear_error (&_inner_error_);
#line 425 "/home/jens/Source/shotwell/src/Photo.vala"
					return NULL;
#line 3884 "Photo.c"
				}
			}
			goto __finally259;
			__catch259_database_error:
			{
				GError* err = NULL;
#line 424 "/home/jens/Source/shotwell/src/Photo.vala"
				err = _inner_error_;
#line 424 "/home/jens/Source/shotwell/src/Photo.vala"
				_inner_error_ = NULL;
#line 424 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_error_free0 (err);
#line 3897 "Photo.c"
			}
			__finally259:
#line 424 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 424 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (e);
#line 424 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (basename);
#line 424 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 424 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 424 "/home/jens/Source/shotwell/src/Photo.vala"
				return NULL;
#line 3912 "Photo.c"
			}
#line 432 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_internal_remove_all_transformations (self, FALSE);
#line 3916 "Photo.c"
		}
#line 418 "/home/jens/Source/shotwell/src/Photo.vala"
		_backing_photo_row_unref0 (e);
#line 3920 "Photo.c"
	}
#line 436 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp49_ = row;
#line 436 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp50_ = _tmp49_->master;
#line 436 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp51_ = _tmp50_->file_format;
#line 436 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp51_ == PHOTO_FILE_FORMAT_RAW) {
#line 3930 "Photo.c"
		GeeHashMap* _tmp52_ = NULL;
		gint _tmp53_ = 0;
		RawDeveloper* _tmp54_ = NULL;
#line 438 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp52_ = gee_hash_map_new (TYPE_RAW_DEVELOPER, NULL, NULL, TYPE_BACKING_PHOTO_ROW, (GBoxedCopyFunc) backing_photo_row_ref, (GDestroyNotify) backing_photo_row_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
#line 438 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (self->priv->developments);
#line 438 "/home/jens/Source/shotwell/src/Photo.vala"
		self->priv->developments = _tmp52_;
#line 439 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp54_ = raw_developer_as_array (&_tmp53_);
#line 3942 "Photo.c"
		{
			RawDeveloper* d_collection = NULL;
			gint d_collection_length1 = 0;
			gint _d_collection_size_ = 0;
			gint d_it = 0;
#line 439 "/home/jens/Source/shotwell/src/Photo.vala"
			d_collection = _tmp54_;
#line 439 "/home/jens/Source/shotwell/src/Photo.vala"
			d_collection_length1 = _tmp53_;
#line 439 "/home/jens/Source/shotwell/src/Photo.vala"
			for (d_it = 0; d_it < _tmp53_; d_it = d_it + 1) {
#line 3954 "Photo.c"
				RawDeveloper d = 0;
#line 439 "/home/jens/Source/shotwell/src/Photo.vala"
				d = d_collection[d_it];
#line 3958 "Photo.c"
				{
					BackingPhotoID id = {0};
					PhotoRow* _tmp55_ = NULL;
					BackingPhotoID* _tmp56_ = NULL;
					gint _tmp56__length1 = 0;
					RawDeveloper _tmp57_ = 0;
					BackingPhotoID _tmp58_ = {0};
					BackingPhotoID _tmp59_ = {0};
					gint64 _tmp60_ = 0LL;
#line 440 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp55_ = row;
#line 440 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp56_ = _tmp55_->development_ids;
#line 440 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp56__length1 = _tmp55_->development_ids_length1;
#line 440 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp57_ = d;
#line 440 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp58_ = _tmp56_[_tmp57_];
#line 440 "/home/jens/Source/shotwell/src/Photo.vala"
					id = _tmp58_;
#line 441 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp59_ = id;
#line 441 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp60_ = _tmp59_.id;
#line 441 "/home/jens/Source/shotwell/src/Photo.vala"
					if (_tmp60_ != BACKING_PHOTO_ID_INVALID) {
#line 3986 "Photo.c"
						BackingPhotoRow* bpr = NULL;
						BackingPhotoID _tmp61_ = {0};
						BackingPhotoRow* _tmp62_ = NULL;
						BackingPhotoRow* _tmp63_ = NULL;
#line 442 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp61_ = id;
#line 442 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp62_ = photo_get_backing_row (self, &_tmp61_);
#line 442 "/home/jens/Source/shotwell/src/Photo.vala"
						bpr = _tmp62_;
#line 443 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp63_ = bpr;
#line 443 "/home/jens/Source/shotwell/src/Photo.vala"
						if (_tmp63_ != NULL) {
#line 4001 "Photo.c"
							GeeHashMap* _tmp64_ = NULL;
							RawDeveloper _tmp65_ = 0;
							BackingPhotoRow* _tmp66_ = NULL;
#line 444 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp64_ = self->priv->developments;
#line 444 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp65_ = d;
#line 444 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp66_ = bpr;
#line 444 "/home/jens/Source/shotwell/src/Photo.vala"
							gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp64_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((gintptr) _tmp65_), _tmp66_);
#line 4013 "Photo.c"
						}
#line 441 "/home/jens/Source/shotwell/src/Photo.vala"
						_backing_photo_row_unref0 (bpr);
#line 4017 "Photo.c"
					}
				}
			}
#line 439 "/home/jens/Source/shotwell/src/Photo.vala"
			d_collection = (g_free (d_collection), NULL);
#line 4023 "Photo.c"
		}
	}
#line 450 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp68_ = row;
#line 450 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp69_ = _tmp68_->master;
#line 450 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp70_ = _tmp69_->file_format;
#line 450 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp70_ == PHOTO_FILE_FORMAT_RAW) {
#line 4034 "Photo.c"
		GeeHashMap* _tmp71_ = NULL;
		PhotoRow* _tmp72_ = NULL;
		RawDeveloper _tmp73_ = 0;
		gboolean _tmp74_ = FALSE;
#line 450 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp71_ = self->priv->developments;
#line 450 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp72_ = row;
#line 450 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp73_ = _tmp72_->developer;
#line 450 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp74_ = gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp71_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((gintptr) _tmp73_));
#line 450 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp67_ = _tmp74_;
#line 4049 "Photo.c"
	} else {
#line 450 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp67_ = FALSE;
#line 4053 "Photo.c"
	}
#line 450 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp67_) {
#line 4057 "Photo.c"
		BackingPhotoRow* r = NULL;
		GeeHashMap* _tmp75_ = NULL;
		PhotoRow* _tmp76_ = NULL;
		RawDeveloper _tmp77_ = 0;
		gpointer _tmp78_ = NULL;
		PhotoBackingReaders* _tmp79_ = NULL;
		BackingPhotoRow* _tmp80_ = NULL;
		PhotoFileFormat _tmp81_ = 0;
		BackingPhotoRow* _tmp82_ = NULL;
		const gchar* _tmp83_ = NULL;
		PhotoFileReader* _tmp84_ = NULL;
#line 451 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp75_ = self->priv->developments;
#line 451 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp76_ = row;
#line 451 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp77_ = _tmp76_->developer;
#line 451 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp78_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp75_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((gintptr) _tmp77_));
#line 451 "/home/jens/Source/shotwell/src/Photo.vala"
		r = (BackingPhotoRow*) _tmp78_;
#line 452 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp79_ = self->priv->readers;
#line 452 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp80_ = r;
#line 452 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp81_ = _tmp80_->file_format;
#line 452 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp82_ = r;
#line 452 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp83_ = _tmp82_->filepath;
#line 452 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp84_ = photo_file_format_create_reader (_tmp81_, _tmp83_);
#line 452 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (_tmp79_->developer);
#line 452 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp79_->developer = _tmp84_;
#line 450 "/home/jens/Source/shotwell/src/Photo.vala"
		_backing_photo_row_unref0 (r);
#line 4097 "Photo.c"
	}
#line 456 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp85_ = self->priv->readers;
#line 456 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp86_ = _tmp85_->editable;
#line 456 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp86_ != NULL) {
#line 4105 "Photo.c"
		BackingPhotoRow* _tmp87_ = NULL;
		BackingPhotoRow* _tmp88_ = NULL;
#line 457 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp87_ = self->priv->editable;
#line 457 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp88_ = _backing_photo_row_ref0 (_tmp87_);
#line 457 "/home/jens/Source/shotwell/src/Photo.vala"
		_backing_photo_row_unref0 (self->backing_photo_row);
#line 457 "/home/jens/Source/shotwell/src/Photo.vala"
		self->backing_photo_row = _tmp88_;
#line 4116 "Photo.c"
	} else {
		PhotoRow* _tmp89_ = NULL;
		BackingPhotoRow* _tmp90_ = NULL;
		PhotoFileFormat _tmp91_ = 0;
#line 458 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp89_ = row;
#line 458 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp90_ = _tmp89_->master;
#line 458 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp91_ = _tmp90_->file_format;
#line 458 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp91_ != PHOTO_FILE_FORMAT_RAW) {
#line 4129 "Photo.c"
			PhotoRow* _tmp92_ = NULL;
			BackingPhotoRow* _tmp93_ = NULL;
			BackingPhotoRow* _tmp94_ = NULL;
#line 459 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp92_ = self->row;
#line 459 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp93_ = _tmp92_->master;
#line 459 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp94_ = _backing_photo_row_ref0 (_tmp93_);
#line 459 "/home/jens/Source/shotwell/src/Photo.vala"
			_backing_photo_row_unref0 (self->backing_photo_row);
#line 459 "/home/jens/Source/shotwell/src/Photo.vala"
			self->backing_photo_row = _tmp94_;
#line 4143 "Photo.c"
		} else {
			GeeHashMap* _tmp95_ = NULL;
			PhotoRow* _tmp96_ = NULL;
			RawDeveloper _tmp97_ = 0;
			gboolean _tmp98_ = FALSE;
#line 463 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp95_ = self->priv->developments;
#line 463 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp96_ = row;
#line 463 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp97_ = _tmp96_->developer;
#line 463 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp98_ = gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp95_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((gintptr) _tmp97_));
#line 463 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp98_) {
#line 4159 "Photo.c"
				GeeHashMap* _tmp99_ = NULL;
				PhotoRow* _tmp100_ = NULL;
				RawDeveloper _tmp101_ = 0;
				gpointer _tmp102_ = NULL;
#line 464 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp99_ = self->priv->developments;
#line 464 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp100_ = row;
#line 464 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp101_ = _tmp100_->developer;
#line 464 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp102_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp99_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((gintptr) _tmp101_));
#line 464 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (self->backing_photo_row);
#line 464 "/home/jens/Source/shotwell/src/Photo.vala"
				self->backing_photo_row = (BackingPhotoRow*) _tmp102_;
#line 4176 "Photo.c"
			} else {
				PhotoRow* _tmp103_ = NULL;
				BackingPhotoRow* _tmp104_ = NULL;
				BackingPhotoRow* _tmp105_ = NULL;
#line 467 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp103_ = self->row;
#line 467 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp104_ = _tmp103_->master;
#line 467 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp105_ = _backing_photo_row_ref0 (_tmp104_);
#line 467 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (self->backing_photo_row);
#line 467 "/home/jens/Source/shotwell/src/Photo.vala"
				self->backing_photo_row = _tmp105_;
#line 4191 "Photo.c"
			}
		}
	}
#line 471 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp106_ = self->row;
#line 471 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp107_ = _tmp106_->exposure_time;
#line 471 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->cached_exposure_time = _tmp107_;
#line 399 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (basename);
#line 399 "/home/jens/Source/shotwell/src/Photo.vala"
	return self;
#line 4205 "Photo.c"
}


void photo_init_photo (void) {
	GeeLinkedList* _tmp0_ = NULL;
#line 475 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = gee_linked_list_new (PHOTO_TYPE_CACHED_PIXBUF, (GBoxedCopyFunc) photo_cached_pixbuf_ref, (GDestroyNotify) photo_cached_pixbuf_unref, NULL, NULL, NULL);
#line 475 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (photo_source_pixbuf_cache);
#line 475 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_source_pixbuf_cache = _tmp0_;
#line 4217 "Photo.c"
}


void photo_terminate_photo (void) {
	guint _tmp0_ = 0U;
#line 479 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (photo_source_pixbuf_cache);
#line 479 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_source_pixbuf_cache = NULL;
#line 481 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_discard_source_id;
#line 481 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp0_ != ((guint) 0)) {
#line 4231 "Photo.c"
		guint _tmp1_ = 0U;
#line 482 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = photo_discard_source_id;
#line 482 "/home/jens/Source/shotwell/src/Photo.vala"
		g_source_remove (_tmp1_);
#line 483 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_discard_source_id = (guint) 0;
#line 4239 "Photo.c"
	}
}


static void photo_real_notify_editable_replaced (Photo* self, GFile* old_file, GFile* new_file) {
	GFile* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
#line 487 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((old_file == NULL) || G_IS_FILE (old_file));
#line 487 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((new_file == NULL) || G_IS_FILE (new_file));
#line 488 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = old_file;
#line 488 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = new_file;
#line 488 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_emit_by_name (self, "editable-replaced", _tmp0_, _tmp1_);
#line 4257 "Photo.c"
}


void photo_notify_editable_replaced (Photo* self, GFile* old_file, GFile* new_file) {
#line 487 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 487 "/home/jens/Source/shotwell/src/Photo.vala"
	PHOTO_GET_CLASS (self)->notify_editable_replaced (self, old_file, new_file);
#line 4266 "Photo.c"
}


static void photo_real_notify_raw_development_modified (Photo* self) {
#line 492 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_emit_by_name (self, "raw-development-modified");
#line 4273 "Photo.c"
}


void photo_notify_raw_development_modified (Photo* self) {
#line 491 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 491 "/home/jens/Source/shotwell/src/Photo.vala"
	PHOTO_GET_CLASS (self)->notify_raw_development_modified (self);
#line 4282 "Photo.c"
}


static void photo_real_notify_baseline_replaced (Photo* self) {
#line 496 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_emit_by_name (self, "baseline-replaced");
#line 4289 "Photo.c"
}


void photo_notify_baseline_replaced (Photo* self) {
#line 495 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 495 "/home/jens/Source/shotwell/src/Photo.vala"
	PHOTO_GET_CLASS (self)->notify_baseline_replaced (self);
#line 4298 "Photo.c"
}


static void photo_real_notify_master_reimported (Photo* self, PhotoMetadata* metadata) {
	PhotoMetadata* _tmp0_ = NULL;
#line 499 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 500 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = metadata;
#line 500 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_emit_by_name (self, "master-reimported", _tmp0_);
#line 4310 "Photo.c"
}


void photo_notify_master_reimported (Photo* self, PhotoMetadata* metadata) {
#line 499 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 499 "/home/jens/Source/shotwell/src/Photo.vala"
	PHOTO_GET_CLASS (self)->notify_master_reimported (self, metadata);
#line 4319 "Photo.c"
}


static void photo_real_notify_editable_reimported (Photo* self, PhotoMetadata* metadata) {
	PhotoMetadata* _tmp0_ = NULL;
#line 503 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 504 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = metadata;
#line 504 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_emit_by_name (self, "editable-reimported", _tmp0_);
#line 4331 "Photo.c"
}


void photo_notify_editable_reimported (Photo* self, PhotoMetadata* metadata) {
#line 503 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 503 "/home/jens/Source/shotwell/src/Photo.vala"
	PHOTO_GET_CLASS (self)->notify_editable_reimported (self, metadata);
#line 4340 "Photo.c"
}


static void photo_real_notify_source_reimported (Photo* self, PhotoMetadata* metadata) {
	PhotoMetadata* _tmp0_ = NULL;
#line 507 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 508 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = metadata;
#line 508 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_emit_by_name (self, "source-reimported", _tmp0_);
#line 4352 "Photo.c"
}


void photo_notify_source_reimported (Photo* self, PhotoMetadata* metadata) {
#line 507 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 507 "/home/jens/Source/shotwell/src/Photo.vala"
	PHOTO_GET_CLASS (self)->notify_source_reimported (self, metadata);
#line 4361 "Photo.c"
}


static void photo_real_notify_baseline_reimported (Photo* self, PhotoMetadata* metadata) {
	PhotoMetadata* _tmp0_ = NULL;
#line 511 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 512 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = metadata;
#line 512 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_emit_by_name (self, "baseline-reimported", _tmp0_);
#line 4373 "Photo.c"
}


void photo_notify_baseline_reimported (Photo* self, PhotoMetadata* metadata) {
#line 511 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 511 "/home/jens/Source/shotwell/src/Photo.vala"
	PHOTO_GET_CLASS (self)->notify_baseline_reimported (self, metadata);
#line 4382 "Photo.c"
}


static gboolean photo_real_internal_delete_backing (DataSource* base, GError** error) {
	Photo * self;
	gboolean result = FALSE;
	gboolean ret = FALSE;
	GFile* file = NULL;
	PhotoFileFormat _tmp8_ = 0;
	GFile* _tmp12_ = NULL;
	gboolean _tmp24_ = FALSE;
	gboolean _tmp25_ = FALSE;
	gboolean _tmp26_ = FALSE;
	GError * _inner_error_ = NULL;
#line 515 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 516 "/home/jens/Source/shotwell/src/Photo.vala"
	ret = TRUE;
#line 517 "/home/jens/Source/shotwell/src/Photo.vala"
	file = NULL;
#line 4403 "Photo.c"
	{
		PhotoBackingReaders* _tmp0_ = NULL;
#line 518 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->readers;
#line 518 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_readers);
#line 4410 "Photo.c"
		{
			PhotoBackingReaders* _tmp1_ = NULL;
			PhotoFileReader* _tmp2_ = NULL;
#line 519 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->readers;
#line 519 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->editable;
#line 519 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp2_ != NULL) {
#line 4420 "Photo.c"
				PhotoBackingReaders* _tmp3_ = NULL;
				PhotoFileReader* _tmp4_ = NULL;
				GFile* _tmp5_ = NULL;
#line 520 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->priv->readers;
#line 520 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = _tmp3_->editable;
#line 520 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 520 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (file);
#line 520 "/home/jens/Source/shotwell/src/Photo.vala"
				file = _tmp5_;
#line 4434 "Photo.c"
			}
		}
		__finally260:
		{
			PhotoBackingReaders* _tmp6_ = NULL;
#line 518 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = self->priv->readers;
#line 518 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 4444 "Photo.c"
		}
#line 518 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 4448 "Photo.c"
			gboolean _tmp7_ = FALSE;
#line 518 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 518 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (file);
#line 518 "/home/jens/Source/shotwell/src/Photo.vala"
			return _tmp7_;
#line 4456 "Photo.c"
		}
	}
#line 523 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_detach_editable (self, TRUE, FALSE, TRUE);
#line 525 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = photo_get_master_file_format (self);
#line 525 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp8_ == PHOTO_FILE_FORMAT_RAW) {
#line 4465 "Photo.c"
		gint _tmp9_ = 0;
		RawDeveloper* _tmp10_ = NULL;
#line 526 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp10_ = raw_developer_as_array (&_tmp9_);
#line 4470 "Photo.c"
		{
			RawDeveloper* d_collection = NULL;
			gint d_collection_length1 = 0;
			gint _d_collection_size_ = 0;
			gint d_it = 0;
#line 526 "/home/jens/Source/shotwell/src/Photo.vala"
			d_collection = _tmp10_;
#line 526 "/home/jens/Source/shotwell/src/Photo.vala"
			d_collection_length1 = _tmp9_;
#line 526 "/home/jens/Source/shotwell/src/Photo.vala"
			for (d_it = 0; d_it < _tmp9_; d_it = d_it + 1) {
#line 4482 "Photo.c"
				RawDeveloper d = 0;
#line 526 "/home/jens/Source/shotwell/src/Photo.vala"
				d = d_collection[d_it];
#line 4486 "Photo.c"
				{
					RawDeveloper _tmp11_ = 0;
#line 527 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp11_ = d;
#line 527 "/home/jens/Source/shotwell/src/Photo.vala"
					photo_delete_raw_development (self, _tmp11_);
#line 4493 "Photo.c"
				}
			}
#line 526 "/home/jens/Source/shotwell/src/Photo.vala"
			d_collection = (g_free (d_collection), NULL);
#line 4498 "Photo.c"
		}
	}
#line 531 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = file;
#line 531 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp12_ != NULL) {
#line 4505 "Photo.c"
		{
			gboolean _tmp13_ = FALSE;
			GFile* _tmp14_ = NULL;
			gboolean _tmp15_ = FALSE;
#line 533 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp14_ = file;
#line 533 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp15_ = g_file_trash (_tmp14_, NULL, &_inner_error_);
#line 533 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = _tmp15_;
#line 533 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 4518 "Photo.c"
				goto __catch261_g_error;
			}
#line 533 "/home/jens/Source/shotwell/src/Photo.vala"
			ret = _tmp13_;
#line 4523 "Photo.c"
		}
		goto __finally261;
		__catch261_g_error:
		{
			GError* err = NULL;
			GFile* _tmp16_ = NULL;
			gchar* _tmp17_ = NULL;
			gchar* _tmp18_ = NULL;
			gchar* _tmp19_ = NULL;
			gchar* _tmp20_ = NULL;
			GError* _tmp21_ = NULL;
			const gchar* _tmp22_ = NULL;
#line 532 "/home/jens/Source/shotwell/src/Photo.vala"
			err = _inner_error_;
#line 532 "/home/jens/Source/shotwell/src/Photo.vala"
			_inner_error_ = NULL;
#line 535 "/home/jens/Source/shotwell/src/Photo.vala"
			ret = FALSE;
#line 536 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp16_ = file;
#line 536 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp17_ = g_file_get_path (_tmp16_);
#line 536 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp18_ = _tmp17_;
#line 536 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp19_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 536 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp20_ = _tmp19_;
#line 536 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp21_ = err;
#line 536 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp22_ = _tmp21_->message;
#line 536 "/home/jens/Source/shotwell/src/Photo.vala"
			g_message ("Photo.vala:536: Unable to move editable %s for %s to trash: %s", _tmp18_, _tmp20_, _tmp22_);
#line 536 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (_tmp20_);
#line 536 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (_tmp18_);
#line 532 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_error_free0 (err);
#line 4564 "Photo.c"
		}
		__finally261:
#line 532 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 4569 "Photo.c"
			gboolean _tmp23_ = FALSE;
#line 532 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 532 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (file);
#line 532 "/home/jens/Source/shotwell/src/Photo.vala"
			return _tmp23_;
#line 4577 "Photo.c"
		}
	}
#line 542 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp26_ = DATA_SOURCE_CLASS (photo_parent_class)->internal_delete_backing (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_SOURCE, PhotoSource), TYPE_DATA_SOURCE, DataSource), &_inner_error_);
#line 542 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp25_ = _tmp26_;
#line 542 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 4586 "Photo.c"
		gboolean _tmp27_ = FALSE;
#line 542 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 542 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 542 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp27_;
#line 4594 "Photo.c"
	}
#line 542 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp25_) {
#line 4598 "Photo.c"
		gboolean _tmp28_ = FALSE;
#line 542 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp28_ = ret;
#line 542 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp24_ = _tmp28_;
#line 4604 "Photo.c"
	} else {
#line 542 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp24_ = FALSE;
#line 4608 "Photo.c"
	}
#line 542 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp24_;
#line 542 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (file);
#line 542 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 4616 "Photo.c"
}


static BackingPhotoRow* photo_get_backing_row (Photo* self, BackingPhotoID* id) {
	BackingPhotoRow* result = NULL;
	BackingPhotoID _tmp0_ = {0};
	gint64 _tmp1_ = 0LL;
	BackingPhotoRow* backing_row = NULL;
	BackingPhotoRow* _tmp13_ = NULL;
	GError * _inner_error_ = NULL;
#line 547 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 547 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (id != NULL, NULL);
#line 548 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = *id;
#line 548 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_.id;
#line 548 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_ == BACKING_PHOTO_ID_INVALID) {
#line 549 "/home/jens/Source/shotwell/src/Photo.vala"
		result = NULL;
#line 549 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 4641 "Photo.c"
	}
#line 551 "/home/jens/Source/shotwell/src/Photo.vala"
	backing_row = NULL;
#line 4645 "Photo.c"
	{
		BackingPhotoRow* _tmp2_ = NULL;
		BackingPhotoTable* _tmp3_ = NULL;
		BackingPhotoTable* _tmp4_ = NULL;
		BackingPhotoID _tmp5_ = {0};
		BackingPhotoRow* _tmp6_ = NULL;
		BackingPhotoRow* _tmp7_ = NULL;
		BackingPhotoRow* _tmp8_ = NULL;
#line 553 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = backing_photo_table_get_instance ();
#line 553 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = _tmp3_;
#line 553 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = *id;
#line 553 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = backing_photo_table_fetch (_tmp4_, &_tmp5_, &_inner_error_);
#line 553 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = _tmp6_;
#line 553 "/home/jens/Source/shotwell/src/Photo.vala"
		_database_table_unref0 (_tmp4_);
#line 553 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = _tmp7_;
#line 553 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 553 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_inner_error_->domain == DATABASE_ERROR) {
#line 4672 "Photo.c"
				goto __catch262_database_error;
			}
#line 553 "/home/jens/Source/shotwell/src/Photo.vala"
			_backing_photo_row_unref0 (backing_row);
#line 553 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 553 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 553 "/home/jens/Source/shotwell/src/Photo.vala"
			return NULL;
#line 4683 "Photo.c"
		}
#line 553 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = _tmp2_;
#line 553 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = NULL;
#line 553 "/home/jens/Source/shotwell/src/Photo.vala"
		_backing_photo_row_unref0 (backing_row);
#line 553 "/home/jens/Source/shotwell/src/Photo.vala"
		backing_row = _tmp8_;
#line 552 "/home/jens/Source/shotwell/src/Photo.vala"
		_backing_photo_row_unref0 (_tmp2_);
#line 4695 "Photo.c"
	}
	goto __finally262;
	__catch262_database_error:
	{
		GError* err = NULL;
		gchar* _tmp9_ = NULL;
		gchar* _tmp10_ = NULL;
		GError* _tmp11_ = NULL;
		const gchar* _tmp12_ = NULL;
#line 552 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 552 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 555 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp9_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 555 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp10_ = _tmp9_;
#line 555 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = err;
#line 555 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = _tmp11_->message;
#line 555 "/home/jens/Source/shotwell/src/Photo.vala"
		g_warning ("Photo.vala:555: Unable to fetch backing state for %s: %s", _tmp10_, _tmp12_);
#line 555 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp10_);
#line 552 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 4723 "Photo.c"
	}
	__finally262:
#line 552 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 552 "/home/jens/Source/shotwell/src/Photo.vala"
		_backing_photo_row_unref0 (backing_row);
#line 552 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 552 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 552 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 4736 "Photo.c"
	}
#line 558 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = backing_row;
#line 558 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp13_ == NULL) {
#line 4742 "Photo.c"
		{
			BackingPhotoTable* _tmp14_ = NULL;
			BackingPhotoTable* _tmp15_ = NULL;
			BackingPhotoID _tmp16_ = {0};
#line 560 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp14_ = backing_photo_table_get_instance ();
#line 560 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp15_ = _tmp14_;
#line 560 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp16_ = *id;
#line 560 "/home/jens/Source/shotwell/src/Photo.vala"
			backing_photo_table_remove (_tmp15_, &_tmp16_, &_inner_error_);
#line 560 "/home/jens/Source/shotwell/src/Photo.vala"
			_database_table_unref0 (_tmp15_);
#line 560 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 560 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_inner_error_->domain == DATABASE_ERROR) {
#line 4761 "Photo.c"
					goto __catch263_database_error;
				}
#line 560 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (backing_row);
#line 560 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 560 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 560 "/home/jens/Source/shotwell/src/Photo.vala"
				return NULL;
#line 4772 "Photo.c"
			}
		}
		goto __finally263;
		__catch263_database_error:
		{
			GError* err = NULL;
#line 559 "/home/jens/Source/shotwell/src/Photo.vala"
			err = _inner_error_;
#line 559 "/home/jens/Source/shotwell/src/Photo.vala"
			_inner_error_ = NULL;
#line 559 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_error_free0 (err);
#line 4785 "Photo.c"
		}
		__finally263:
#line 559 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 559 "/home/jens/Source/shotwell/src/Photo.vala"
			_backing_photo_row_unref0 (backing_row);
#line 559 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 559 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 559 "/home/jens/Source/shotwell/src/Photo.vala"
			return NULL;
#line 4798 "Photo.c"
		}
#line 564 "/home/jens/Source/shotwell/src/Photo.vala"
		result = NULL;
#line 564 "/home/jens/Source/shotwell/src/Photo.vala"
		_backing_photo_row_unref0 (backing_row);
#line 564 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 4806 "Photo.c"
	}
#line 567 "/home/jens/Source/shotwell/src/Photo.vala"
	result = backing_row;
#line 567 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 4812 "Photo.c"
}


gboolean photo_is_raw_developer_complete (Photo* self, RawDeveloper d) {
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
#line 572 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 4821 "Photo.c"
	{
		GeeHashMap* _tmp0_ = NULL;
		gboolean _tmp13_ = FALSE;
#line 573 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->developments;
#line 573 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_developments);
#line 4829 "Photo.c"
		{
			gboolean _tmp1_ = FALSE;
			GeeHashMap* _tmp2_ = NULL;
			RawDeveloper _tmp3_ = 0;
			gboolean _tmp4_ = FALSE;
#line 574 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = self->priv->developments;
#line 574 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = d;
#line 574 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((gintptr) _tmp3_));
#line 574 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp4_) {
#line 4843 "Photo.c"
				GeeHashMap* _tmp5_ = NULL;
				RawDeveloper _tmp6_ = 0;
				gpointer _tmp7_ = NULL;
				BackingPhotoRow* _tmp8_ = NULL;
				const gchar* _tmp9_ = NULL;
				gboolean _tmp10_ = FALSE;
#line 575 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = self->priv->developments;
#line 575 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = d;
#line 575 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((gintptr) _tmp6_));
#line 575 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = (BackingPhotoRow*) _tmp7_;
#line 575 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = _tmp8_->filepath;
#line 575 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = g_file_test (_tmp9_, G_FILE_TEST_EXISTS);
#line 575 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = _tmp10_;
#line 575 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (_tmp8_);
#line 4866 "Photo.c"
			} else {
#line 574 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = FALSE;
#line 4870 "Photo.c"
			}
#line 574 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp1_;
#line 4874 "Photo.c"
			{
				GeeHashMap* _tmp11_ = NULL;
#line 573 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = self->priv->developments;
#line 573 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_developments);
#line 4881 "Photo.c"
			}
#line 574 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 4885 "Photo.c"
		}
		__finally264:
		{
			GeeHashMap* _tmp12_ = NULL;
#line 573 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = self->priv->developments;
#line 573 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_developments);
#line 4894 "Photo.c"
		}
#line 573 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 573 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 573 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp13_;
#line 4902 "Photo.c"
	}
}


gboolean photo_is_raw_developer_available (Photo* self, RawDeveloper d) {
	gboolean result = FALSE;
	RawDeveloper _tmp7_ = 0;
	GError * _inner_error_ = NULL;
#line 580 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 4913 "Photo.c"
	{
		GeeHashMap* _tmp0_ = NULL;
#line 581 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->developments;
#line 581 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_developments);
#line 4920 "Photo.c"
		{
			GeeHashMap* _tmp1_ = NULL;
			RawDeveloper _tmp2_ = 0;
			gboolean _tmp3_ = FALSE;
#line 582 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->developments;
#line 582 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = d;
#line 582 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((gintptr) _tmp2_));
#line 582 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp3_) {
#line 583 "/home/jens/Source/shotwell/src/Photo.vala"
				result = TRUE;
#line 4935 "Photo.c"
				{
					GeeHashMap* _tmp4_ = NULL;
#line 581 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp4_ = self->priv->developments;
#line 581 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_developments);
#line 4942 "Photo.c"
				}
#line 583 "/home/jens/Source/shotwell/src/Photo.vala"
				return result;
#line 4946 "Photo.c"
			}
		}
		__finally265:
		{
			GeeHashMap* _tmp5_ = NULL;
#line 581 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->priv->developments;
#line 581 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_developments);
#line 4956 "Photo.c"
		}
#line 581 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 4960 "Photo.c"
			gboolean _tmp6_ = FALSE;
#line 581 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 581 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 581 "/home/jens/Source/shotwell/src/Photo.vala"
			return _tmp6_;
#line 4968 "Photo.c"
		}
	}
#line 586 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = d;
#line 586 "/home/jens/Source/shotwell/src/Photo.vala"
	switch (_tmp7_) {
#line 586 "/home/jens/Source/shotwell/src/Photo.vala"
		case RAW_DEVELOPER_SHOTWELL:
#line 4977 "Photo.c"
		{
#line 588 "/home/jens/Source/shotwell/src/Photo.vala"
			result = TRUE;
#line 588 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 4983 "Photo.c"
		}
#line 586 "/home/jens/Source/shotwell/src/Photo.vala"
		case RAW_DEVELOPER_CAMERA:
#line 4987 "Photo.c"
		{
#line 591 "/home/jens/Source/shotwell/src/Photo.vala"
			result = FALSE;
#line 591 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 4993 "Photo.c"
		}
#line 586 "/home/jens/Source/shotwell/src/Photo.vala"
		case RAW_DEVELOPER_EMBEDDED:
#line 4997 "Photo.c"
		{
			{
				PhotoMetadata* meta = NULL;
				PhotoMetadata* _tmp8_ = NULL;
				guint num_previews = 0U;
				PhotoMetadata* _tmp9_ = NULL;
				guint _tmp10_ = 0U;
				guint _tmp11_ = 0U;
#line 595 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = photo_get_master_metadata (self, &_inner_error_);
#line 595 "/home/jens/Source/shotwell/src/Photo.vala"
				meta = _tmp8_;
#line 595 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5012 "Photo.c"
					goto __catch266_g_error;
				}
#line 596 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = meta;
#line 596 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = photo_metadata_get_preview_count (_tmp9_);
#line 596 "/home/jens/Source/shotwell/src/Photo.vala"
				num_previews = _tmp10_;
#line 598 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = num_previews;
#line 598 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp11_ > ((guint) 0)) {
#line 5025 "Photo.c"
					PhotoPreview* prev = NULL;
					PhotoMetadata* _tmp12_ = NULL;
					guint _tmp13_ = 0U;
					PhotoPreview* _tmp14_ = NULL;
					PhotoPreview* _tmp15_ = NULL;
					Dimensions dims = {0};
					PhotoPreview* _tmp16_ = NULL;
					Dimensions _tmp17_ = {0};
					gint _tmp18_ = 0;
					Dimensions _tmp19_ = {0};
					gint _tmp20_ = 0;
					Dimensions _tmp21_ = {0};
					gint _tmp22_ = 0;
					gint preview_major_axis = 0;
					gint _tmp27_ = 0;
#line 599 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp12_ = meta;
#line 599 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp13_ = num_previews;
#line 599 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp14_ = photo_metadata_get_preview (_tmp12_, _tmp13_ - 1);
#line 599 "/home/jens/Source/shotwell/src/Photo.vala"
					prev = _tmp14_;
#line 602 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp15_ = prev;
#line 602 "/home/jens/Source/shotwell/src/Photo.vala"
					if (_tmp15_ == NULL) {
#line 603 "/home/jens/Source/shotwell/src/Photo.vala"
						result = FALSE;
#line 603 "/home/jens/Source/shotwell/src/Photo.vala"
						_photo_preview_unref0 (prev);
#line 603 "/home/jens/Source/shotwell/src/Photo.vala"
						_media_metadata_unref0 (meta);
#line 603 "/home/jens/Source/shotwell/src/Photo.vala"
						return result;
#line 5061 "Photo.c"
					}
#line 605 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp16_ = prev;
#line 605 "/home/jens/Source/shotwell/src/Photo.vala"
					photo_preview_get_pixel_dimensions (_tmp16_, &_tmp17_);
#line 605 "/home/jens/Source/shotwell/src/Photo.vala"
					dims = _tmp17_;
#line 608 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp19_ = dims;
#line 608 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp20_ = _tmp19_.width;
#line 608 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp21_ = dims;
#line 608 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp22_ = _tmp21_.height;
#line 608 "/home/jens/Source/shotwell/src/Photo.vala"
					if (_tmp20_ > _tmp22_) {
#line 5079 "Photo.c"
						Dimensions _tmp23_ = {0};
						gint _tmp24_ = 0;
#line 608 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp23_ = dims;
#line 608 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp24_ = _tmp23_.width;
#line 608 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp18_ = _tmp24_;
#line 5088 "Photo.c"
					} else {
						Dimensions _tmp25_ = {0};
						gint _tmp26_ = 0;
#line 608 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp25_ = dims;
#line 608 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp26_ = _tmp25_.height;
#line 608 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp18_ = _tmp26_;
#line 5098 "Photo.c"
					}
#line 608 "/home/jens/Source/shotwell/src/Photo.vala"
					preview_major_axis = _tmp18_;
#line 609 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp27_ = preview_major_axis;
#line 609 "/home/jens/Source/shotwell/src/Photo.vala"
					if (_tmp27_ < PHOTO_MIN_EMBEDDED_SIZE) {
#line 610 "/home/jens/Source/shotwell/src/Photo.vala"
						result = FALSE;
#line 610 "/home/jens/Source/shotwell/src/Photo.vala"
						_photo_preview_unref0 (prev);
#line 610 "/home/jens/Source/shotwell/src/Photo.vala"
						_media_metadata_unref0 (meta);
#line 610 "/home/jens/Source/shotwell/src/Photo.vala"
						return result;
#line 5114 "Photo.c"
					}
#line 613 "/home/jens/Source/shotwell/src/Photo.vala"
					result = TRUE;
#line 613 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_preview_unref0 (prev);
#line 613 "/home/jens/Source/shotwell/src/Photo.vala"
					_media_metadata_unref0 (meta);
#line 613 "/home/jens/Source/shotwell/src/Photo.vala"
					return result;
#line 5124 "Photo.c"
				}
#line 617 "/home/jens/Source/shotwell/src/Photo.vala"
				result = FALSE;
#line 617 "/home/jens/Source/shotwell/src/Photo.vala"
				_media_metadata_unref0 (meta);
#line 617 "/home/jens/Source/shotwell/src/Photo.vala"
				return result;
#line 5132 "Photo.c"
			}
			goto __finally266;
			__catch266_g_error:
			{
				GError* e = NULL;
				GError* _tmp28_ = NULL;
				const gchar* _tmp29_ = NULL;
#line 594 "/home/jens/Source/shotwell/src/Photo.vala"
				e = _inner_error_;
#line 594 "/home/jens/Source/shotwell/src/Photo.vala"
				_inner_error_ = NULL;
#line 619 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp28_ = e;
#line 619 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp29_ = _tmp28_->message;
#line 619 "/home/jens/Source/shotwell/src/Photo.vala"
				g_debug ("Photo.vala:619: Error accessing embedded preview. Message: %s", _tmp29_);
#line 594 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_error_free0 (e);
#line 5152 "Photo.c"
			}
			__finally266:
#line 594 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5157 "Photo.c"
				gboolean _tmp30_ = FALSE;
#line 594 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 594 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 594 "/home/jens/Source/shotwell/src/Photo.vala"
				return _tmp30_;
#line 5165 "Photo.c"
			}
#line 621 "/home/jens/Source/shotwell/src/Photo.vala"
			result = FALSE;
#line 621 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 5171 "Photo.c"
		}
		default:
		{
#line 624 "/home/jens/Source/shotwell/src/Photo.vala"
			g_assert_not_reached ();
#line 5177 "Photo.c"
		}
	}
}


void photo_add_backing_photo_for_development (Photo* self, RawDeveloper d, BackingPhotoRow* bpr, GError** error) {
	PhotoRow* _tmp0_ = NULL;
	RawDeveloper _tmp1_ = 0;
	BackingPhotoRow* _tmp2_ = NULL;
	Alteration* _tmp8_ = NULL;
	Alteration* _tmp9_ = NULL;
	GError * _inner_error_ = NULL;
#line 631 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 631 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_BACKING_PHOTO_ROW (bpr));
#line 632 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = self->row;
#line 632 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = d;
#line 632 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = bpr;
#line 632 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_import_developed_backing_photo (_tmp0_, _tmp1_, _tmp2_, &_inner_error_);
#line 632 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 632 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 632 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 5208 "Photo.c"
	}
	{
		GeeHashMap* _tmp3_ = NULL;
#line 633 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = self->priv->developments;
#line 633 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_developments);
#line 5216 "Photo.c"
		{
			GeeHashMap* _tmp4_ = NULL;
			RawDeveloper _tmp5_ = 0;
			BackingPhotoRow* _tmp6_ = NULL;
#line 634 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->priv->developments;
#line 634 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = d;
#line 634 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = bpr;
#line 634 "/home/jens/Source/shotwell/src/Photo.vala"
			gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((gintptr) _tmp5_), _tmp6_);
#line 5229 "Photo.c"
		}
		__finally267:
		{
			GeeHashMap* _tmp7_ = NULL;
#line 633 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = self->priv->developments;
#line 633 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_developments);
#line 5238 "Photo.c"
		}
#line 633 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 633 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 633 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 5246 "Photo.c"
		}
	}
#line 636 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = alteration_new ("image", "developer");
#line 636 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = _tmp8_;
#line 636 "/home/jens/Source/shotwell/src/Photo.vala"
	data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp9_);
#line 636 "/home/jens/Source/shotwell/src/Photo.vala"
	_alteration_unref0 (_tmp9_);
#line 5257 "Photo.c"
}


void photo_import_developed_backing_photo (PhotoRow* row, RawDeveloper d, BackingPhotoRow* bpr, GError** error) {
	GFile* file = NULL;
	BackingPhotoRow* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	GFileInfo* info = NULL;
	GFile* _tmp3_ = NULL;
	GFileInfo* _tmp4_ = NULL;
	GTimeVal timestamp = {0};
	GFileInfo* _tmp5_ = NULL;
	GTimeVal _tmp6_ = {0};
	PhotoFileInterrogator* interrogator = NULL;
	GFile* _tmp7_ = NULL;
	PhotoFileInterrogator* _tmp8_ = NULL;
	PhotoFileInterrogator* _tmp9_ = NULL;
	DetectedPhotoInformation* detected = NULL;
	PhotoFileInterrogator* _tmp10_ = NULL;
	DetectedPhotoInformation* _tmp11_ = NULL;
	gboolean _tmp12_ = FALSE;
	DetectedPhotoInformation* _tmp13_ = NULL;
	BackingPhotoRow* _tmp16_ = NULL;
	DetectedPhotoInformation* _tmp17_ = NULL;
	Dimensions _tmp18_ = {0};
	BackingPhotoRow* _tmp19_ = NULL;
	GFileInfo* _tmp20_ = NULL;
	gint64 _tmp21_ = 0LL;
	BackingPhotoRow* _tmp22_ = NULL;
	GTimeVal _tmp23_ = {0};
	glong _tmp24_ = 0L;
	Orientation _tmp25_ = 0;
	DetectedPhotoInformation* _tmp26_ = NULL;
	PhotoMetadata* _tmp27_ = NULL;
	BackingPhotoRow* _tmp31_ = NULL;
	BackingPhotoTable* _tmp32_ = NULL;
	BackingPhotoTable* _tmp33_ = NULL;
	BackingPhotoRow* _tmp34_ = NULL;
	PhotoTable* _tmp35_ = NULL;
	PhotoTable* _tmp36_ = NULL;
	PhotoRow* _tmp37_ = NULL;
	RawDeveloper _tmp38_ = 0;
	BackingPhotoRow* _tmp39_ = NULL;
	BackingPhotoID _tmp40_ = {0};
	GError * _inner_error_ = NULL;
#line 639 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO_ROW (row));
#line 639 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_BACKING_PHOTO_ROW (bpr));
#line 641 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = bpr;
#line 641 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_->filepath;
#line 641 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = g_file_new_for_path (_tmp1_);
#line 641 "/home/jens/Source/shotwell/src/Photo.vala"
	file = _tmp2_;
#line 642 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = file;
#line 642 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = g_file_query_info (_tmp3_, DIRECTORY_MONITOR_SUPPLIED_ATTRIBUTES, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &_inner_error_);
#line 642 "/home/jens/Source/shotwell/src/Photo.vala"
	info = _tmp4_;
#line 642 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 642 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 642 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 642 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 5330 "Photo.c"
	}
#line 644 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = info;
#line 644 "/home/jens/Source/shotwell/src/Photo.vala"
	g_file_info_get_modification_time (_tmp5_, &_tmp6_);
#line 644 "/home/jens/Source/shotwell/src/Photo.vala"
	timestamp = _tmp6_;
#line 646 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = file;
#line 646 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = photo_file_interrogator_new (_tmp7_, PHOTO_FILE_SNIFFER_OPTIONS_GET_ALL);
#line 646 "/home/jens/Source/shotwell/src/Photo.vala"
	interrogator = _tmp8_;
#line 648 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = interrogator;
#line 648 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_file_interrogator_interrogate (_tmp9_, &_inner_error_);
#line 648 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 648 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 648 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_interrogator_unref0 (interrogator);
#line 648 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 648 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 648 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 5360 "Photo.c"
	}
#line 650 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = interrogator;
#line 650 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = photo_file_interrogator_get_detected_photo_information (_tmp10_);
#line 650 "/home/jens/Source/shotwell/src/Photo.vala"
	detected = _tmp11_;
#line 651 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = detected;
#line 651 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp13_ == NULL) {
#line 651 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = TRUE;
#line 5374 "Photo.c"
	} else {
		PhotoFileInterrogator* _tmp14_ = NULL;
		gboolean _tmp15_ = FALSE;
#line 651 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp14_ = interrogator;
#line 651 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp15_ = photo_file_interrogator_get_is_photo_corrupted (_tmp14_);
#line 651 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = _tmp15_;
#line 5384 "Photo.c"
	}
#line 651 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp12_) {
#line 654 "/home/jens/Source/shotwell/src/Photo.vala"
		_detected_photo_information_unref0 (detected);
#line 654 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_interrogator_unref0 (interrogator);
#line 654 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 654 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 654 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 5398 "Photo.c"
	}
#line 657 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_ = bpr;
#line 657 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = detected;
#line 657 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp18_ = _tmp17_->image_dim;
#line 657 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_->dim = _tmp18_;
#line 658 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp19_ = bpr;
#line 658 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp20_ = info;
#line 658 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp21_ = g_file_info_get_size (_tmp20_);
#line 658 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp19_->filesize = _tmp21_;
#line 659 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_ = bpr;
#line 659 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp23_ = timestamp;
#line 659 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp24_ = _tmp23_.tv_sec;
#line 659 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_->timestamp = (time_t) _tmp24_;
#line 660 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp26_ = detected;
#line 660 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp27_ = _tmp26_->metadata;
#line 660 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp27_ != NULL) {
#line 5430 "Photo.c"
		DetectedPhotoInformation* _tmp28_ = NULL;
		PhotoMetadata* _tmp29_ = NULL;
		Orientation _tmp30_ = 0;
#line 660 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp28_ = detected;
#line 660 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp29_ = _tmp28_->metadata;
#line 660 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp30_ = photo_metadata_get_orientation (_tmp29_);
#line 660 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp25_ = _tmp30_;
#line 5442 "Photo.c"
	} else {
#line 661 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp25_ = ORIENTATION_TOP_LEFT;
#line 5446 "Photo.c"
	}
#line 660 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp31_ = bpr;
#line 660 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp31_->original_orientation = _tmp25_;
#line 664 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp32_ = backing_photo_table_get_instance ();
#line 664 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp33_ = _tmp32_;
#line 664 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp34_ = bpr;
#line 664 "/home/jens/Source/shotwell/src/Photo.vala"
	backing_photo_table_add (_tmp33_, _tmp34_, &_inner_error_);
#line 664 "/home/jens/Source/shotwell/src/Photo.vala"
	_database_table_unref0 (_tmp33_);
#line 664 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 664 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 664 "/home/jens/Source/shotwell/src/Photo.vala"
		_detected_photo_information_unref0 (detected);
#line 664 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_interrogator_unref0 (interrogator);
#line 664 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 664 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 664 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 5476 "Photo.c"
	}
#line 665 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp35_ = photo_table_get_instance ();
#line 665 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp36_ = _tmp35_;
#line 665 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp37_ = row;
#line 665 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp38_ = d;
#line 665 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp39_ = bpr;
#line 665 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp40_ = _tmp39_->id;
#line 665 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_table_update_raw_development (_tmp36_, _tmp37_, _tmp38_, &_tmp40_, &_inner_error_);
#line 665 "/home/jens/Source/shotwell/src/Photo.vala"
	_database_table_unref0 (_tmp36_);
#line 665 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 665 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 665 "/home/jens/Source/shotwell/src/Photo.vala"
		_detected_photo_information_unref0 (detected);
#line 665 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_interrogator_unref0 (interrogator);
#line 665 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 665 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 665 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 5508 "Photo.c"
	}
#line 639 "/home/jens/Source/shotwell/src/Photo.vala"
	_detected_photo_information_unref0 (detected);
#line 639 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_interrogator_unref0 (interrogator);
#line 639 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (info);
#line 639 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (file);
#line 5518 "Photo.c"
}


static void photo_develop_photo (Photo* self, RawDeveloper d) {
	gboolean wrote_img_to_disk = FALSE;
	BackingPhotoRow* bps = NULL;
	RawDeveloper _tmp0_ = 0;
	GError * _inner_error_ = NULL;
#line 670 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 671 "/home/jens/Source/shotwell/src/Photo.vala"
	wrote_img_to_disk = FALSE;
#line 672 "/home/jens/Source/shotwell/src/Photo.vala"
	bps = NULL;
#line 674 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = d;
#line 674 "/home/jens/Source/shotwell/src/Photo.vala"
	switch (_tmp0_) {
#line 674 "/home/jens/Source/shotwell/src/Photo.vala"
		case RAW_DEVELOPER_SHOTWELL:
#line 5539 "Photo.c"
		{
			{
				BackingPhotoRow* _tmp1_ = NULL;
				RawDeveloper _tmp2_ = 0;
				PhotoRow* _tmp3_ = NULL;
				BackingPhotoRow* _tmp4_ = NULL;
				const gchar* _tmp5_ = NULL;
				BackingPhotoRow* _tmp6_ = NULL;
				BackingPhotoRow* _tmp7_ = NULL;
				GdkPixbuf* pix = NULL;
				GdkPixbuf* _tmp14_ = NULL;
				PhotoFileWriter* writer = NULL;
				BackingPhotoRow* _tmp20_ = NULL;
				const gchar* _tmp21_ = NULL;
				PhotoFileWriter* _tmp22_ = NULL;
				PhotoFileWriter* _tmp23_ = NULL;
				GdkPixbuf* _tmp24_ = NULL;
				PhotoMetadata* meta = NULL;
				PhotoMetadata* _tmp25_ = NULL;
				PhotoFileMetadataWriter* mwriter = NULL;
				BackingPhotoRow* _tmp26_ = NULL;
				const gchar* _tmp27_ = NULL;
				PhotoFileMetadataWriter* _tmp28_ = NULL;
				PhotoFileMetadataWriter* _tmp29_ = NULL;
				PhotoMetadata* _tmp30_ = NULL;
#line 678 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp2_ = d;
#line 678 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 678 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = _tmp3_->master;
#line 678 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = _tmp4_->filepath;
#line 678 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = raw_developer_create_backing_row_for_development (_tmp2_, _tmp5_, NULL, &_inner_error_);
#line 678 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = _tmp6_;
#line 678 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5579 "Photo.c"
					goto __catch268_g_error;
				}
#line 678 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = _tmp1_;
#line 678 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = NULL;
#line 678 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (bps);
#line 678 "/home/jens/Source/shotwell/src/Photo.vala"
				bps = _tmp7_;
#line 679 "/home/jens/Source/shotwell/src/Photo.vala"
				pix = NULL;
#line 5592 "Photo.c"
				{
					PhotoBackingReaders* _tmp8_ = NULL;
#line 680 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp8_ = self->priv->readers;
#line 680 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_lock (&self->priv->__lock_readers);
#line 5599 "Photo.c"
					{
						GdkPixbuf* _tmp9_ = NULL;
						Scaling _tmp10_ = {0};
						GdkPixbuf* _tmp11_ = NULL;
						GdkPixbuf* _tmp12_ = NULL;
#line 685 "/home/jens/Source/shotwell/src/Photo.vala"
						scaling_for_original (&_tmp10_);
#line 685 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp11_ = photo_get_master_pixbuf (self, &_tmp10_, FALSE, &_inner_error_);
#line 685 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp9_ = _tmp11_;
#line 685 "/home/jens/Source/shotwell/src/Photo.vala"
						if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5613 "Photo.c"
							goto __finally269;
						}
#line 685 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp12_ = _tmp9_;
#line 685 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp9_ = NULL;
#line 685 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_object_unref0 (pix);
#line 685 "/home/jens/Source/shotwell/src/Photo.vala"
						pix = _tmp12_;
#line 680 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_object_unref0 (_tmp9_);
#line 5626 "Photo.c"
					}
					__finally269:
					{
						PhotoBackingReaders* _tmp13_ = NULL;
#line 680 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp13_ = self->priv->readers;
#line 680 "/home/jens/Source/shotwell/src/Photo.vala"
						g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 5635 "Photo.c"
					}
#line 680 "/home/jens/Source/shotwell/src/Photo.vala"
					if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 680 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_object_unref0 (pix);
#line 680 "/home/jens/Source/shotwell/src/Photo.vala"
						_backing_photo_row_unref0 (_tmp1_);
#line 5643 "Photo.c"
						goto __catch268_g_error;
					}
				}
#line 688 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = pix;
#line 688 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp14_ == NULL) {
#line 689 "/home/jens/Source/shotwell/src/Photo.vala"
					g_debug ("Photo.vala:689: Could not get preview pixbuf");
#line 690 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (pix);
#line 690 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (_tmp1_);
#line 5657 "Photo.c"
					{
						gboolean _tmp15_ = FALSE;
#line 714 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp15_ = wrote_img_to_disk;
#line 714 "/home/jens/Source/shotwell/src/Photo.vala"
						if (_tmp15_) {
#line 5664 "Photo.c"
							{
								RawDeveloper _tmp16_ = 0;
								BackingPhotoRow* _tmp17_ = NULL;
#line 717 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp16_ = d;
#line 717 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp17_ = bps;
#line 717 "/home/jens/Source/shotwell/src/Photo.vala"
								photo_add_backing_photo_for_development (self, _tmp16_, _tmp17_, &_inner_error_);
#line 717 "/home/jens/Source/shotwell/src/Photo.vala"
								if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5676 "Photo.c"
									goto __catch270_g_error;
								}
#line 719 "/home/jens/Source/shotwell/src/Photo.vala"
								photo_notify_raw_development_modified (self);
#line 5681 "Photo.c"
							}
							goto __finally270;
							__catch270_g_error:
							{
								GError* e = NULL;
								GError* _tmp18_ = NULL;
								const gchar* _tmp19_ = NULL;
#line 715 "/home/jens/Source/shotwell/src/Photo.vala"
								e = _inner_error_;
#line 715 "/home/jens/Source/shotwell/src/Photo.vala"
								_inner_error_ = NULL;
#line 721 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp18_ = e;
#line 721 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp19_ = _tmp18_->message;
#line 721 "/home/jens/Source/shotwell/src/Photo.vala"
								g_debug ("Photo.vala:721: Error adding backing photo as development. Message: %s", _tmp19_);
#line 715 "/home/jens/Source/shotwell/src/Photo.vala"
								_g_error_free0 (e);
#line 5701 "Photo.c"
							}
							__finally270:
#line 715 "/home/jens/Source/shotwell/src/Photo.vala"
							if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5706 "Photo.c"
								goto __catch268_g_error;
							}
						}
					}
#line 690 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (bps);
#line 690 "/home/jens/Source/shotwell/src/Photo.vala"
					return;
#line 5715 "Photo.c"
				}
#line 694 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp20_ = bps;
#line 694 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp21_ = _tmp20_->filepath;
#line 694 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp22_ = photo_file_format_create_writer (PHOTO_FILE_FORMAT_JFIF, _tmp21_, &_inner_error_);
#line 694 "/home/jens/Source/shotwell/src/Photo.vala"
				writer = _tmp22_;
#line 694 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 694 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (pix);
#line 694 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (_tmp1_);
#line 5731 "Photo.c"
					goto __catch268_g_error;
				}
#line 695 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp23_ = writer;
#line 695 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp24_ = pix;
#line 695 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_file_writer_write (_tmp23_, _tmp24_, JPEG_QUALITY_HIGH, &_inner_error_);
#line 695 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 695 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_file_adapter_unref0 (writer);
#line 695 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (pix);
#line 695 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (_tmp1_);
#line 5748 "Photo.c"
					goto __catch268_g_error;
				}
#line 703 "/home/jens/Source/shotwell/src/Photo.vala"
				wrote_img_to_disk = TRUE;
#line 708 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp25_ = photo_get_master_metadata (self, &_inner_error_);
#line 708 "/home/jens/Source/shotwell/src/Photo.vala"
				meta = _tmp25_;
#line 708 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 708 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_file_adapter_unref0 (writer);
#line 708 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (pix);
#line 708 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (_tmp1_);
#line 5765 "Photo.c"
					goto __catch268_g_error;
				}
#line 709 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp26_ = bps;
#line 709 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp27_ = _tmp26_->filepath;
#line 709 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp28_ = photo_file_format_create_metadata_writer (PHOTO_FILE_FORMAT_JFIF, _tmp27_, &_inner_error_);
#line 709 "/home/jens/Source/shotwell/src/Photo.vala"
				mwriter = _tmp28_;
#line 709 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 709 "/home/jens/Source/shotwell/src/Photo.vala"
					_media_metadata_unref0 (meta);
#line 709 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_file_adapter_unref0 (writer);
#line 709 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (pix);
#line 709 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (_tmp1_);
#line 5786 "Photo.c"
					goto __catch268_g_error;
				}
#line 710 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp29_ = mwriter;
#line 710 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp30_ = meta;
#line 710 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_file_metadata_writer_write_metadata (_tmp29_, _tmp30_, &_inner_error_);
#line 710 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 710 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_file_adapter_unref0 (mwriter);
#line 710 "/home/jens/Source/shotwell/src/Photo.vala"
					_media_metadata_unref0 (meta);
#line 710 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_file_adapter_unref0 (writer);
#line 710 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (pix);
#line 710 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (_tmp1_);
#line 5807 "Photo.c"
					goto __catch268_g_error;
				}
#line 676 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_file_adapter_unref0 (mwriter);
#line 676 "/home/jens/Source/shotwell/src/Photo.vala"
				_media_metadata_unref0 (meta);
#line 676 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_file_adapter_unref0 (writer);
#line 676 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (pix);
#line 676 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (_tmp1_);
#line 5820 "Photo.c"
			}
			goto __finally268;
			__catch268_g_error:
			{
				GError* err = NULL;
				GError* _tmp31_ = NULL;
				const gchar* _tmp32_ = NULL;
#line 676 "/home/jens/Source/shotwell/src/Photo.vala"
				err = _inner_error_;
#line 676 "/home/jens/Source/shotwell/src/Photo.vala"
				_inner_error_ = NULL;
#line 712 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp31_ = err;
#line 712 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp32_ = _tmp31_->message;
#line 712 "/home/jens/Source/shotwell/src/Photo.vala"
				g_debug ("Photo.vala:712: Error developing photo: %s", _tmp32_);
#line 676 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_error_free0 (err);
#line 5840 "Photo.c"
			}
			__finally268:
			{
				gboolean _tmp33_ = FALSE;
#line 714 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp33_ = wrote_img_to_disk;
#line 714 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp33_) {
#line 5849 "Photo.c"
					{
						RawDeveloper _tmp34_ = 0;
						BackingPhotoRow* _tmp35_ = NULL;
#line 717 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp34_ = d;
#line 717 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp35_ = bps;
#line 717 "/home/jens/Source/shotwell/src/Photo.vala"
						photo_add_backing_photo_for_development (self, _tmp34_, _tmp35_, &_inner_error_);
#line 717 "/home/jens/Source/shotwell/src/Photo.vala"
						if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5861 "Photo.c"
							goto __catch271_g_error;
						}
#line 719 "/home/jens/Source/shotwell/src/Photo.vala"
						photo_notify_raw_development_modified (self);
#line 5866 "Photo.c"
					}
					goto __finally271;
					__catch271_g_error:
					{
						GError* e = NULL;
						GError* _tmp36_ = NULL;
						const gchar* _tmp37_ = NULL;
#line 715 "/home/jens/Source/shotwell/src/Photo.vala"
						e = _inner_error_;
#line 715 "/home/jens/Source/shotwell/src/Photo.vala"
						_inner_error_ = NULL;
#line 721 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp36_ = e;
#line 721 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp37_ = _tmp36_->message;
#line 721 "/home/jens/Source/shotwell/src/Photo.vala"
						g_debug ("Photo.vala:721: Error adding backing photo as development. Message: %s", _tmp37_);
#line 715 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_error_free0 (e);
#line 5886 "Photo.c"
					}
					__finally271:
#line 715 "/home/jens/Source/shotwell/src/Photo.vala"
					if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 715 "/home/jens/Source/shotwell/src/Photo.vala"
						_backing_photo_row_unref0 (bps);
#line 715 "/home/jens/Source/shotwell/src/Photo.vala"
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 715 "/home/jens/Source/shotwell/src/Photo.vala"
						g_clear_error (&_inner_error_);
#line 715 "/home/jens/Source/shotwell/src/Photo.vala"
						return;
#line 5899 "Photo.c"
					}
				}
			}
#line 676 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 676 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (bps);
#line 676 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 676 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 676 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 5913 "Photo.c"
			}
#line 727 "/home/jens/Source/shotwell/src/Photo.vala"
			break;
#line 5917 "Photo.c"
		}
#line 674 "/home/jens/Source/shotwell/src/Photo.vala"
		case RAW_DEVELOPER_CAMERA:
#line 5921 "Photo.c"
		{
#line 731 "/home/jens/Source/shotwell/src/Photo.vala"
			break;
#line 5925 "Photo.c"
		}
#line 674 "/home/jens/Source/shotwell/src/Photo.vala"
		case RAW_DEVELOPER_EMBEDDED:
#line 5929 "Photo.c"
		{
			{
				PhotoMetadata* meta = NULL;
				PhotoMetadata* _tmp38_ = NULL;
				guint c = 0U;
				PhotoMetadata* _tmp39_ = NULL;
				guint _tmp40_ = 0U;
				guint _tmp41_ = 0U;
				PhotoPreview* prev = NULL;
				PhotoMetadata* _tmp47_ = NULL;
				guint _tmp48_ = 0U;
				PhotoPreview* _tmp49_ = NULL;
				PhotoPreview* _tmp50_ = NULL;
				GdkPixbuf* pix = NULL;
				PhotoPreview* _tmp56_ = NULL;
				GdkPixbuf* _tmp57_ = NULL;
				GdkPixbuf* _tmp58_ = NULL;
				BackingPhotoRow* _tmp64_ = NULL;
				RawDeveloper _tmp65_ = 0;
				PhotoRow* _tmp66_ = NULL;
				BackingPhotoRow* _tmp67_ = NULL;
				const gchar* _tmp68_ = NULL;
				BackingPhotoRow* _tmp69_ = NULL;
				BackingPhotoRow* _tmp70_ = NULL;
				PhotoFileWriter* writer = NULL;
				BackingPhotoRow* _tmp71_ = NULL;
				const gchar* _tmp72_ = NULL;
				PhotoFileWriter* _tmp73_ = NULL;
				PhotoFileWriter* _tmp74_ = NULL;
				GdkPixbuf* _tmp75_ = NULL;
				PhotoFileMetadataWriter* mwriter = NULL;
				BackingPhotoRow* _tmp76_ = NULL;
				const gchar* _tmp77_ = NULL;
				PhotoFileMetadataWriter* _tmp78_ = NULL;
				PhotoFileMetadataWriter* _tmp79_ = NULL;
				PhotoMetadata* _tmp80_ = NULL;
#line 736 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp38_ = photo_get_master_metadata (self, &_inner_error_);
#line 736 "/home/jens/Source/shotwell/src/Photo.vala"
				meta = _tmp38_;
#line 736 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5972 "Photo.c"
					goto __catch272_g_error;
				}
#line 737 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp39_ = meta;
#line 737 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp40_ = photo_metadata_get_preview_count (_tmp39_);
#line 737 "/home/jens/Source/shotwell/src/Photo.vala"
				c = _tmp40_;
#line 738 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp41_ = c;
#line 738 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp41_ <= ((guint) 0)) {
#line 739 "/home/jens/Source/shotwell/src/Photo.vala"
					_media_metadata_unref0 (meta);
#line 5987 "Photo.c"
					{
						gboolean _tmp42_ = FALSE;
#line 768 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp42_ = wrote_img_to_disk;
#line 768 "/home/jens/Source/shotwell/src/Photo.vala"
						if (_tmp42_) {
#line 5994 "Photo.c"
							{
								RawDeveloper _tmp43_ = 0;
								BackingPhotoRow* _tmp44_ = NULL;
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp43_ = d;
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp44_ = bps;
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
								photo_add_backing_photo_for_development (self, _tmp43_, _tmp44_, &_inner_error_);
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
								if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 6006 "Photo.c"
									goto __catch273_g_error;
								}
#line 773 "/home/jens/Source/shotwell/src/Photo.vala"
								photo_notify_raw_development_modified (self);
#line 6011 "Photo.c"
							}
							goto __finally273;
							__catch273_g_error:
							{
								GError* e = NULL;
								GError* _tmp45_ = NULL;
								const gchar* _tmp46_ = NULL;
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
								e = _inner_error_;
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
								_inner_error_ = NULL;
#line 775 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp45_ = e;
#line 775 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp46_ = _tmp45_->message;
#line 775 "/home/jens/Source/shotwell/src/Photo.vala"
								g_debug ("Photo.vala:775: Error adding backing photo as development. Message: %s", _tmp46_);
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
								_g_error_free0 (e);
#line 6031 "Photo.c"
							}
							__finally273:
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
							if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 6036 "Photo.c"
								goto __catch272_g_error;
							}
						}
					}
#line 739 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (bps);
#line 739 "/home/jens/Source/shotwell/src/Photo.vala"
					return;
#line 6045 "Photo.c"
				}
#line 740 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp47_ = meta;
#line 740 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp48_ = c;
#line 740 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp49_ = photo_metadata_get_preview (_tmp47_, _tmp48_ - 1);
#line 740 "/home/jens/Source/shotwell/src/Photo.vala"
				prev = _tmp49_;
#line 741 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp50_ = prev;
#line 741 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp50_ == NULL) {
#line 742 "/home/jens/Source/shotwell/src/Photo.vala"
					g_debug ("Photo.vala:742: Could not get preview from metadata");
#line 743 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_preview_unref0 (prev);
#line 743 "/home/jens/Source/shotwell/src/Photo.vala"
					_media_metadata_unref0 (meta);
#line 6065 "Photo.c"
					{
						gboolean _tmp51_ = FALSE;
#line 768 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp51_ = wrote_img_to_disk;
#line 768 "/home/jens/Source/shotwell/src/Photo.vala"
						if (_tmp51_) {
#line 6072 "Photo.c"
							{
								RawDeveloper _tmp52_ = 0;
								BackingPhotoRow* _tmp53_ = NULL;
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp52_ = d;
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp53_ = bps;
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
								photo_add_backing_photo_for_development (self, _tmp52_, _tmp53_, &_inner_error_);
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
								if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 6084 "Photo.c"
									goto __catch274_g_error;
								}
#line 773 "/home/jens/Source/shotwell/src/Photo.vala"
								photo_notify_raw_development_modified (self);
#line 6089 "Photo.c"
							}
							goto __finally274;
							__catch274_g_error:
							{
								GError* e = NULL;
								GError* _tmp54_ = NULL;
								const gchar* _tmp55_ = NULL;
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
								e = _inner_error_;
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
								_inner_error_ = NULL;
#line 775 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp54_ = e;
#line 775 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp55_ = _tmp54_->message;
#line 775 "/home/jens/Source/shotwell/src/Photo.vala"
								g_debug ("Photo.vala:775: Error adding backing photo as development. Message: %s", _tmp55_);
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
								_g_error_free0 (e);
#line 6109 "Photo.c"
							}
							__finally274:
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
							if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 6114 "Photo.c"
								goto __catch272_g_error;
							}
						}
					}
#line 743 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (bps);
#line 743 "/home/jens/Source/shotwell/src/Photo.vala"
					return;
#line 6123 "Photo.c"
				}
#line 746 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp56_ = prev;
#line 746 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp57_ = photo_preview_get_pixbuf (_tmp56_, &_inner_error_);
#line 746 "/home/jens/Source/shotwell/src/Photo.vala"
				pix = _tmp57_;
#line 746 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 746 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_preview_unref0 (prev);
#line 746 "/home/jens/Source/shotwell/src/Photo.vala"
					_media_metadata_unref0 (meta);
#line 6137 "Photo.c"
					goto __catch272_g_error;
				}
#line 747 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp58_ = pix;
#line 747 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp58_ == NULL) {
#line 748 "/home/jens/Source/shotwell/src/Photo.vala"
					g_debug ("Photo.vala:748: Could not get preview pixbuf");
#line 749 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (pix);
#line 749 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_preview_unref0 (prev);
#line 749 "/home/jens/Source/shotwell/src/Photo.vala"
					_media_metadata_unref0 (meta);
#line 6152 "Photo.c"
					{
						gboolean _tmp59_ = FALSE;
#line 768 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp59_ = wrote_img_to_disk;
#line 768 "/home/jens/Source/shotwell/src/Photo.vala"
						if (_tmp59_) {
#line 6159 "Photo.c"
							{
								RawDeveloper _tmp60_ = 0;
								BackingPhotoRow* _tmp61_ = NULL;
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp60_ = d;
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp61_ = bps;
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
								photo_add_backing_photo_for_development (self, _tmp60_, _tmp61_, &_inner_error_);
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
								if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 6171 "Photo.c"
									goto __catch275_g_error;
								}
#line 773 "/home/jens/Source/shotwell/src/Photo.vala"
								photo_notify_raw_development_modified (self);
#line 6176 "Photo.c"
							}
							goto __finally275;
							__catch275_g_error:
							{
								GError* e = NULL;
								GError* _tmp62_ = NULL;
								const gchar* _tmp63_ = NULL;
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
								e = _inner_error_;
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
								_inner_error_ = NULL;
#line 775 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp62_ = e;
#line 775 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp63_ = _tmp62_->message;
#line 775 "/home/jens/Source/shotwell/src/Photo.vala"
								g_debug ("Photo.vala:775: Error adding backing photo as development. Message: %s", _tmp63_);
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
								_g_error_free0 (e);
#line 6196 "Photo.c"
							}
							__finally275:
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
							if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 6201 "Photo.c"
								goto __catch272_g_error;
							}
						}
					}
#line 749 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (bps);
#line 749 "/home/jens/Source/shotwell/src/Photo.vala"
					return;
#line 6210 "Photo.c"
				}
#line 753 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp65_ = d;
#line 753 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp66_ = self->row;
#line 753 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp67_ = _tmp66_->master;
#line 753 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp68_ = _tmp67_->filepath;
#line 753 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp69_ = raw_developer_create_backing_row_for_development (_tmp65_, _tmp68_, NULL, &_inner_error_);
#line 753 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp64_ = _tmp69_;
#line 753 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 753 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (pix);
#line 753 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_preview_unref0 (prev);
#line 753 "/home/jens/Source/shotwell/src/Photo.vala"
					_media_metadata_unref0 (meta);
#line 6232 "Photo.c"
					goto __catch272_g_error;
				}
#line 753 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp70_ = _tmp64_;
#line 753 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp64_ = NULL;
#line 753 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (bps);
#line 753 "/home/jens/Source/shotwell/src/Photo.vala"
				bps = _tmp70_;
#line 754 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp71_ = bps;
#line 754 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp72_ = _tmp71_->filepath;
#line 754 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp73_ = photo_file_format_create_writer (PHOTO_FILE_FORMAT_JFIF, _tmp72_, &_inner_error_);
#line 754 "/home/jens/Source/shotwell/src/Photo.vala"
				writer = _tmp73_;
#line 754 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 754 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (_tmp64_);
#line 754 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (pix);
#line 754 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_preview_unref0 (prev);
#line 754 "/home/jens/Source/shotwell/src/Photo.vala"
					_media_metadata_unref0 (meta);
#line 6261 "Photo.c"
					goto __catch272_g_error;
				}
#line 755 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp74_ = writer;
#line 755 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp75_ = pix;
#line 755 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_file_writer_write (_tmp74_, _tmp75_, JPEG_QUALITY_HIGH, &_inner_error_);
#line 755 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 755 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_file_adapter_unref0 (writer);
#line 755 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (_tmp64_);
#line 755 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (pix);
#line 755 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_preview_unref0 (prev);
#line 755 "/home/jens/Source/shotwell/src/Photo.vala"
					_media_metadata_unref0 (meta);
#line 6282 "Photo.c"
					goto __catch272_g_error;
				}
#line 759 "/home/jens/Source/shotwell/src/Photo.vala"
				wrote_img_to_disk = TRUE;
#line 762 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp76_ = bps;
#line 762 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp77_ = _tmp76_->filepath;
#line 762 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp78_ = photo_file_format_create_metadata_writer (PHOTO_FILE_FORMAT_JFIF, _tmp77_, &_inner_error_);
#line 762 "/home/jens/Source/shotwell/src/Photo.vala"
				mwriter = _tmp78_;
#line 762 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 762 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_file_adapter_unref0 (writer);
#line 762 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (_tmp64_);
#line 762 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (pix);
#line 762 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_preview_unref0 (prev);
#line 762 "/home/jens/Source/shotwell/src/Photo.vala"
					_media_metadata_unref0 (meta);
#line 6307 "Photo.c"
					goto __catch272_g_error;
				}
#line 763 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp79_ = mwriter;
#line 763 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp80_ = meta;
#line 763 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_file_metadata_writer_write_metadata (_tmp79_, _tmp80_, &_inner_error_);
#line 763 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 763 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_file_adapter_unref0 (mwriter);
#line 763 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_file_adapter_unref0 (writer);
#line 763 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (_tmp64_);
#line 763 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (pix);
#line 763 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_preview_unref0 (prev);
#line 763 "/home/jens/Source/shotwell/src/Photo.vala"
					_media_metadata_unref0 (meta);
#line 6330 "Photo.c"
					goto __catch272_g_error;
				}
#line 734 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_file_adapter_unref0 (mwriter);
#line 734 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_file_adapter_unref0 (writer);
#line 734 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (_tmp64_);
#line 734 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (pix);
#line 734 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_preview_unref0 (prev);
#line 734 "/home/jens/Source/shotwell/src/Photo.vala"
				_media_metadata_unref0 (meta);
#line 6345 "Photo.c"
			}
			goto __finally272;
			__catch272_g_error:
			{
				GError* e = NULL;
				GError* _tmp81_ = NULL;
				const gchar* _tmp82_ = NULL;
#line 734 "/home/jens/Source/shotwell/src/Photo.vala"
				e = _inner_error_;
#line 734 "/home/jens/Source/shotwell/src/Photo.vala"
				_inner_error_ = NULL;
#line 765 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp81_ = e;
#line 765 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp82_ = _tmp81_->message;
#line 765 "/home/jens/Source/shotwell/src/Photo.vala"
				g_debug ("Photo.vala:765: Error accessing embedded preview. Message: %s", _tmp82_);
#line 766 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_error_free0 (e);
#line 6365 "Photo.c"
				{
					gboolean _tmp83_ = FALSE;
#line 768 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp83_ = wrote_img_to_disk;
#line 768 "/home/jens/Source/shotwell/src/Photo.vala"
					if (_tmp83_) {
#line 6372 "Photo.c"
						{
							RawDeveloper _tmp84_ = 0;
							BackingPhotoRow* _tmp85_ = NULL;
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp84_ = d;
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp85_ = bps;
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
							photo_add_backing_photo_for_development (self, _tmp84_, _tmp85_, &_inner_error_);
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
							if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 6384 "Photo.c"
								goto __catch276_g_error;
							}
#line 773 "/home/jens/Source/shotwell/src/Photo.vala"
							photo_notify_raw_development_modified (self);
#line 6389 "Photo.c"
						}
						goto __finally276;
						__catch276_g_error:
						{
							GError* e = NULL;
							GError* _tmp86_ = NULL;
							const gchar* _tmp87_ = NULL;
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
							e = _inner_error_;
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
							_inner_error_ = NULL;
#line 775 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp86_ = e;
#line 775 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp87_ = _tmp86_->message;
#line 775 "/home/jens/Source/shotwell/src/Photo.vala"
							g_debug ("Photo.vala:775: Error adding backing photo as development. Message: %s", _tmp87_);
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_error_free0 (e);
#line 6409 "Photo.c"
						}
						__finally276:
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
						if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
							_backing_photo_row_unref0 (bps);
#line 6416 "Photo.c"
						}
					}
				}
#line 766 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (bps);
#line 766 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 6424 "Photo.c"
			}
			__finally272:
			{
				gboolean _tmp88_ = FALSE;
#line 768 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp88_ = wrote_img_to_disk;
#line 768 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp88_) {
#line 6433 "Photo.c"
					{
						RawDeveloper _tmp89_ = 0;
						BackingPhotoRow* _tmp90_ = NULL;
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp89_ = d;
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp90_ = bps;
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
						photo_add_backing_photo_for_development (self, _tmp89_, _tmp90_, &_inner_error_);
#line 771 "/home/jens/Source/shotwell/src/Photo.vala"
						if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 6445 "Photo.c"
							goto __catch277_g_error;
						}
#line 773 "/home/jens/Source/shotwell/src/Photo.vala"
						photo_notify_raw_development_modified (self);
#line 6450 "Photo.c"
					}
					goto __finally277;
					__catch277_g_error:
					{
						GError* e = NULL;
						GError* _tmp91_ = NULL;
						const gchar* _tmp92_ = NULL;
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
						e = _inner_error_;
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
						_inner_error_ = NULL;
#line 775 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp91_ = e;
#line 775 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp92_ = _tmp91_->message;
#line 775 "/home/jens/Source/shotwell/src/Photo.vala"
						g_debug ("Photo.vala:775: Error adding backing photo as development. Message: %s", _tmp92_);
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_error_free0 (e);
#line 6470 "Photo.c"
					}
					__finally277:
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
					if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
						_backing_photo_row_unref0 (bps);
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
						g_clear_error (&_inner_error_);
#line 769 "/home/jens/Source/shotwell/src/Photo.vala"
						return;
#line 6483 "Photo.c"
					}
				}
			}
#line 734 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 734 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (bps);
#line 734 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 734 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 734 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 6497 "Photo.c"
			}
#line 780 "/home/jens/Source/shotwell/src/Photo.vala"
			break;
#line 6501 "Photo.c"
		}
		default:
		{
#line 783 "/home/jens/Source/shotwell/src/Photo.vala"
			g_assert_not_reached ();
#line 6507 "Photo.c"
		}
	}
#line 670 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (bps);
#line 6512 "Photo.c"
}


void photo_set_default_raw_developer (Photo* self, RawDeveloper d) {
	GError * _inner_error_ = NULL;
#line 788 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 6520 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 789 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 789 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 6527 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			RawDeveloper _tmp2_ = 0;
#line 790 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 790 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = d;
#line 790 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_->developer = _tmp2_;
#line 6537 "Photo.c"
		}
		__finally278:
		{
			PhotoRow* _tmp3_ = NULL;
#line 789 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = self->row;
#line 789 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 6546 "Photo.c"
		}
#line 789 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 789 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 789 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 789 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 6556 "Photo.c"
		}
	}
}


void photo_set_raw_developer (Photo* self, RawDeveloper d) {
	PhotoFileFormat _tmp0_ = 0;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp4_ = FALSE;
	Alteration* _tmp48_ = NULL;
	Alteration* _tmp49_ = NULL;
	GError * _inner_error_ = NULL;
#line 795 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 796 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_master_file_format (self);
#line 796 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp0_ != PHOTO_FILE_FORMAT_RAW) {
#line 797 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 6578 "Photo.c"
	}
#line 802 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_is_raw_developer_available (self, RAW_DEVELOPER_CAMERA);
#line 802 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp2_) {
#line 6584 "Photo.c"
		RawDeveloper _tmp3_ = 0;
#line 802 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = d;
#line 802 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = _tmp3_ == RAW_DEVELOPER_EMBEDDED;
#line 6590 "Photo.c"
	} else {
#line 802 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = FALSE;
#line 6594 "Photo.c"
	}
#line 802 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_) {
#line 803 "/home/jens/Source/shotwell/src/Photo.vala"
		d = RAW_DEVELOPER_CAMERA;
#line 6600 "Photo.c"
	}
#line 807 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = photo_is_raw_developer_available (self, RAW_DEVELOPER_EMBEDDED);
#line 807 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp4_) {
#line 808 "/home/jens/Source/shotwell/src/Photo.vala"
		d = RAW_DEVELOPER_SHOTWELL;
#line 6608 "Photo.c"
	}
	{
		GeeHashMap* _tmp5_ = NULL;
#line 810 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = self->priv->developments;
#line 810 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_developments);
#line 6616 "Photo.c"
		{
			RawDeveloper stale_raw_developer = 0;
			PhotoRow* _tmp6_ = NULL;
			RawDeveloper _tmp7_ = 0;
			RawDeveloper _tmp8_ = 0;
			gboolean _tmp9_ = FALSE;
			GeeHashMap* _tmp11_ = NULL;
			RawDeveloper _tmp12_ = 0;
			gboolean _tmp13_ = FALSE;
			PhotoRow* _tmp15_ = NULL;
			RawDeveloper _tmp16_ = 0;
			GeeHashMap* _tmp17_ = NULL;
			RawDeveloper _tmp18_ = 0;
			gpointer _tmp19_ = NULL;
			PhotoBackingReaders* _tmp20_ = NULL;
			BackingPhotoRow* _tmp21_ = NULL;
			PhotoFileFormat _tmp22_ = 0;
			BackingPhotoRow* _tmp23_ = NULL;
			const gchar* _tmp24_ = NULL;
			PhotoFileReader* _tmp25_ = NULL;
			BackingPhotoRow* _tmp30_ = NULL;
			Orientation _tmp31_ = 0;
			gboolean _tmp41_ = FALSE;
			RawDeveloper _tmp42_ = 0;
#line 811 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = self->row;
#line 811 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = _tmp6_->developer;
#line 811 "/home/jens/Source/shotwell/src/Photo.vala"
			stale_raw_developer = _tmp7_;
#line 814 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = d;
#line 814 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = photo_is_raw_developer_complete (self, _tmp8_);
#line 814 "/home/jens/Source/shotwell/src/Photo.vala"
			if (!_tmp9_) {
#line 6653 "Photo.c"
				RawDeveloper _tmp10_ = 0;
#line 815 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = d;
#line 815 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_develop_photo (self, _tmp10_);
#line 6659 "Photo.c"
			}
#line 817 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = self->priv->developments;
#line 817 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = d;
#line 817 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((gintptr) _tmp12_));
#line 817 "/home/jens/Source/shotwell/src/Photo.vala"
			if (!_tmp13_) {
#line 6669 "Photo.c"
				{
					GeeHashMap* _tmp14_ = NULL;
#line 810 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp14_ = self->priv->developments;
#line 810 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_developments);
#line 6676 "Photo.c"
				}
#line 818 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 6680 "Photo.c"
			}
#line 821 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_revert_to_master (self, FALSE);
#line 824 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp15_ = self->row;
#line 824 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp16_ = d;
#line 824 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp15_->developer = _tmp16_;
#line 825 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp17_ = self->priv->developments;
#line 825 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp18_ = d;
#line 825 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp19_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((gintptr) _tmp18_));
#line 825 "/home/jens/Source/shotwell/src/Photo.vala"
			_backing_photo_row_unref0 (self->backing_photo_row);
#line 825 "/home/jens/Source/shotwell/src/Photo.vala"
			self->backing_photo_row = (BackingPhotoRow*) _tmp19_;
#line 826 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp20_ = self->priv->readers;
#line 826 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp21_ = self->backing_photo_row;
#line 826 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp22_ = _tmp21_->file_format;
#line 826 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp23_ = self->backing_photo_row;
#line 826 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp24_ = _tmp23_->filepath;
#line 826 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp25_ = photo_file_format_create_reader (_tmp22_, _tmp24_);
#line 826 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_adapter_unref0 (_tmp20_->developer);
#line 826 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp20_->developer = _tmp25_;
#line 6716 "Photo.c"
			{
				GdkPixbuf* _tmp26_ = NULL;
				GdkPixbuf* _tmp27_ = NULL;
#line 829 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp26_ = photo_get_prefetched_copy (self, &_inner_error_);
#line 829 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp27_ = _tmp26_;
#line 829 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (_tmp27_);
#line 829 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 6728 "Photo.c"
					goto __catch280_g_error;
				}
			}
			goto __finally280;
			__catch280_g_error:
			{
				GError* e = NULL;
#line 828 "/home/jens/Source/shotwell/src/Photo.vala"
				e = _inner_error_;
#line 828 "/home/jens/Source/shotwell/src/Photo.vala"
				_inner_error_ = NULL;
#line 832 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_error_free0 (e);
#line 6742 "Photo.c"
				{
					GeeHashMap* _tmp28_ = NULL;
#line 810 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp28_ = self->priv->developments;
#line 810 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_developments);
#line 6749 "Photo.c"
				}
#line 832 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 6753 "Photo.c"
			}
			__finally280:
#line 828 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 6758 "Photo.c"
				{
					GeeHashMap* _tmp29_ = NULL;
#line 810 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp29_ = self->priv->developments;
#line 810 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_developments);
#line 6765 "Photo.c"
				}
#line 828 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 828 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 828 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 6773 "Photo.c"
			}
#line 835 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp30_ = self->backing_photo_row;
#line 835 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp31_ = _tmp30_->original_orientation;
#line 835 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_set_orientation (self, _tmp31_);
#line 6781 "Photo.c"
			{
				PhotoTable* _tmp32_ = NULL;
				PhotoTable* _tmp33_ = NULL;
				PhotoRow* _tmp34_ = NULL;
				RawDeveloper _tmp35_ = 0;
				BackingPhotoRow* _tmp36_ = NULL;
				BackingPhotoID _tmp37_ = {0};
#line 838 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp32_ = photo_table_get_instance ();
#line 838 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp33_ = _tmp32_;
#line 838 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp34_ = self->row;
#line 838 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp35_ = d;
#line 838 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp36_ = self->backing_photo_row;
#line 838 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp37_ = _tmp36_->id;
#line 838 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_table_update_raw_development (_tmp33_, _tmp34_, _tmp35_, &_tmp37_, &_inner_error_);
#line 838 "/home/jens/Source/shotwell/src/Photo.vala"
				_database_table_unref0 (_tmp33_);
#line 838 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 6807 "Photo.c"
					goto __catch281_g_error;
				}
			}
			goto __finally281;
			__catch281_g_error:
			{
				GError* e = NULL;
				GError* _tmp38_ = NULL;
				const gchar* _tmp39_ = NULL;
#line 837 "/home/jens/Source/shotwell/src/Photo.vala"
				e = _inner_error_;
#line 837 "/home/jens/Source/shotwell/src/Photo.vala"
				_inner_error_ = NULL;
#line 840 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp38_ = e;
#line 840 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp39_ = _tmp38_->message;
#line 840 "/home/jens/Source/shotwell/src/Photo.vala"
				g_warning ("Photo.vala:840: Error updating database: %s", _tmp39_);
#line 837 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_error_free0 (e);
#line 6829 "Photo.c"
			}
			__finally281:
#line 837 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 6834 "Photo.c"
				{
					GeeHashMap* _tmp40_ = NULL;
#line 810 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp40_ = self->priv->developments;
#line 810 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_developments);
#line 6841 "Photo.c"
				}
#line 837 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 837 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 837 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 6849 "Photo.c"
			}
#line 847 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp42_ = stale_raw_developer;
#line 847 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp42_ != RAW_DEVELOPER_CAMERA) {
#line 6855 "Photo.c"
				RawDeveloper _tmp43_ = 0;
				PhotoRow* _tmp44_ = NULL;
				RawDeveloper _tmp45_ = 0;
#line 848 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp43_ = stale_raw_developer;
#line 848 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp44_ = self->row;
#line 848 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp45_ = _tmp44_->developer;
#line 848 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp41_ = _tmp43_ != _tmp45_;
#line 6867 "Photo.c"
			} else {
#line 847 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp41_ = FALSE;
#line 6871 "Photo.c"
			}
#line 847 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp41_) {
#line 6875 "Photo.c"
				RawDeveloper _tmp46_ = 0;
#line 851 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp46_ = stale_raw_developer;
#line 851 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_delete_raw_development (self, _tmp46_);
#line 6881 "Photo.c"
			}
		}
		__finally279:
		{
			GeeHashMap* _tmp47_ = NULL;
#line 810 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp47_ = self->priv->developments;
#line 810 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_developments);
#line 6891 "Photo.c"
		}
#line 810 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 810 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 810 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 810 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 6901 "Photo.c"
		}
	}
#line 858 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp48_ = alteration_new ("image", "developer");
#line 858 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp49_ = _tmp48_;
#line 858 "/home/jens/Source/shotwell/src/Photo.vala"
	data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp49_);
#line 858 "/home/jens/Source/shotwell/src/Photo.vala"
	_alteration_unref0 (_tmp49_);
#line 859 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_discard_prefetched (self);
#line 6914 "Photo.c"
}


RawDeveloper photo_get_raw_developer (Photo* self) {
	RawDeveloper result = 0;
	PhotoRow* _tmp0_ = NULL;
	RawDeveloper _tmp1_ = 0;
#line 862 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), 0);
#line 863 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = self->row;
#line 863 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_->developer;
#line 863 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp1_;
#line 863 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 6932 "Photo.c"
}


static gboolean photo_delete_raw_development (Photo* self, RawDeveloper d) {
	gboolean result = FALSE;
	gboolean ret = FALSE;
	GError * _inner_error_ = NULL;
#line 868 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 869 "/home/jens/Source/shotwell/src/Photo.vala"
	ret = FALSE;
#line 6944 "Photo.c"
	{
		GeeHashMap* _tmp0_ = NULL;
#line 871 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->developments;
#line 871 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_developments);
#line 6951 "Photo.c"
		{
			GeeHashMap* _tmp1_ = NULL;
			RawDeveloper _tmp2_ = 0;
			gboolean _tmp3_ = FALSE;
			gchar* _tmp5_ = NULL;
			gchar* _tmp6_ = NULL;
			RawDeveloper _tmp7_ = 0;
			gchar* _tmp8_ = NULL;
			gchar* _tmp9_ = NULL;
			BackingPhotoRow* bpr = NULL;
			GeeHashMap* _tmp10_ = NULL;
			RawDeveloper _tmp11_ = 0;
			gpointer _tmp12_ = NULL;
			BackingPhotoRow* _tmp13_ = NULL;
			const gchar* _tmp14_ = NULL;
			GeeHashMap* _tmp39_ = NULL;
			RawDeveloper _tmp40_ = 0;
			gboolean _tmp41_ = FALSE;
#line 872 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->developments;
#line 872 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = d;
#line 872 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((gintptr) _tmp2_));
#line 872 "/home/jens/Source/shotwell/src/Photo.vala"
			if (!_tmp3_) {
#line 873 "/home/jens/Source/shotwell/src/Photo.vala"
				result = FALSE;
#line 6980 "Photo.c"
				{
					GeeHashMap* _tmp4_ = NULL;
#line 871 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp4_ = self->priv->developments;
#line 871 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_developments);
#line 6987 "Photo.c"
				}
#line 873 "/home/jens/Source/shotwell/src/Photo.vala"
				return result;
#line 6991 "Photo.c"
			}
#line 877 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 877 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = _tmp5_;
#line 877 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = d;
#line 877 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = raw_developer_to_string (_tmp7_);
#line 877 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = _tmp8_;
#line 877 "/home/jens/Source/shotwell/src/Photo.vala"
			g_debug ("Photo.vala:877: Delete raw development: %s %s", _tmp6_, _tmp9_);
#line 877 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (_tmp9_);
#line 877 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (_tmp6_);
#line 878 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = self->priv->developments;
#line 878 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = d;
#line 878 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((gintptr) _tmp11_));
#line 878 "/home/jens/Source/shotwell/src/Photo.vala"
			bpr = (BackingPhotoRow*) _tmp12_;
#line 879 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = bpr;
#line 879 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp14_ = _tmp13_->filepath;
#line 879 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp14_ != NULL) {
#line 7023 "Photo.c"
				GFile* f = NULL;
				BackingPhotoRow* _tmp15_ = NULL;
				const gchar* _tmp16_ = NULL;
				GFile* _tmp17_ = NULL;
#line 880 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = bpr;
#line 880 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = _tmp15_->filepath;
#line 880 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp17_ = g_file_new_for_path (_tmp16_);
#line 880 "/home/jens/Source/shotwell/src/Photo.vala"
				f = _tmp17_;
#line 7036 "Photo.c"
				{
					RawDeveloper _tmp18_ = 0;
#line 882 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp18_ = d;
#line 882 "/home/jens/Source/shotwell/src/Photo.vala"
					if (_tmp18_ == RAW_DEVELOPER_CAMERA) {
#line 7043 "Photo.c"
						GFile* _tmp19_ = NULL;
#line 883 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp19_ = f;
#line 883 "/home/jens/Source/shotwell/src/Photo.vala"
						g_file_trash (_tmp19_, NULL, &_inner_error_);
#line 883 "/home/jens/Source/shotwell/src/Photo.vala"
						if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 7051 "Photo.c"
							goto __catch283_g_error;
						}
					} else {
						GFile* _tmp20_ = NULL;
#line 885 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp20_ = f;
#line 885 "/home/jens/Source/shotwell/src/Photo.vala"
						g_file_delete (_tmp20_, NULL, &_inner_error_);
#line 885 "/home/jens/Source/shotwell/src/Photo.vala"
						if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 7062 "Photo.c"
							goto __catch283_g_error;
						}
					}
				}
				goto __finally283;
				__catch283_g_error:
				{
					GError* e = NULL;
					BackingPhotoRow* _tmp21_ = NULL;
					const gchar* _tmp22_ = NULL;
					GError* _tmp23_ = NULL;
					const gchar* _tmp24_ = NULL;
#line 881 "/home/jens/Source/shotwell/src/Photo.vala"
					e = _inner_error_;
#line 881 "/home/jens/Source/shotwell/src/Photo.vala"
					_inner_error_ = NULL;
#line 887 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp21_ = bpr;
#line 887 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp22_ = _tmp21_->filepath;
#line 887 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp23_ = e;
#line 887 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp24_ = _tmp23_->message;
#line 887 "/home/jens/Source/shotwell/src/Photo.vala"
					g_warning ("Photo.vala:887: Unable to delete RAW development: %s error: %s", _tmp22_, _tmp24_);
#line 881 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_error_free0 (e);
#line 7091 "Photo.c"
				}
				__finally283:
#line 881 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 7096 "Photo.c"
					gboolean _tmp26_ = FALSE;
#line 881 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (f);
#line 881 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (bpr);
#line 881 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (f);
#line 881 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (bpr);
#line 7106 "Photo.c"
					{
						GeeHashMap* _tmp25_ = NULL;
#line 871 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp25_ = self->priv->developments;
#line 871 "/home/jens/Source/shotwell/src/Photo.vala"
						g_rec_mutex_unlock (&self->priv->__lock_developments);
#line 7113 "Photo.c"
					}
#line 881 "/home/jens/Source/shotwell/src/Photo.vala"
					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 881 "/home/jens/Source/shotwell/src/Photo.vala"
					g_clear_error (&_inner_error_);
#line 881 "/home/jens/Source/shotwell/src/Photo.vala"
					return _tmp26_;
#line 7121 "Photo.c"
				}
#line 879 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (f);
#line 7125 "Photo.c"
			}
			{
				PhotoTable* _tmp27_ = NULL;
				PhotoTable* _tmp28_ = NULL;
				PhotoRow* _tmp29_ = NULL;
				RawDeveloper _tmp30_ = 0;
				BackingPhotoTable* _tmp31_ = NULL;
				BackingPhotoTable* _tmp32_ = NULL;
				BackingPhotoRow* _tmp33_ = NULL;
				BackingPhotoID _tmp34_ = {0};
#line 893 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp27_ = photo_table_get_instance ();
#line 893 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp28_ = _tmp27_;
#line 893 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp29_ = self->row;
#line 893 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp30_ = d;
#line 893 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_table_remove_development (_tmp28_, _tmp29_, _tmp30_, &_inner_error_);
#line 893 "/home/jens/Source/shotwell/src/Photo.vala"
				_database_table_unref0 (_tmp28_);
#line 893 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 7150 "Photo.c"
					goto __catch284_g_error;
				}
#line 894 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp31_ = backing_photo_table_get_instance ();
#line 894 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp32_ = _tmp31_;
#line 894 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp33_ = bpr;
#line 894 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp34_ = _tmp33_->id;
#line 894 "/home/jens/Source/shotwell/src/Photo.vala"
				backing_photo_table_remove (_tmp32_, &_tmp34_, &_inner_error_);
#line 894 "/home/jens/Source/shotwell/src/Photo.vala"
				_database_table_unref0 (_tmp32_);
#line 894 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 7167 "Photo.c"
					goto __catch284_g_error;
				}
			}
			goto __finally284;
			__catch284_g_error:
			{
				GError* e = NULL;
				GError* _tmp35_ = NULL;
				const gchar* _tmp36_ = NULL;
#line 892 "/home/jens/Source/shotwell/src/Photo.vala"
				e = _inner_error_;
#line 892 "/home/jens/Source/shotwell/src/Photo.vala"
				_inner_error_ = NULL;
#line 896 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp35_ = e;
#line 896 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp36_ = _tmp35_->message;
#line 896 "/home/jens/Source/shotwell/src/Photo.vala"
				g_warning ("Photo.vala:896: Database error while deleting RAW development: %s", _tmp36_);
#line 892 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_error_free0 (e);
#line 7189 "Photo.c"
			}
			__finally284:
#line 892 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 7194 "Photo.c"
				gboolean _tmp38_ = FALSE;
#line 892 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (bpr);
#line 892 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (bpr);
#line 7200 "Photo.c"
				{
					GeeHashMap* _tmp37_ = NULL;
#line 871 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp37_ = self->priv->developments;
#line 871 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_developments);
#line 7207 "Photo.c"
				}
#line 892 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 892 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 892 "/home/jens/Source/shotwell/src/Photo.vala"
				return _tmp38_;
#line 7215 "Photo.c"
			}
#line 899 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp39_ = self->priv->developments;
#line 899 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp40_ = d;
#line 899 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp41_ = gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((gintptr) _tmp40_), NULL);
#line 899 "/home/jens/Source/shotwell/src/Photo.vala"
			ret = _tmp41_;
#line 871 "/home/jens/Source/shotwell/src/Photo.vala"
			_backing_photo_row_unref0 (bpr);
#line 7227 "Photo.c"
		}
		__finally282:
		{
			GeeHashMap* _tmp42_ = NULL;
#line 871 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp42_ = self->priv->developments;
#line 871 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_developments);
#line 7236 "Photo.c"
		}
#line 871 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 7240 "Photo.c"
			gboolean _tmp43_ = FALSE;
#line 871 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 871 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 871 "/home/jens/Source/shotwell/src/Photo.vala"
			return _tmp43_;
#line 7248 "Photo.c"
		}
	}
#line 902 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_notify_raw_development_modified (self);
#line 903 "/home/jens/Source/shotwell/src/Photo.vala"
	result = ret;
#line 903 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 7257 "Photo.c"
}


void photo_redevelop_raw (Photo* self, RawDeveloper d) {
	GError * _inner_error_ = NULL;
#line 907 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 7265 "Photo.c"
	{
		GeeHashMap* _tmp0_ = NULL;
#line 908 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->developments;
#line 908 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_developments);
#line 7272 "Photo.c"
		{
			RawDeveloper _tmp1_ = 0;
			RawDeveloper dev = 0;
			RawDeveloper _tmp2_ = 0;
			RawDeveloper _tmp3_ = 0;
			RawDeveloper _tmp4_ = 0;
#line 909 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = d;
#line 909 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_delete_raw_development (self, _tmp1_);
#line 910 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = d;
#line 910 "/home/jens/Source/shotwell/src/Photo.vala"
			dev = _tmp2_;
#line 911 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = dev;
#line 911 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp3_ == RAW_DEVELOPER_CAMERA) {
#line 912 "/home/jens/Source/shotwell/src/Photo.vala"
				dev = RAW_DEVELOPER_EMBEDDED;
#line 7293 "Photo.c"
			}
#line 914 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = dev;
#line 914 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_set_raw_developer (self, _tmp4_);
#line 7299 "Photo.c"
		}
		__finally285:
		{
			GeeHashMap* _tmp5_ = NULL;
#line 908 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->priv->developments;
#line 908 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_developments);
#line 7308 "Photo.c"
		}
#line 908 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 908 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 908 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 908 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 7318 "Photo.c"
		}
	}
}


static void _vala_array_add86 (BackingFileState*** array, int* length, int* size, BackingFileState* value) {
#line 921 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 921 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 921 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (BackingFileState*, *array, (*size) + 1);
#line 7331 "Photo.c"
	}
#line 921 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 921 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 7337 "Photo.c"
}


static void _vala_array_add87 (BackingFileState*** array, int* length, int* size, BackingFileState* value) {
#line 923 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 923 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 923 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (BackingFileState*, *array, (*size) + 1);
#line 7348 "Photo.c"
	}
#line 923 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 923 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 7354 "Photo.c"
}


static void _vala_array_add88 (BackingFileState*** array, int* length, int* size, BackingFileState* value) {
#line 930 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 930 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 930 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (BackingFileState*, *array, (*size) + 1);
#line 7365 "Photo.c"
	}
#line 930 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 930 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 7371 "Photo.c"
}


static BackingFileState** photo_real_get_backing_files_state (MediaSource* base, int* result_length1) {
	Photo * self;
	BackingFileState** result = NULL;
	BackingFileState** backing = NULL;
	BackingFileState** _tmp0_ = NULL;
	gint backing_length1 = 0;
	gint _backing_size_ = 0;
	BackingFileState** _tmp27_ = NULL;
	gint _tmp27__length1 = 0;
	GError * _inner_error_ = NULL;
#line 918 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 919 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = g_new0 (BackingFileState*, 0 + 1);
#line 919 "/home/jens/Source/shotwell/src/Photo.vala"
	backing = _tmp0_;
#line 919 "/home/jens/Source/shotwell/src/Photo.vala"
	backing_length1 = 0;
#line 919 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_size_ = backing_length1;
#line 7395 "Photo.c"
	{
		PhotoRow* _tmp1_ = NULL;
#line 920 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = self->row;
#line 920 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 7402 "Photo.c"
		{
			BackingFileState** _tmp2_ = NULL;
			gint _tmp2__length1 = 0;
			PhotoRow* _tmp3_ = NULL;
			BackingPhotoRow* _tmp4_ = NULL;
			PhotoRow* _tmp5_ = NULL;
			const gchar* _tmp6_ = NULL;
			BackingFileState* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			gboolean _tmp12_ = FALSE;
#line 921 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = backing;
#line 921 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2__length1 = backing_length1;
#line 921 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = self->row;
#line 921 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = _tmp3_->master;
#line 921 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->row;
#line 921 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = _tmp5_->md5;
#line 921 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = backing_file_state_new_from_photo_row (_tmp4_, _tmp6_);
#line 921 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_array_add86 (&backing, &backing_length1, &_backing_size_, _tmp7_);
#line 922 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = photo_has_editable (self);
#line 922 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp8_) {
#line 7433 "Photo.c"
				BackingFileState** _tmp9_ = NULL;
				gint _tmp9__length1 = 0;
				BackingPhotoRow* _tmp10_ = NULL;
				BackingFileState* _tmp11_ = NULL;
#line 923 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = backing;
#line 923 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9__length1 = backing_length1;
#line 923 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = self->priv->editable;
#line 923 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = backing_file_state_new_from_photo_row (_tmp10_, NULL);
#line 923 "/home/jens/Source/shotwell/src/Photo.vala"
				_vala_array_add87 (&backing, &backing_length1, &_backing_size_, _tmp11_);
#line 7448 "Photo.c"
			}
#line 925 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = photo_is_developed (self);
#line 925 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp12_) {
#line 7454 "Photo.c"
				GeeCollection* dev_rows = NULL;
				GeeCollection* _tmp13_ = NULL;
				GeeCollection* _tmp14_ = NULL;
#line 926 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = photo_get_raw_development_photo_rows (self);
#line 926 "/home/jens/Source/shotwell/src/Photo.vala"
				dev_rows = _tmp13_;
#line 927 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = dev_rows;
#line 927 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp14_ != NULL) {
#line 7466 "Photo.c"
					{
						GeeIterator* _r_it = NULL;
						GeeCollection* _tmp15_ = NULL;
						GeeIterator* _tmp16_ = NULL;
#line 928 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp15_ = dev_rows;
#line 928 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp16_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, GEE_TYPE_ITERABLE, GeeIterable));
#line 928 "/home/jens/Source/shotwell/src/Photo.vala"
						_r_it = _tmp16_;
#line 928 "/home/jens/Source/shotwell/src/Photo.vala"
						while (TRUE) {
#line 7479 "Photo.c"
							GeeIterator* _tmp17_ = NULL;
							gboolean _tmp18_ = FALSE;
							BackingPhotoRow* r = NULL;
							GeeIterator* _tmp19_ = NULL;
							gpointer _tmp20_ = NULL;
							BackingPhotoRow* _tmp21_ = NULL;
							const gchar* _tmp22_ = NULL;
							BackingFileState** _tmp23_ = NULL;
							gint _tmp23__length1 = 0;
							BackingPhotoRow* _tmp24_ = NULL;
							BackingFileState* _tmp25_ = NULL;
#line 928 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp17_ = _r_it;
#line 928 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp18_ = gee_iterator_next (_tmp17_);
#line 928 "/home/jens/Source/shotwell/src/Photo.vala"
							if (!_tmp18_) {
#line 928 "/home/jens/Source/shotwell/src/Photo.vala"
								break;
#line 7499 "Photo.c"
							}
#line 928 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp19_ = _r_it;
#line 928 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp20_ = gee_iterator_get (_tmp19_);
#line 928 "/home/jens/Source/shotwell/src/Photo.vala"
							r = (BackingPhotoRow*) _tmp20_;
#line 929 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp21_ = r;
#line 929 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp22_ = _tmp21_->filepath;
#line 929 "/home/jens/Source/shotwell/src/Photo.vala"
							g_debug ("Photo.vala:929: adding: %s", _tmp22_);
#line 930 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp23_ = backing;
#line 930 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp23__length1 = backing_length1;
#line 930 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp24_ = r;
#line 930 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp25_ = backing_file_state_new_from_photo_row (_tmp24_, NULL);
#line 930 "/home/jens/Source/shotwell/src/Photo.vala"
							_vala_array_add88 (&backing, &backing_length1, &_backing_size_, _tmp25_);
#line 928 "/home/jens/Source/shotwell/src/Photo.vala"
							_backing_photo_row_unref0 (r);
#line 7525 "Photo.c"
						}
#line 928 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_object_unref0 (_r_it);
#line 7529 "Photo.c"
					}
				}
#line 925 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (dev_rows);
#line 7534 "Photo.c"
			}
		}
		__finally286:
		{
			PhotoRow* _tmp26_ = NULL;
#line 920 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp26_ = self->row;
#line 920 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 7544 "Photo.c"
		}
#line 920 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 920 "/home/jens/Source/shotwell/src/Photo.vala"
			backing = (_vala_array_free (backing, backing_length1, (GDestroyNotify) backing_file_state_unref), NULL);
#line 920 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 920 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 920 "/home/jens/Source/shotwell/src/Photo.vala"
			return NULL;
#line 7556 "Photo.c"
		}
	}
#line 936 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp27_ = backing;
#line 936 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp27__length1 = backing_length1;
#line 936 "/home/jens/Source/shotwell/src/Photo.vala"
	if (result_length1) {
#line 936 "/home/jens/Source/shotwell/src/Photo.vala"
		*result_length1 = _tmp27__length1;
#line 7567 "Photo.c"
	}
#line 936 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp27_;
#line 936 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 7573 "Photo.c"
}


static PhotoFileReader* photo_get_backing_reader (Photo* self, BackingFetchMode mode) {
	PhotoFileReader* result = NULL;
	BackingFetchMode _tmp0_ = 0;
#line 939 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 940 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = mode;
#line 940 "/home/jens/Source/shotwell/src/Photo.vala"
	switch (_tmp0_) {
#line 940 "/home/jens/Source/shotwell/src/Photo.vala"
		case BACKING_FETCH_MODE_MASTER:
#line 7588 "Photo.c"
		{
			PhotoFileReader* _tmp1_ = NULL;
#line 942 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = photo_get_master_reader (self);
#line 942 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp1_;
#line 942 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 7597 "Photo.c"
		}
#line 940 "/home/jens/Source/shotwell/src/Photo.vala"
		case BACKING_FETCH_MODE_BASELINE:
#line 7601 "Photo.c"
		{
			PhotoFileReader* _tmp2_ = NULL;
#line 945 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = photo_get_baseline_reader (self);
#line 945 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp2_;
#line 945 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 7610 "Photo.c"
		}
#line 940 "/home/jens/Source/shotwell/src/Photo.vala"
		case BACKING_FETCH_MODE_SOURCE:
#line 7614 "Photo.c"
		{
			PhotoFileReader* _tmp3_ = NULL;
#line 948 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = photo_get_source_reader (self);
#line 948 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp3_;
#line 948 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 7623 "Photo.c"
		}
#line 940 "/home/jens/Source/shotwell/src/Photo.vala"
		case BACKING_FETCH_MODE_UNMODIFIED:
#line 7627 "Photo.c"
		{
			PhotoFileFormat _tmp4_ = 0;
#line 951 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = photo_get_master_file_format (self);
#line 951 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp4_ == PHOTO_FILE_FORMAT_RAW) {
#line 7634 "Photo.c"
				PhotoFileReader* _tmp5_ = NULL;
#line 952 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = photo_get_raw_developer_reader (self);
#line 952 "/home/jens/Source/shotwell/src/Photo.vala"
				result = _tmp5_;
#line 952 "/home/jens/Source/shotwell/src/Photo.vala"
				return result;
#line 7642 "Photo.c"
			} else {
				PhotoFileReader* _tmp6_ = NULL;
#line 954 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = photo_get_master_reader (self);
#line 954 "/home/jens/Source/shotwell/src/Photo.vala"
				result = _tmp6_;
#line 954 "/home/jens/Source/shotwell/src/Photo.vala"
				return result;
#line 7651 "Photo.c"
			}
		}
		default:
		{
			BackingFetchMode _tmp7_ = 0;
			GEnumValue* _tmp8_;
#line 957 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = mode;
#line 957 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = g_enum_get_value (g_type_class_ref (TYPE_BACKING_FETCH_MODE), _tmp7_);
#line 957 "/home/jens/Source/shotwell/src/Photo.vala"
			g_error ("Photo.vala:957: Unknown backing fetch mode %s", (_tmp8_ != NULL) ? _tmp8_->value_name : NULL);
#line 7664 "Photo.c"
		}
	}
}


static gpointer _photo_file_adapter_ref0 (gpointer self) {
#line 963 "/home/jens/Source/shotwell/src/Photo.vala"
	return self ? photo_file_adapter_ref (self) : NULL;
#line 7673 "Photo.c"
}


static PhotoFileReader* photo_get_master_reader (Photo* self) {
	PhotoFileReader* result = NULL;
	GError * _inner_error_ = NULL;
#line 961 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 7682 "Photo.c"
	{
		PhotoBackingReaders* _tmp0_ = NULL;
#line 962 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->readers;
#line 962 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_readers);
#line 7689 "Photo.c"
		{
			PhotoBackingReaders* _tmp1_ = NULL;
			PhotoFileReader* _tmp2_ = NULL;
			PhotoFileReader* _tmp3_ = NULL;
#line 963 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->readers;
#line 963 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->master;
#line 963 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = _photo_file_adapter_ref0 (_tmp2_);
#line 963 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp3_;
#line 7702 "Photo.c"
			{
				PhotoBackingReaders* _tmp4_ = NULL;
#line 962 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = self->priv->readers;
#line 962 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 7709 "Photo.c"
			}
#line 963 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 7713 "Photo.c"
		}
		__finally287:
		{
			PhotoBackingReaders* _tmp5_ = NULL;
#line 962 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->priv->readers;
#line 962 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 7722 "Photo.c"
		}
#line 962 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 962 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 962 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 7730 "Photo.c"
	}
}


PhotoFileReader* photo_get_editable_reader (Photo* self) {
	PhotoFileReader* result = NULL;
	GError * _inner_error_ = NULL;
#line 967 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 7740 "Photo.c"
	{
		PhotoBackingReaders* _tmp0_ = NULL;
#line 968 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->readers;
#line 968 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_readers);
#line 7747 "Photo.c"
		{
			PhotoBackingReaders* _tmp1_ = NULL;
			PhotoFileReader* _tmp2_ = NULL;
			PhotoFileReader* _tmp3_ = NULL;
#line 969 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->readers;
#line 969 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->editable;
#line 969 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = _photo_file_adapter_ref0 (_tmp2_);
#line 969 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp3_;
#line 7760 "Photo.c"
			{
				PhotoBackingReaders* _tmp4_ = NULL;
#line 968 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = self->priv->readers;
#line 968 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 7767 "Photo.c"
			}
#line 969 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 7771 "Photo.c"
		}
		__finally288:
		{
			PhotoBackingReaders* _tmp5_ = NULL;
#line 968 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->priv->readers;
#line 968 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 7780 "Photo.c"
		}
#line 968 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 968 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 968 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 7788 "Photo.c"
	}
}


static PhotoFileReader* photo_get_baseline_reader (Photo* self) {
	PhotoFileReader* result = NULL;
	GError * _inner_error_ = NULL;
#line 974 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 7798 "Photo.c"
	{
		PhotoBackingReaders* _tmp0_ = NULL;
#line 975 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->readers;
#line 975 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_readers);
#line 7805 "Photo.c"
		{
			PhotoBackingReaders* _tmp1_ = NULL;
			PhotoFileReader* _tmp2_ = NULL;
			PhotoBackingReaders* _tmp7_ = NULL;
			PhotoFileReader* _tmp8_ = NULL;
			PhotoBackingReaders* _tmp13_ = NULL;
			PhotoFileReader* _tmp14_ = NULL;
			PhotoFileReader* _tmp15_ = NULL;
#line 976 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->readers;
#line 976 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->editable;
#line 976 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp2_ != NULL) {
#line 7820 "Photo.c"
				PhotoBackingReaders* _tmp3_ = NULL;
				PhotoFileReader* _tmp4_ = NULL;
				PhotoFileReader* _tmp5_ = NULL;
#line 977 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->priv->readers;
#line 977 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = _tmp3_->editable;
#line 977 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = _photo_file_adapter_ref0 (_tmp4_);
#line 977 "/home/jens/Source/shotwell/src/Photo.vala"
				result = _tmp5_;
#line 7832 "Photo.c"
				{
					PhotoBackingReaders* _tmp6_ = NULL;
#line 975 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp6_ = self->priv->readers;
#line 975 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 7839 "Photo.c"
				}
#line 977 "/home/jens/Source/shotwell/src/Photo.vala"
				return result;
#line 7843 "Photo.c"
			}
#line 979 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = self->priv->readers;
#line 979 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = _tmp7_->developer;
#line 979 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp8_ != NULL) {
#line 7851 "Photo.c"
				PhotoBackingReaders* _tmp9_ = NULL;
				PhotoFileReader* _tmp10_ = NULL;
				PhotoFileReader* _tmp11_ = NULL;
#line 980 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = self->priv->readers;
#line 980 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = _tmp9_->developer;
#line 980 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = _photo_file_adapter_ref0 (_tmp10_);
#line 980 "/home/jens/Source/shotwell/src/Photo.vala"
				result = _tmp11_;
#line 7863 "Photo.c"
				{
					PhotoBackingReaders* _tmp12_ = NULL;
#line 975 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp12_ = self->priv->readers;
#line 975 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 7870 "Photo.c"
				}
#line 980 "/home/jens/Source/shotwell/src/Photo.vala"
				return result;
#line 7874 "Photo.c"
			}
#line 982 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = self->priv->readers;
#line 982 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp14_ = _tmp13_->master;
#line 982 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp15_ = _photo_file_adapter_ref0 (_tmp14_);
#line 982 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp15_;
#line 7884 "Photo.c"
			{
				PhotoBackingReaders* _tmp16_ = NULL;
#line 975 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = self->priv->readers;
#line 975 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 7891 "Photo.c"
			}
#line 982 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 7895 "Photo.c"
		}
		__finally289:
		{
			PhotoBackingReaders* _tmp17_ = NULL;
#line 975 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp17_ = self->priv->readers;
#line 975 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 7904 "Photo.c"
		}
#line 975 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 975 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 975 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 7912 "Photo.c"
	}
}


static PhotoFileReader* photo_get_source_reader (Photo* self) {
	PhotoFileReader* result = NULL;
	GError * _inner_error_ = NULL;
#line 987 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 7922 "Photo.c"
	{
		PhotoBackingReaders* _tmp0_ = NULL;
#line 988 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->readers;
#line 988 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_readers);
#line 7929 "Photo.c"
		{
			PhotoBackingReaders* _tmp1_ = NULL;
			PhotoFileReader* _tmp2_ = NULL;
			PhotoBackingReaders* _tmp7_ = NULL;
			PhotoFileReader* _tmp8_ = NULL;
			PhotoBackingReaders* _tmp13_ = NULL;
			PhotoFileReader* _tmp14_ = NULL;
			PhotoFileReader* _tmp15_ = NULL;
#line 989 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->readers;
#line 989 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->editable;
#line 989 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp2_ != NULL) {
#line 7944 "Photo.c"
				PhotoBackingReaders* _tmp3_ = NULL;
				PhotoFileReader* _tmp4_ = NULL;
				PhotoFileReader* _tmp5_ = NULL;
#line 990 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->priv->readers;
#line 990 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = _tmp3_->editable;
#line 990 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = _photo_file_adapter_ref0 (_tmp4_);
#line 990 "/home/jens/Source/shotwell/src/Photo.vala"
				result = _tmp5_;
#line 7956 "Photo.c"
				{
					PhotoBackingReaders* _tmp6_ = NULL;
#line 988 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp6_ = self->priv->readers;
#line 988 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 7963 "Photo.c"
				}
#line 990 "/home/jens/Source/shotwell/src/Photo.vala"
				return result;
#line 7967 "Photo.c"
			}
#line 992 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = self->priv->readers;
#line 992 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = _tmp7_->developer;
#line 992 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp8_ != NULL) {
#line 7975 "Photo.c"
				PhotoBackingReaders* _tmp9_ = NULL;
				PhotoFileReader* _tmp10_ = NULL;
				PhotoFileReader* _tmp11_ = NULL;
#line 993 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = self->priv->readers;
#line 993 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = _tmp9_->developer;
#line 993 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = _photo_file_adapter_ref0 (_tmp10_);
#line 993 "/home/jens/Source/shotwell/src/Photo.vala"
				result = _tmp11_;
#line 7987 "Photo.c"
				{
					PhotoBackingReaders* _tmp12_ = NULL;
#line 988 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp12_ = self->priv->readers;
#line 988 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 7994 "Photo.c"
				}
#line 993 "/home/jens/Source/shotwell/src/Photo.vala"
				return result;
#line 7998 "Photo.c"
			}
#line 995 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = self->priv->readers;
#line 995 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp14_ = _tmp13_->master;
#line 995 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp15_ = _photo_file_adapter_ref0 (_tmp14_);
#line 995 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp15_;
#line 8008 "Photo.c"
			{
				PhotoBackingReaders* _tmp16_ = NULL;
#line 988 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = self->priv->readers;
#line 988 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 8015 "Photo.c"
			}
#line 995 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 8019 "Photo.c"
		}
		__finally290:
		{
			PhotoBackingReaders* _tmp17_ = NULL;
#line 988 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp17_ = self->priv->readers;
#line 988 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 8028 "Photo.c"
		}
#line 988 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 988 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 988 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 8036 "Photo.c"
	}
}


static PhotoFileReader* photo_get_raw_developer_reader (Photo* self) {
	PhotoFileReader* result = NULL;
	GError * _inner_error_ = NULL;
#line 1000 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 8046 "Photo.c"
	{
		PhotoBackingReaders* _tmp0_ = NULL;
#line 1001 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->readers;
#line 1001 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_readers);
#line 8053 "Photo.c"
		{
			PhotoBackingReaders* _tmp1_ = NULL;
			PhotoFileReader* _tmp2_ = NULL;
			PhotoFileReader* _tmp3_ = NULL;
#line 1002 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->readers;
#line 1002 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->developer;
#line 1002 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = _photo_file_adapter_ref0 (_tmp2_);
#line 1002 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp3_;
#line 8066 "Photo.c"
			{
				PhotoBackingReaders* _tmp4_ = NULL;
#line 1001 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = self->priv->readers;
#line 1001 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 8073 "Photo.c"
			}
#line 1002 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 8077 "Photo.c"
		}
		__finally291:
		{
			PhotoBackingReaders* _tmp5_ = NULL;
#line 1001 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->priv->readers;
#line 1001 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 8086 "Photo.c"
		}
#line 1001 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1001 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1001 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 8094 "Photo.c"
	}
}


gboolean photo_is_developed (Photo* self) {
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
#line 1006 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 8104 "Photo.c"
	{
		PhotoBackingReaders* _tmp0_ = NULL;
		gboolean _tmp5_ = FALSE;
#line 1007 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->readers;
#line 1007 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_readers);
#line 8112 "Photo.c"
		{
			PhotoBackingReaders* _tmp1_ = NULL;
			PhotoFileReader* _tmp2_ = NULL;
#line 1008 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->readers;
#line 1008 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->developer;
#line 1008 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp2_ != NULL;
#line 8122 "Photo.c"
			{
				PhotoBackingReaders* _tmp3_ = NULL;
#line 1007 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->priv->readers;
#line 1007 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 8129 "Photo.c"
			}
#line 1008 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 8133 "Photo.c"
		}
		__finally292:
		{
			PhotoBackingReaders* _tmp4_ = NULL;
#line 1007 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->priv->readers;
#line 1007 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 8142 "Photo.c"
		}
#line 1007 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1007 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1007 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp5_;
#line 8150 "Photo.c"
	}
}


gboolean photo_has_editable (Photo* self) {
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
#line 1012 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 8160 "Photo.c"
	{
		PhotoBackingReaders* _tmp0_ = NULL;
		gboolean _tmp5_ = FALSE;
#line 1013 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->readers;
#line 1013 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_readers);
#line 8168 "Photo.c"
		{
			PhotoBackingReaders* _tmp1_ = NULL;
			PhotoFileReader* _tmp2_ = NULL;
#line 1014 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->readers;
#line 1014 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->editable;
#line 1014 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp2_ != NULL;
#line 8178 "Photo.c"
			{
				PhotoBackingReaders* _tmp3_ = NULL;
#line 1013 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->priv->readers;
#line 1013 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 8185 "Photo.c"
			}
#line 1014 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 8189 "Photo.c"
		}
		__finally293:
		{
			PhotoBackingReaders* _tmp4_ = NULL;
#line 1013 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->priv->readers;
#line 1013 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 8198 "Photo.c"
		}
#line 1013 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1013 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1013 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp5_;
#line 8206 "Photo.c"
	}
}


gboolean photo_does_master_exist (Photo* self) {
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
#line 1018 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 8216 "Photo.c"
	{
		PhotoBackingReaders* _tmp0_ = NULL;
		gboolean _tmp6_ = FALSE;
#line 1019 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->readers;
#line 1019 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_readers);
#line 8224 "Photo.c"
		{
			PhotoBackingReaders* _tmp1_ = NULL;
			PhotoFileReader* _tmp2_ = NULL;
			gboolean _tmp3_ = FALSE;
#line 1020 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->readers;
#line 1020 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->master;
#line 1020 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = photo_file_adapter_file_exists (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 1020 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp3_;
#line 8237 "Photo.c"
			{
				PhotoBackingReaders* _tmp4_ = NULL;
#line 1019 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = self->priv->readers;
#line 1019 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 8244 "Photo.c"
			}
#line 1020 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 8248 "Photo.c"
		}
		__finally294:
		{
			PhotoBackingReaders* _tmp5_ = NULL;
#line 1019 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->priv->readers;
#line 1019 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 8257 "Photo.c"
		}
#line 1019 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1019 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1019 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp6_;
#line 8265 "Photo.c"
	}
}


gboolean photo_does_editable_exist (Photo* self) {
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
#line 1025 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 8275 "Photo.c"
	{
		PhotoBackingReaders* _tmp0_ = NULL;
		gboolean _tmp9_ = FALSE;
#line 1026 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->readers;
#line 1026 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_readers);
#line 8283 "Photo.c"
		{
			gboolean _tmp1_ = FALSE;
			PhotoBackingReaders* _tmp2_ = NULL;
			PhotoFileReader* _tmp3_ = NULL;
#line 1027 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = self->priv->readers;
#line 1027 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = _tmp2_->editable;
#line 1027 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp3_ != NULL) {
#line 8294 "Photo.c"
				PhotoBackingReaders* _tmp4_ = NULL;
				PhotoFileReader* _tmp5_ = NULL;
				gboolean _tmp6_ = FALSE;
#line 1027 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = self->priv->readers;
#line 1027 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = _tmp4_->editable;
#line 1027 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = photo_file_adapter_file_exists (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 1027 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = _tmp6_;
#line 8306 "Photo.c"
			} else {
#line 1027 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = FALSE;
#line 8310 "Photo.c"
			}
#line 1027 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp1_;
#line 8314 "Photo.c"
			{
				PhotoBackingReaders* _tmp7_ = NULL;
#line 1026 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = self->priv->readers;
#line 1026 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 8321 "Photo.c"
			}
#line 1027 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 8325 "Photo.c"
		}
		__finally295:
		{
			PhotoBackingReaders* _tmp8_ = NULL;
#line 1026 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = self->priv->readers;
#line 1026 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 8334 "Photo.c"
		}
#line 1026 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1026 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1026 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp9_;
#line 8342 "Photo.c"
	}
}


gboolean photo_is_master_baseline (Photo* self) {
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
#line 1031 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 8352 "Photo.c"
	{
		PhotoBackingReaders* _tmp0_ = NULL;
		gboolean _tmp5_ = FALSE;
#line 1032 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->readers;
#line 1032 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_readers);
#line 8360 "Photo.c"
		{
			PhotoBackingReaders* _tmp1_ = NULL;
			PhotoFileReader* _tmp2_ = NULL;
#line 1033 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->readers;
#line 1033 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->editable;
#line 1033 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp2_ == NULL;
#line 8370 "Photo.c"
			{
				PhotoBackingReaders* _tmp3_ = NULL;
#line 1032 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->priv->readers;
#line 1032 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 8377 "Photo.c"
			}
#line 1033 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 8381 "Photo.c"
		}
		__finally296:
		{
			PhotoBackingReaders* _tmp4_ = NULL;
#line 1032 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->priv->readers;
#line 1032 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 8390 "Photo.c"
		}
#line 1032 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1032 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1032 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp5_;
#line 8398 "Photo.c"
	}
}


gboolean photo_is_master_source (Photo* self) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
#line 1037 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 1038 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_has_editable (self);
#line 1038 "/home/jens/Source/shotwell/src/Photo.vala"
	result = !_tmp0_;
#line 1038 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 8414 "Photo.c"
}


gboolean photo_is_editable_baseline (Photo* self) {
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
#line 1041 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 8423 "Photo.c"
	{
		PhotoBackingReaders* _tmp0_ = NULL;
		gboolean _tmp5_ = FALSE;
#line 1042 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->readers;
#line 1042 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_readers);
#line 8431 "Photo.c"
		{
			PhotoBackingReaders* _tmp1_ = NULL;
			PhotoFileReader* _tmp2_ = NULL;
#line 1043 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->readers;
#line 1043 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->editable;
#line 1043 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp2_ != NULL;
#line 8441 "Photo.c"
			{
				PhotoBackingReaders* _tmp3_ = NULL;
#line 1042 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->priv->readers;
#line 1042 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 8448 "Photo.c"
			}
#line 1043 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 8452 "Photo.c"
		}
		__finally297:
		{
			PhotoBackingReaders* _tmp4_ = NULL;
#line 1042 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->priv->readers;
#line 1042 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 8461 "Photo.c"
		}
#line 1042 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1042 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1042 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp5_;
#line 8469 "Photo.c"
	}
}


gboolean photo_is_editable_source (Photo* self) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
#line 1047 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 1048 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_has_editable (self);
#line 1048 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 1048 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 8485 "Photo.c"
}


BackingPhotoRow* photo_get_master_photo_row (Photo* self) {
	BackingPhotoRow* result = NULL;
	GError * _inner_error_ = NULL;
#line 1051 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 8494 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 1052 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 1052 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 8501 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			BackingPhotoRow* _tmp2_ = NULL;
			BackingPhotoRow* _tmp3_ = NULL;
#line 1053 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 1053 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->master;
#line 1053 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = _backing_photo_row_ref0 (_tmp2_);
#line 1053 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp3_;
#line 8514 "Photo.c"
			{
				PhotoRow* _tmp4_ = NULL;
#line 1052 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = self->row;
#line 1052 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 8521 "Photo.c"
			}
#line 1053 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 8525 "Photo.c"
		}
		__finally298:
		{
			PhotoRow* _tmp5_ = NULL;
#line 1052 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->row;
#line 1052 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 8534 "Photo.c"
		}
#line 1052 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1052 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1052 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 8542 "Photo.c"
	}
}


BackingPhotoRow* photo_get_editable_photo_row (Photo* self) {
	BackingPhotoRow* result = NULL;
	GError * _inner_error_ = NULL;
#line 1057 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 8552 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 1058 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 1058 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 8559 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			gboolean _tmp2_ = FALSE;
#line 1060 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 1060 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = backing_photo_id_is_valid (&_tmp1_->editable_id);
#line 1060 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp2_) {
#line 8569 "Photo.c"
				BackingPhotoRow* _tmp3_ = NULL;
				BackingPhotoRow* _tmp4_ = NULL;
#line 1061 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->priv->editable;
#line 1061 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = _backing_photo_row_ref0 (_tmp3_);
#line 1061 "/home/jens/Source/shotwell/src/Photo.vala"
				result = _tmp4_;
#line 8578 "Photo.c"
				{
					PhotoRow* _tmp5_ = NULL;
#line 1058 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp5_ = self->row;
#line 1058 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_row);
#line 8585 "Photo.c"
				}
#line 1061 "/home/jens/Source/shotwell/src/Photo.vala"
				return result;
#line 8589 "Photo.c"
			} else {
#line 1063 "/home/jens/Source/shotwell/src/Photo.vala"
				result = NULL;
#line 8593 "Photo.c"
				{
					PhotoRow* _tmp6_ = NULL;
#line 1058 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp6_ = self->row;
#line 1058 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_row);
#line 8600 "Photo.c"
				}
#line 1063 "/home/jens/Source/shotwell/src/Photo.vala"
				return result;
#line 8604 "Photo.c"
			}
		}
		__finally299:
		{
			PhotoRow* _tmp7_ = NULL;
#line 1058 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = self->row;
#line 1058 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 8614 "Photo.c"
		}
#line 1058 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1058 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1058 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 8622 "Photo.c"
	}
}


GeeCollection* photo_get_raw_development_photo_rows (Photo* self) {
	GeeCollection* result = NULL;
	GError * _inner_error_ = NULL;
#line 1067 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 8632 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 1068 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 1068 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 8639 "Photo.c"
		{
			GeeCollection* _tmp1_ = NULL;
			GeeHashMap* _tmp2_ = NULL;
#line 1069 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = self->priv->developments;
#line 1069 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp2_ != NULL) {
#line 8647 "Photo.c"
				GeeHashMap* _tmp3_ = NULL;
				GeeCollection* _tmp4_ = NULL;
				GeeCollection* _tmp5_ = NULL;
#line 1069 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->priv->developments;
#line 1069 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = gee_abstract_map_get_values (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
#line 1069 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = _tmp4_;
#line 1069 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (_tmp1_);
#line 1069 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = _tmp5_;
#line 8661 "Photo.c"
			} else {
#line 1069 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (_tmp1_);
#line 1069 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = NULL;
#line 8667 "Photo.c"
			}
#line 1069 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp1_;
#line 8671 "Photo.c"
			{
				PhotoRow* _tmp6_ = NULL;
#line 1068 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = self->row;
#line 1068 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 8678 "Photo.c"
			}
#line 1069 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 8682 "Photo.c"
		}
		__finally300:
		{
			PhotoRow* _tmp7_ = NULL;
#line 1068 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = self->row;
#line 1068 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 8691 "Photo.c"
		}
#line 1068 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1068 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1068 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 8699 "Photo.c"
	}
}


BackingPhotoRow* photo_get_raw_development_photo_row (Photo* self, RawDeveloper d) {
	BackingPhotoRow* result = NULL;
	GError * _inner_error_ = NULL;
#line 1073 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 8709 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 1074 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 1074 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 8716 "Photo.c"
		{
			BackingPhotoRow* _tmp1_ = NULL;
			GeeHashMap* _tmp2_ = NULL;
#line 1075 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = self->priv->developments;
#line 1075 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp2_ != NULL) {
#line 8724 "Photo.c"
				GeeHashMap* _tmp3_ = NULL;
				RawDeveloper _tmp4_ = 0;
				gpointer _tmp5_ = NULL;
#line 1075 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->priv->developments;
#line 1075 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = d;
#line 1075 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((gintptr) _tmp4_));
#line 1075 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (_tmp1_);
#line 1075 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = (BackingPhotoRow*) _tmp5_;
#line 8738 "Photo.c"
			} else {
#line 1075 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (_tmp1_);
#line 1075 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = NULL;
#line 8744 "Photo.c"
			}
#line 1075 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp1_;
#line 8748 "Photo.c"
			{
				PhotoRow* _tmp6_ = NULL;
#line 1074 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = self->row;
#line 1074 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 8755 "Photo.c"
			}
#line 1075 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 8759 "Photo.c"
		}
		__finally301:
		{
			PhotoRow* _tmp7_ = NULL;
#line 1074 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = self->row;
#line 1074 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 8768 "Photo.c"
		}
#line 1074 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1074 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1074 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 8776 "Photo.c"
	}
}


static PhotoFileFormat* _photo_file_format_dup (PhotoFileFormat* self) {
	PhotoFileFormat* dup;
#line 1085 "/home/jens/Source/shotwell/src/Photo.vala"
	dup = g_new0 (PhotoFileFormat, 1);
#line 1085 "/home/jens/Source/shotwell/src/Photo.vala"
	memcpy (dup, self, sizeof (PhotoFileFormat));
#line 1085 "/home/jens/Source/shotwell/src/Photo.vala"
	return dup;
#line 8789 "Photo.c"
}


static gpointer __photo_file_format_dup0 (gpointer self) {
#line 1085 "/home/jens/Source/shotwell/src/Photo.vala"
	return self ? _photo_file_format_dup (self) : NULL;
#line 8796 "Photo.c"
}


PhotoFileFormat* photo_get_editable_file_format (Photo* self) {
	PhotoFileFormat* result = NULL;
	PhotoFileReader* reader = NULL;
	PhotoFileReader* _tmp0_ = NULL;
	PhotoFileReader* _tmp1_ = NULL;
	PhotoFileReader* _tmp2_ = NULL;
	PhotoFileFormat _tmp3_ = 0;
	PhotoFileFormat* _tmp4_ = NULL;
#line 1079 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 1080 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_editable_reader (self);
#line 1080 "/home/jens/Source/shotwell/src/Photo.vala"
	reader = _tmp0_;
#line 1081 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = reader;
#line 1081 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_ == NULL) {
#line 1082 "/home/jens/Source/shotwell/src/Photo.vala"
		result = NULL;
#line 1082 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (reader);
#line 1082 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 8824 "Photo.c"
	}
#line 1085 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = reader;
#line 1085 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = photo_file_adapter_get_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 1085 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = __photo_file_format_dup0 (&_tmp3_);
#line 1085 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp4_;
#line 1085 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (reader);
#line 1085 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 8838 "Photo.c"
}


PhotoFileFormat photo_get_export_format_for_parameters (Photo* self, ExportFormatParameters* params) {
	PhotoFileFormat result = 0;
	PhotoFileFormat _result_ = 0;
	PhotoFileFormat _tmp0_ = 0;
	ExportFormatParameters _tmp1_ = {0};
	ExportFormatMode _tmp2_ = 0;
#line 1088 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), 0);
#line 1088 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (params != NULL, 0);
#line 1089 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_file_format_get_system_default_format ();
#line 1089 "/home/jens/Source/shotwell/src/Photo.vala"
	_result_ = _tmp0_;
#line 1091 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = *params;
#line 1091 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = _tmp1_.mode;
#line 1091 "/home/jens/Source/shotwell/src/Photo.vala"
	switch (_tmp2_) {
#line 1091 "/home/jens/Source/shotwell/src/Photo.vala"
		case EXPORT_FORMAT_MODE_UNMODIFIED:
#line 8864 "Photo.c"
		{
			PhotoFileFormat _tmp3_ = 0;
#line 1093 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = photo_get_master_file_format (self);
#line 1093 "/home/jens/Source/shotwell/src/Photo.vala"
			_result_ = _tmp3_;
#line 1094 "/home/jens/Source/shotwell/src/Photo.vala"
			break;
#line 8873 "Photo.c"
		}
#line 1091 "/home/jens/Source/shotwell/src/Photo.vala"
		case EXPORT_FORMAT_MODE_CURRENT:
#line 8877 "Photo.c"
		{
			PhotoFileFormat _tmp4_ = 0;
#line 1097 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = photo_get_best_export_file_format (self);
#line 1097 "/home/jens/Source/shotwell/src/Photo.vala"
			_result_ = _tmp4_;
#line 1098 "/home/jens/Source/shotwell/src/Photo.vala"
			break;
#line 8886 "Photo.c"
		}
#line 1091 "/home/jens/Source/shotwell/src/Photo.vala"
		case EXPORT_FORMAT_MODE_SPECIFIED:
#line 8890 "Photo.c"
		{
			ExportFormatParameters _tmp5_ = {0};
			PhotoFileFormat _tmp6_ = 0;
#line 1101 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = *params;
#line 1101 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = _tmp5_.specified_format;
#line 1101 "/home/jens/Source/shotwell/src/Photo.vala"
			_result_ = _tmp6_;
#line 1102 "/home/jens/Source/shotwell/src/Photo.vala"
			break;
#line 8902 "Photo.c"
		}
		default:
		{
#line 1105 "/home/jens/Source/shotwell/src/Photo.vala"
			g_error ("Photo.vala:1105: get_export_format_for_parameters: unsupported export " \
"format mode");
#line 8908 "Photo.c"
		}
	}
#line 1108 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _result_;
#line 1108 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 8915 "Photo.c"
}


gchar* photo_get_export_basename_for_parameters (Photo* self, ExportFormatParameters* params) {
	gchar* result = NULL;
	gchar* _result_ = NULL;
	ExportFormatParameters _tmp0_ = {0};
	ExportFormatMode _tmp1_ = 0;
	const gchar* _tmp8_ = NULL;
#line 1111 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 1111 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (params != NULL, NULL);
#line 1112 "/home/jens/Source/shotwell/src/Photo.vala"
	_result_ = NULL;
#line 1114 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = *params;
#line 1114 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_.mode;
#line 1114 "/home/jens/Source/shotwell/src/Photo.vala"
	switch (_tmp1_) {
#line 1114 "/home/jens/Source/shotwell/src/Photo.vala"
		case EXPORT_FORMAT_MODE_UNMODIFIED:
#line 8939 "Photo.c"
		{
			GFile* _tmp2_ = NULL;
			GFile* _tmp3_ = NULL;
			gchar* _tmp4_ = NULL;
#line 1116 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = media_source_get_master_file (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 1116 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = _tmp2_;
#line 1116 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = g_file_get_basename (_tmp3_);
#line 1116 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (_result_);
#line 1116 "/home/jens/Source/shotwell/src/Photo.vala"
			_result_ = _tmp4_;
#line 1116 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tmp3_);
#line 1117 "/home/jens/Source/shotwell/src/Photo.vala"
			break;
#line 8958 "Photo.c"
		}
#line 1114 "/home/jens/Source/shotwell/src/Photo.vala"
		case EXPORT_FORMAT_MODE_CURRENT:
#line 1114 "/home/jens/Source/shotwell/src/Photo.vala"
		case EXPORT_FORMAT_MODE_SPECIFIED:
#line 8964 "Photo.c"
		{
			ExportFormatParameters _tmp5_ = {0};
			PhotoFileFormat _tmp6_ = 0;
			gchar* _tmp7_ = NULL;
#line 1121 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = *params;
#line 1121 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = photo_get_export_format_for_parameters (self, &_tmp5_);
#line 1121 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = photo_get_export_basename (self, &_tmp6_);
#line 1121 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp7_;
#line 1121 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (_result_);
#line 1121 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 8981 "Photo.c"
		}
		default:
		{
#line 1124 "/home/jens/Source/shotwell/src/Photo.vala"
			g_error ("Photo.vala:1124: get_export_basename_for_parameters: unsupported expor" \
"t format mode");
#line 8987 "Photo.c"
		}
	}
#line 1127 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = _result_;
#line 1127 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_assert (_tmp8_ != NULL, "result != null");
#line 1128 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _result_;
#line 1128 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 8998 "Photo.c"
}


ImportResult photo_prepare_for_import (PhotoImportParams* params) {
	ImportResult result = 0;
	GFile* file = NULL;
	PhotoImportParams* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	GFileInfo* info = NULL;
	GFileInfo* _tmp7_ = NULL;
	GFileType _tmp8_ = 0;
	GFile* _tmp9_ = NULL;
	gboolean _tmp10_ = FALSE;
	GFile* _tmp14_ = NULL;
	gboolean _tmp15_ = FALSE;
	GTimeVal timestamp = {0};
	GFileInfo* _tmp19_ = NULL;
	GTimeVal _tmp20_ = {0};
	gboolean _tmp21_ = FALSE;
	gboolean _tmp22_ = FALSE;
	PhotoImportParams* _tmp23_ = NULL;
	const gchar* _tmp24_ = NULL;
	PhotoFileInterrogator* interrogator = NULL;
	GFile* _tmp32_ = NULL;
	PhotoImportParams* _tmp33_ = NULL;
	PhotoFileSnifferOptions _tmp34_ = 0;
	PhotoFileInterrogator* _tmp35_ = NULL;
	PhotoFileInterrogator* _tmp42_ = NULL;
	gboolean _tmp43_ = FALSE;
	DetectedPhotoInformation* detected = NULL;
	PhotoFileInterrogator* _tmp44_ = NULL;
	DetectedPhotoInformation* _tmp45_ = NULL;
	gboolean _tmp46_ = FALSE;
	DetectedPhotoInformation* _tmp47_ = NULL;
	PhotoImportParams* _tmp50_ = NULL;
	PhotoFileSnifferOptions _tmp51_ = 0;
	Orientation orientation = 0;
	time_t exposure_time = 0;
	gchar* title = NULL;
	gchar* _tmp64_ = NULL;
	gchar* comment = NULL;
	gchar* _tmp65_ = NULL;
	Rating rating = 0;
	DetectedPhotoInformation* _tmp66_ = NULL;
	PhotoMetadata* _tmp67_ = NULL;
	gboolean _tmp90_ = FALSE;
	gboolean _tmp91_ = FALSE;
	DetectedPhotoInformation* _tmp92_ = NULL;
	GdkColorspace _tmp93_ = 0;
	PhotoImportParams* _tmp101_ = NULL;
	PhotoRow* _tmp102_ = NULL;
	PhotoImportParams* _tmp103_ = NULL;
	PhotoRow* _tmp104_ = NULL;
	BackingPhotoRow* _tmp105_ = NULL;
	GFile* _tmp106_ = NULL;
	gchar* _tmp107_ = NULL;
	PhotoImportParams* _tmp108_ = NULL;
	PhotoRow* _tmp109_ = NULL;
	BackingPhotoRow* _tmp110_ = NULL;
	DetectedPhotoInformation* _tmp111_ = NULL;
	Dimensions _tmp112_ = {0};
	PhotoImportParams* _tmp113_ = NULL;
	PhotoRow* _tmp114_ = NULL;
	BackingPhotoRow* _tmp115_ = NULL;
	GFileInfo* _tmp116_ = NULL;
	gint64 _tmp117_ = 0LL;
	PhotoImportParams* _tmp118_ = NULL;
	PhotoRow* _tmp119_ = NULL;
	BackingPhotoRow* _tmp120_ = NULL;
	GTimeVal _tmp121_ = {0};
	glong _tmp122_ = 0L;
	PhotoImportParams* _tmp123_ = NULL;
	PhotoRow* _tmp124_ = NULL;
	time_t _tmp125_ = 0;
	PhotoImportParams* _tmp126_ = NULL;
	PhotoRow* _tmp127_ = NULL;
	Orientation _tmp128_ = 0;
	PhotoImportParams* _tmp129_ = NULL;
	PhotoRow* _tmp130_ = NULL;
	BackingPhotoRow* _tmp131_ = NULL;
	Orientation _tmp132_ = 0;
	PhotoImportParams* _tmp133_ = NULL;
	PhotoRow* _tmp134_ = NULL;
	PhotoImportParams* _tmp135_ = NULL;
	ImportID _tmp136_ = {0};
	PhotoImportParams* _tmp137_ = NULL;
	PhotoRow* _tmp138_ = NULL;
	PhotoImportParams* _tmp139_ = NULL;
	PhotoRow* _tmp140_ = NULL;
	PhotoImportParams* _tmp141_ = NULL;
	PhotoRow* _tmp142_ = NULL;
	DetectedPhotoInformation* _tmp143_ = NULL;
	const gchar* _tmp144_ = NULL;
	gchar* _tmp145_ = NULL;
	PhotoImportParams* _tmp146_ = NULL;
	PhotoRow* _tmp147_ = NULL;
	DetectedPhotoInformation* _tmp148_ = NULL;
	const gchar* _tmp149_ = NULL;
	gchar* _tmp150_ = NULL;
	PhotoImportParams* _tmp151_ = NULL;
	PhotoRow* _tmp152_ = NULL;
	DetectedPhotoInformation* _tmp153_ = NULL;
	const gchar* _tmp154_ = NULL;
	gchar* _tmp155_ = NULL;
	PhotoImportParams* _tmp156_ = NULL;
	PhotoRow* _tmp157_ = NULL;
	PhotoImportParams* _tmp158_ = NULL;
	PhotoRow* _tmp159_ = NULL;
	PhotoImportParams* _tmp160_ = NULL;
	PhotoRow* _tmp161_ = NULL;
	BackingPhotoRow* _tmp162_ = NULL;
	DetectedPhotoInformation* _tmp163_ = NULL;
	PhotoFileFormat _tmp164_ = 0;
	PhotoImportParams* _tmp165_ = NULL;
	PhotoRow* _tmp166_ = NULL;
	const gchar* _tmp167_ = NULL;
	gchar* _tmp168_ = NULL;
	PhotoImportParams* _tmp169_ = NULL;
	PhotoRow* _tmp170_ = NULL;
	const gchar* _tmp171_ = NULL;
	gchar* _tmp172_ = NULL;
	PhotoImportParams* _tmp173_ = NULL;
	PhotoRow* _tmp174_ = NULL;
	Rating _tmp175_ = 0;
	PhotoImportParams* _tmp176_ = NULL;
	Thumbnails* _tmp177_ = NULL;
	GError * _inner_error_ = NULL;
#line 1143 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO_IMPORT_PARAMS (params), 0);
#line 1147 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = params;
#line 1147 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_->file;
#line 1147 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = _g_object_ref0 (_tmp1_);
#line 1147 "/home/jens/Source/shotwell/src/Photo.vala"
	file = _tmp2_;
#line 1149 "/home/jens/Source/shotwell/src/Photo.vala"
	info = NULL;
#line 9139 "Photo.c"
	{
		GFileInfo* _tmp3_ = NULL;
		GFile* _tmp4_ = NULL;
		GFileInfo* _tmp5_ = NULL;
		GFileInfo* _tmp6_ = NULL;
#line 1151 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = file;
#line 1151 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = g_file_query_info (_tmp4_, DIRECTORY_MONITOR_SUPPLIED_ATTRIBUTES, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &_inner_error_);
#line 1151 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = _tmp5_;
#line 1151 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 9153 "Photo.c"
			goto __catch302_g_error;
		}
#line 1151 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = _tmp3_;
#line 1151 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = NULL;
#line 1151 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 1151 "/home/jens/Source/shotwell/src/Photo.vala"
		info = _tmp6_;
#line 1150 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp3_);
#line 9166 "Photo.c"
	}
	goto __finally302;
	__catch302_g_error:
	{
		GError* err = NULL;
#line 1150 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 1150 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 1154 "/home/jens/Source/shotwell/src/Photo.vala"
		result = IMPORT_RESULT_FILE_ERROR;
#line 1154 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 1154 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 1154 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 1154 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 9186 "Photo.c"
	}
	__finally302:
#line 1150 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1150 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 1150 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 1150 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1150 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1150 "/home/jens/Source/shotwell/src/Photo.vala"
		return 0;
#line 9201 "Photo.c"
	}
#line 1157 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = info;
#line 1157 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = g_file_info_get_file_type (_tmp7_);
#line 1157 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp8_ != G_FILE_TYPE_REGULAR) {
#line 1158 "/home/jens/Source/shotwell/src/Photo.vala"
		result = IMPORT_RESULT_NOT_A_FILE;
#line 1158 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 1158 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 1158 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 9217 "Photo.c"
	}
#line 1160 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = file;
#line 1160 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = photo_is_file_image (_tmp9_);
#line 1160 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp10_) {
#line 9225 "Photo.c"
		GFile* _tmp11_ = NULL;
		gchar* _tmp12_ = NULL;
		gchar* _tmp13_ = NULL;
#line 1161 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = file;
#line 1161 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = g_file_get_path (_tmp11_);
#line 1161 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp13_ = _tmp12_;
#line 1161 "/home/jens/Source/shotwell/src/Photo.vala"
		g_message ("Photo.vala:1161: Not importing %s: Not an image file", _tmp13_);
#line 1161 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp13_);
#line 1163 "/home/jens/Source/shotwell/src/Photo.vala"
		result = IMPORT_RESULT_NOT_AN_IMAGE;
#line 1163 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 1163 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 1163 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 9247 "Photo.c"
	}
#line 1166 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = file;
#line 1166 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = photo_file_format_is_file_supported (_tmp14_);
#line 1166 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp15_) {
#line 9255 "Photo.c"
		GFile* _tmp16_ = NULL;
		gchar* _tmp17_ = NULL;
		gchar* _tmp18_ = NULL;
#line 1167 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = file;
#line 1167 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp17_ = g_file_get_path (_tmp16_);
#line 1167 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp18_ = _tmp17_;
#line 1167 "/home/jens/Source/shotwell/src/Photo.vala"
		g_message ("Photo.vala:1167: Not importing %s: Unsupported extension", _tmp18_);
#line 1167 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp18_);
#line 1169 "/home/jens/Source/shotwell/src/Photo.vala"
		result = IMPORT_RESULT_UNSUPPORTED_FORMAT;
#line 1169 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 1169 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 1169 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 9277 "Photo.c"
	}
#line 1172 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp19_ = info;
#line 1172 "/home/jens/Source/shotwell/src/Photo.vala"
	g_file_info_get_modification_time (_tmp19_, &_tmp20_);
#line 1172 "/home/jens/Source/shotwell/src/Photo.vala"
	timestamp = _tmp20_;
#line 1175 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp23_ = params;
#line 1175 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp24_ = _tmp23_->exif_md5;
#line 1175 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp24_ != NULL) {
#line 9291 "Photo.c"
		PhotoImportParams* _tmp25_ = NULL;
		const gchar* _tmp26_ = NULL;
#line 1175 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp25_ = params;
#line 1175 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp26_ = _tmp25_->thumbnail_md5;
#line 1175 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp22_ = _tmp26_ != NULL;
#line 9300 "Photo.c"
	} else {
#line 1175 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp22_ = FALSE;
#line 9304 "Photo.c"
	}
#line 1175 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp22_) {
#line 9308 "Photo.c"
		PhotoImportParams* _tmp27_ = NULL;
		const gchar* _tmp28_ = NULL;
#line 1175 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp27_ = params;
#line 1175 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp28_ = _tmp27_->full_md5;
#line 1175 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = _tmp28_ != NULL;
#line 9317 "Photo.c"
	} else {
#line 1175 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = FALSE;
#line 9321 "Photo.c"
	}
#line 1175 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp21_) {
#line 9325 "Photo.c"
		PhotoImportParams* _tmp29_ = NULL;
		PhotoImportParams* _tmp30_ = NULL;
		PhotoFileSnifferOptions _tmp31_ = 0;
#line 1176 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp29_ = params;
#line 1176 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp30_ = params;
#line 1176 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp31_ = _tmp30_->sniffer_options;
#line 1176 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp30_->sniffer_options = _tmp31_ | PHOTO_FILE_SNIFFER_OPTIONS_NO_MD5;
#line 9337 "Photo.c"
	}
#line 1179 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp32_ = file;
#line 1179 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp33_ = params;
#line 1179 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp34_ = _tmp33_->sniffer_options;
#line 1179 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp35_ = photo_file_interrogator_new (_tmp32_, _tmp34_);
#line 1179 "/home/jens/Source/shotwell/src/Photo.vala"
	interrogator = _tmp35_;
#line 9349 "Photo.c"
	{
		PhotoFileInterrogator* _tmp36_ = NULL;
#line 1181 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp36_ = interrogator;
#line 1181 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_file_interrogator_interrogate (_tmp36_, &_inner_error_);
#line 1181 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 9358 "Photo.c"
			goto __catch303_g_error;
		}
	}
	goto __finally303;
	__catch303_g_error:
	{
		GError* err = NULL;
		GFile* _tmp37_ = NULL;
		gchar* _tmp38_ = NULL;
		gchar* _tmp39_ = NULL;
		GError* _tmp40_ = NULL;
		const gchar* _tmp41_ = NULL;
#line 1180 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 1180 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 1183 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp37_ = file;
#line 1183 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp38_ = g_file_get_path (_tmp37_);
#line 1183 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp39_ = _tmp38_;
#line 1183 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp40_ = err;
#line 1183 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp41_ = _tmp40_->message;
#line 1183 "/home/jens/Source/shotwell/src/Photo.vala"
		g_warning ("Photo.vala:1183: Unable to interrogate photo file %s: %s", _tmp39_, _tmp41_);
#line 1183 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp39_);
#line 1185 "/home/jens/Source/shotwell/src/Photo.vala"
		result = IMPORT_RESULT_DECODE_ERROR;
#line 1185 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 1185 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_interrogator_unref0 (interrogator);
#line 1185 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 1185 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 1185 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 9401 "Photo.c"
	}
	__finally303:
#line 1180 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1180 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_interrogator_unref0 (interrogator);
#line 1180 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 1180 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 1180 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1180 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1180 "/home/jens/Source/shotwell/src/Photo.vala"
		return 0;
#line 9418 "Photo.c"
	}
#line 1188 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp42_ = interrogator;
#line 1188 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp43_ = photo_file_interrogator_get_is_photo_corrupted (_tmp42_);
#line 1188 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp43_) {
#line 1189 "/home/jens/Source/shotwell/src/Photo.vala"
		result = IMPORT_RESULT_NOT_AN_IMAGE;
#line 1189 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_interrogator_unref0 (interrogator);
#line 1189 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 1189 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 1189 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 9436 "Photo.c"
	}
#line 1192 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp44_ = interrogator;
#line 1192 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp45_ = photo_file_interrogator_get_detected_photo_information (_tmp44_);
#line 1192 "/home/jens/Source/shotwell/src/Photo.vala"
	detected = _tmp45_;
#line 1193 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp47_ = detected;
#line 1193 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp47_ == NULL) {
#line 1193 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp46_ = TRUE;
#line 9450 "Photo.c"
	} else {
		DetectedPhotoInformation* _tmp48_ = NULL;
		PhotoFileFormat _tmp49_ = 0;
#line 1193 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp48_ = detected;
#line 1193 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp49_ = _tmp48_->file_format;
#line 1193 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp46_ = _tmp49_ == PHOTO_FILE_FORMAT_UNKNOWN;
#line 9460 "Photo.c"
	}
#line 1193 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp46_) {
#line 1194 "/home/jens/Source/shotwell/src/Photo.vala"
		result = IMPORT_RESULT_UNSUPPORTED_FORMAT;
#line 1194 "/home/jens/Source/shotwell/src/Photo.vala"
		_detected_photo_information_unref0 (detected);
#line 1194 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_interrogator_unref0 (interrogator);
#line 1194 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 1194 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 1194 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 9476 "Photo.c"
	}
#line 1197 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp50_ = params;
#line 1197 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp51_ = _tmp50_->sniffer_options;
#line 1197 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((_tmp51_ & PHOTO_FILE_SNIFFER_OPTIONS_NO_MD5) != 0) {
#line 9484 "Photo.c"
		DetectedPhotoInformation* _tmp52_ = NULL;
		PhotoImportParams* _tmp53_ = NULL;
		const gchar* _tmp54_ = NULL;
		gchar* _tmp55_ = NULL;
		DetectedPhotoInformation* _tmp56_ = NULL;
		PhotoImportParams* _tmp57_ = NULL;
		const gchar* _tmp58_ = NULL;
		gchar* _tmp59_ = NULL;
		DetectedPhotoInformation* _tmp60_ = NULL;
		PhotoImportParams* _tmp61_ = NULL;
		const gchar* _tmp62_ = NULL;
		gchar* _tmp63_ = NULL;
#line 1198 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp52_ = detected;
#line 1198 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp53_ = params;
#line 1198 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp54_ = _tmp53_->exif_md5;
#line 1198 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp55_ = g_strdup (_tmp54_);
#line 1198 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp52_->exif_md5);
#line 1198 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp52_->exif_md5 = _tmp55_;
#line 1199 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp56_ = detected;
#line 1199 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp57_ = params;
#line 1199 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp58_ = _tmp57_->thumbnail_md5;
#line 1199 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp59_ = g_strdup (_tmp58_);
#line 1199 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp56_->thumbnail_md5);
#line 1199 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp56_->thumbnail_md5 = _tmp59_;
#line 1200 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp60_ = detected;
#line 1200 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp61_ = params;
#line 1200 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp62_ = _tmp61_->full_md5;
#line 1200 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp63_ = g_strdup (_tmp62_);
#line 1200 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp60_->md5);
#line 1200 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp60_->md5 = _tmp63_;
#line 9533 "Photo.c"
	}
#line 1203 "/home/jens/Source/shotwell/src/Photo.vala"
	orientation = ORIENTATION_TOP_LEFT;
#line 1204 "/home/jens/Source/shotwell/src/Photo.vala"
	exposure_time = (time_t) 0;
#line 1205 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp64_ = g_strdup ("");
#line 1205 "/home/jens/Source/shotwell/src/Photo.vala"
	title = _tmp64_;
#line 1206 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp65_ = g_strdup ("");
#line 1206 "/home/jens/Source/shotwell/src/Photo.vala"
	comment = _tmp65_;
#line 1207 "/home/jens/Source/shotwell/src/Photo.vala"
	rating = RATING_UNRATED;
#line 1214 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp66_ = detected;
#line 1214 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp67_ = _tmp66_->metadata;
#line 1214 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp67_ != NULL) {
#line 9555 "Photo.c"
		MetadataDateTime* date_time = NULL;
		DetectedPhotoInformation* _tmp68_ = NULL;
		PhotoMetadata* _tmp69_ = NULL;
		MetadataDateTime* _tmp70_ = NULL;
		MetadataDateTime* _tmp71_ = NULL;
		DetectedPhotoInformation* _tmp74_ = NULL;
		PhotoMetadata* _tmp75_ = NULL;
		Orientation _tmp76_ = 0;
		DetectedPhotoInformation* _tmp77_ = NULL;
		PhotoMetadata* _tmp78_ = NULL;
		gchar* _tmp79_ = NULL;
		DetectedPhotoInformation* _tmp80_ = NULL;
		PhotoMetadata* _tmp81_ = NULL;
		gchar* _tmp82_ = NULL;
		PhotoImportParams* _tmp83_ = NULL;
		DetectedPhotoInformation* _tmp84_ = NULL;
		PhotoMetadata* _tmp85_ = NULL;
		GeeSet* _tmp86_ = NULL;
		DetectedPhotoInformation* _tmp87_ = NULL;
		PhotoMetadata* _tmp88_ = NULL;
		Rating _tmp89_ = 0;
#line 1215 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp68_ = detected;
#line 1215 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp69_ = _tmp68_->metadata;
#line 1215 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp70_ = photo_metadata_get_exposure_date_time (_tmp69_);
#line 1215 "/home/jens/Source/shotwell/src/Photo.vala"
		date_time = _tmp70_;
#line 1216 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp71_ = date_time;
#line 1216 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp71_ != NULL) {
#line 9589 "Photo.c"
			MetadataDateTime* _tmp72_ = NULL;
			time_t _tmp73_ = 0;
#line 1217 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp72_ = date_time;
#line 1217 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp73_ = metadata_date_time_get_timestamp (_tmp72_);
#line 1217 "/home/jens/Source/shotwell/src/Photo.vala"
			exposure_time = _tmp73_;
#line 9598 "Photo.c"
		}
#line 1219 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp74_ = detected;
#line 1219 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp75_ = _tmp74_->metadata;
#line 1219 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp76_ = photo_metadata_get_orientation (_tmp75_);
#line 1219 "/home/jens/Source/shotwell/src/Photo.vala"
		orientation = _tmp76_;
#line 1220 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp77_ = detected;
#line 1220 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp78_ = _tmp77_->metadata;
#line 1220 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp79_ = media_metadata_get_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp78_, TYPE_MEDIA_METADATA, MediaMetadata));
#line 1220 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (title);
#line 1220 "/home/jens/Source/shotwell/src/Photo.vala"
		title = _tmp79_;
#line 1221 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp80_ = detected;
#line 1221 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp81_ = _tmp80_->metadata;
#line 1221 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp82_ = media_metadata_get_comment (G_TYPE_CHECK_INSTANCE_CAST (_tmp81_, TYPE_MEDIA_METADATA, MediaMetadata));
#line 1221 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (comment);
#line 1221 "/home/jens/Source/shotwell/src/Photo.vala"
		comment = _tmp82_;
#line 1222 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp83_ = params;
#line 1222 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp84_ = detected;
#line 1222 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp85_ = _tmp84_->metadata;
#line 1222 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp86_ = photo_metadata_get_keywords (_tmp85_, NULL, NULL, NULL);
#line 1222 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp83_->keywords);
#line 1222 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp83_->keywords = G_TYPE_CHECK_INSTANCE_CAST (_tmp86_, GEE_TYPE_COLLECTION, GeeCollection);
#line 1223 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp87_ = detected;
#line 1223 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp88_ = _tmp87_->metadata;
#line 1223 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp89_ = photo_metadata_get_rating (_tmp88_);
#line 1223 "/home/jens/Source/shotwell/src/Photo.vala"
		rating = _tmp89_;
#line 1214 "/home/jens/Source/shotwell/src/Photo.vala"
		_metadata_date_time_unref0 (date_time);
#line 9650 "Photo.c"
	}
#line 1227 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp92_ = detected;
#line 1227 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp93_ = _tmp92_->colorspace;
#line 1227 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp93_ != GDK_COLORSPACE_RGB) {
#line 1227 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp91_ = TRUE;
#line 9660 "Photo.c"
	} else {
		DetectedPhotoInformation* _tmp94_ = NULL;
		gint _tmp95_ = 0;
#line 1228 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp94_ = detected;
#line 1228 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp95_ = _tmp94_->channels;
#line 1228 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp91_ = _tmp95_ < 3;
#line 9670 "Photo.c"
	}
#line 1227 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp91_) {
#line 1227 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp90_ = TRUE;
#line 9676 "Photo.c"
	} else {
		DetectedPhotoInformation* _tmp96_ = NULL;
		gint _tmp97_ = 0;
#line 1229 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp96_ = detected;
#line 1229 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp97_ = _tmp96_->bits_per_channel;
#line 1229 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp90_ = _tmp97_ != 8;
#line 9686 "Photo.c"
	}
#line 1227 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp90_) {
#line 9690 "Photo.c"
		GFile* _tmp98_ = NULL;
		gchar* _tmp99_ = NULL;
		gchar* _tmp100_ = NULL;
#line 1230 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp98_ = file;
#line 1230 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp99_ = g_file_get_path (_tmp98_);
#line 1230 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp100_ = _tmp99_;
#line 1230 "/home/jens/Source/shotwell/src/Photo.vala"
		g_message ("Photo.vala:1230: Not importing %s: Unsupported color format", _tmp100_);
#line 1230 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp100_);
#line 1232 "/home/jens/Source/shotwell/src/Photo.vala"
		result = IMPORT_RESULT_UNSUPPORTED_FORMAT;
#line 1232 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (comment);
#line 1232 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (title);
#line 1232 "/home/jens/Source/shotwell/src/Photo.vala"
		_detected_photo_information_unref0 (detected);
#line 1232 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_interrogator_unref0 (interrogator);
#line 1232 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 1232 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 1232 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 9720 "Photo.c"
	}
#line 1238 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp101_ = params;
#line 1238 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp102_ = _tmp101_->row;
#line 1238 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_id_init (&_tmp102_->photo_id, PHOTO_ID_INVALID);
#line 1239 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp103_ = params;
#line 1239 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp104_ = _tmp103_->row;
#line 1239 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp105_ = _tmp104_->master;
#line 1239 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp106_ = file;
#line 1239 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp107_ = g_file_get_path (_tmp106_);
#line 1239 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp105_->filepath);
#line 1239 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp105_->filepath = _tmp107_;
#line 1240 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp108_ = params;
#line 1240 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp109_ = _tmp108_->row;
#line 1240 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp110_ = _tmp109_->master;
#line 1240 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp111_ = detected;
#line 1240 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp112_ = _tmp111_->image_dim;
#line 1240 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp110_->dim = _tmp112_;
#line 1241 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp113_ = params;
#line 1241 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp114_ = _tmp113_->row;
#line 1241 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp115_ = _tmp114_->master;
#line 1241 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp116_ = info;
#line 1241 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp117_ = g_file_info_get_size (_tmp116_);
#line 1241 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp115_->filesize = _tmp117_;
#line 1242 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp118_ = params;
#line 1242 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp119_ = _tmp118_->row;
#line 1242 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp120_ = _tmp119_->master;
#line 1242 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp121_ = timestamp;
#line 1242 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp122_ = _tmp121_.tv_sec;
#line 1242 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp120_->timestamp = (time_t) _tmp122_;
#line 1243 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp123_ = params;
#line 1243 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp124_ = _tmp123_->row;
#line 1243 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp125_ = exposure_time;
#line 1243 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp124_->exposure_time = _tmp125_;
#line 1244 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp126_ = params;
#line 1244 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp127_ = _tmp126_->row;
#line 1244 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp128_ = orientation;
#line 1244 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp127_->orientation = _tmp128_;
#line 1245 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp129_ = params;
#line 1245 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp130_ = _tmp129_->row;
#line 1245 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp131_ = _tmp130_->master;
#line 1245 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp132_ = orientation;
#line 1245 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp131_->original_orientation = _tmp132_;
#line 1246 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp133_ = params;
#line 1246 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp134_ = _tmp133_->row;
#line 1246 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp135_ = params;
#line 1246 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp136_ = _tmp135_->import_id;
#line 1246 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp134_->import_id = _tmp136_;
#line 1247 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp137_ = params;
#line 1247 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp138_ = _tmp137_->row;
#line 1247 "/home/jens/Source/shotwell/src/Photo.vala"
	event_id_init (&_tmp138_->event_id, EVENT_ID_INVALID);
#line 1248 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp139_ = params;
#line 1248 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp140_ = _tmp139_->row;
#line 1248 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp140_->transformations);
#line 1248 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp140_->transformations = NULL;
#line 1249 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp141_ = params;
#line 1249 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp142_ = _tmp141_->row;
#line 1249 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp143_ = detected;
#line 1249 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp144_ = _tmp143_->md5;
#line 1249 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp145_ = g_strdup (_tmp144_);
#line 1249 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp142_->md5);
#line 1249 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp142_->md5 = _tmp145_;
#line 1250 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp146_ = params;
#line 1250 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp147_ = _tmp146_->row;
#line 1250 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp148_ = detected;
#line 1250 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp149_ = _tmp148_->thumbnail_md5;
#line 1250 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp150_ = g_strdup (_tmp149_);
#line 1250 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp147_->thumbnail_md5);
#line 1250 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp147_->thumbnail_md5 = _tmp150_;
#line 1251 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp151_ = params;
#line 1251 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp152_ = _tmp151_->row;
#line 1251 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp153_ = detected;
#line 1251 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp154_ = _tmp153_->exif_md5;
#line 1251 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp155_ = g_strdup (_tmp154_);
#line 1251 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp152_->exif_md5);
#line 1251 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp152_->exif_md5 = _tmp155_;
#line 1252 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp156_ = params;
#line 1252 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp157_ = _tmp156_->row;
#line 1252 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp157_->time_created = (time_t) 0;
#line 1253 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp158_ = params;
#line 1253 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp159_ = _tmp158_->row;
#line 1253 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp159_->flags = (guint64) 0;
#line 1254 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp160_ = params;
#line 1254 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp161_ = _tmp160_->row;
#line 1254 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp162_ = _tmp161_->master;
#line 1254 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp163_ = detected;
#line 1254 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp164_ = _tmp163_->file_format;
#line 1254 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp162_->file_format = _tmp164_;
#line 1255 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp165_ = params;
#line 1255 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp166_ = _tmp165_->row;
#line 1255 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp167_ = title;
#line 1255 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp168_ = g_strdup (_tmp167_);
#line 1255 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp166_->title);
#line 1255 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp166_->title = _tmp168_;
#line 1256 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp169_ = params;
#line 1256 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp170_ = _tmp169_->row;
#line 1256 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp171_ = comment;
#line 1256 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp172_ = g_strdup (_tmp171_);
#line 1256 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp170_->comment);
#line 1256 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp170_->comment = _tmp172_;
#line 1257 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp173_ = params;
#line 1257 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp174_ = _tmp173_->row;
#line 1257 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp175_ = rating;
#line 1257 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp174_->rating = _tmp175_;
#line 1259 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp176_ = params;
#line 1259 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp177_ = _tmp176_->thumbnails;
#line 1259 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp177_ != NULL) {
#line 9932 "Photo.c"
		PhotoFileReader* reader = NULL;
		PhotoImportParams* _tmp178_ = NULL;
		PhotoRow* _tmp179_ = NULL;
		BackingPhotoRow* _tmp180_ = NULL;
		PhotoFileFormat _tmp181_ = 0;
		PhotoImportParams* _tmp182_ = NULL;
		PhotoRow* _tmp183_ = NULL;
		BackingPhotoRow* _tmp184_ = NULL;
		const gchar* _tmp185_ = NULL;
		PhotoFileReader* _tmp186_ = NULL;
		PhotoFileReader* _tmp187_ = NULL;
#line 1260 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp178_ = params;
#line 1260 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp179_ = _tmp178_->row;
#line 1260 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp180_ = _tmp179_->master;
#line 1260 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp181_ = _tmp180_->file_format;
#line 1260 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp182_ = params;
#line 1260 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp183_ = _tmp182_->row;
#line 1260 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp184_ = _tmp183_->master;
#line 1260 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp185_ = _tmp184_->filepath;
#line 1260 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp186_ = photo_file_format_create_reader (_tmp181_, _tmp185_);
#line 1260 "/home/jens/Source/shotwell/src/Photo.vala"
		reader = _tmp186_;
#line 1262 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp187_ = reader;
#line 1262 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_file_reader_set_role (_tmp187_, PHOTO_FILE_READER_ROLE_THUMBNAIL);
#line 9968 "Photo.c"
		{
			PhotoImportParams* _tmp188_ = NULL;
			Thumbnails* _tmp189_ = NULL;
			PhotoFileReader* _tmp190_ = NULL;
			PhotoImportParams* _tmp191_ = NULL;
			PhotoRow* _tmp192_ = NULL;
			Orientation _tmp193_ = 0;
			PhotoImportParams* _tmp194_ = NULL;
			PhotoRow* _tmp195_ = NULL;
			BackingPhotoRow* _tmp196_ = NULL;
			Dimensions _tmp197_ = {0};
#line 1264 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp188_ = params;
#line 1264 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp189_ = _tmp188_->thumbnails;
#line 1264 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp190_ = reader;
#line 1264 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp191_ = params;
#line 1264 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp192_ = _tmp191_->row;
#line 1264 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp193_ = _tmp192_->orientation;
#line 1264 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp194_ = params;
#line 1264 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp195_ = _tmp194_->row;
#line 1264 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp196_ = _tmp195_->master;
#line 1264 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp197_ = _tmp196_->dim;
#line 1264 "/home/jens/Source/shotwell/src/Photo.vala"
			thumbnail_cache_generate_for_photo (_tmp189_, _tmp190_, _tmp193_, &_tmp197_, &_inner_error_);
#line 1264 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 10004 "Photo.c"
				goto __catch304_g_error;
			}
		}
		goto __finally304;
		__catch304_g_error:
		{
			GError* err = NULL;
			GError* _tmp198_ = NULL;
			ImportResult _tmp199_ = 0;
#line 1263 "/home/jens/Source/shotwell/src/Photo.vala"
			err = _inner_error_;
#line 1263 "/home/jens/Source/shotwell/src/Photo.vala"
			_inner_error_ = NULL;
#line 1267 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp198_ = err;
#line 1267 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp199_ = import_result_convert_error (_tmp198_, IMPORT_RESULT_FILE_ERROR);
#line 1267 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp199_;
#line 1267 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_error_free0 (err);
#line 1267 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_adapter_unref0 (reader);
#line 1267 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (comment);
#line 1267 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (title);
#line 1267 "/home/jens/Source/shotwell/src/Photo.vala"
			_detected_photo_information_unref0 (detected);
#line 1267 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_interrogator_unref0 (interrogator);
#line 1267 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (info);
#line 1267 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (file);
#line 1267 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 10042 "Photo.c"
		}
		__finally304:
#line 1263 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1263 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_adapter_unref0 (reader);
#line 1263 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (comment);
#line 1263 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (title);
#line 1263 "/home/jens/Source/shotwell/src/Photo.vala"
			_detected_photo_information_unref0 (detected);
#line 1263 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_interrogator_unref0 (interrogator);
#line 1263 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (info);
#line 1263 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (file);
#line 1263 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1263 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 1263 "/home/jens/Source/shotwell/src/Photo.vala"
			return 0;
#line 10067 "Photo.c"
		}
#line 1259 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (reader);
#line 10071 "Photo.c"
	}
#line 1274 "/home/jens/Source/shotwell/src/Photo.vala"
	result = IMPORT_RESULT_SUCCESS;
#line 1274 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (comment);
#line 1274 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (title);
#line 1274 "/home/jens/Source/shotwell/src/Photo.vala"
	_detected_photo_information_unref0 (detected);
#line 1274 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_interrogator_unref0 (interrogator);
#line 1274 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (info);
#line 1274 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (file);
#line 1274 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 10089 "Photo.c"
}


void photo_create_pre_import (PhotoImportParams* params) {
	GFile* file = NULL;
	PhotoImportParams* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	PhotoImportParams* _tmp3_ = NULL;
	PhotoRow* _tmp4_ = NULL;
	PhotoImportParams* _tmp5_ = NULL;
	PhotoRow* _tmp6_ = NULL;
	BackingPhotoRow* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	PhotoImportParams* _tmp9_ = NULL;
	PhotoRow* _tmp10_ = NULL;
	BackingPhotoRow* _tmp11_ = NULL;
	PhotoImportParams* _tmp12_ = NULL;
	PhotoRow* _tmp13_ = NULL;
	BackingPhotoRow* _tmp14_ = NULL;
	PhotoImportParams* _tmp15_ = NULL;
	PhotoRow* _tmp16_ = NULL;
	BackingPhotoRow* _tmp17_ = NULL;
	PhotoImportParams* _tmp18_ = NULL;
	PhotoRow* _tmp19_ = NULL;
	PhotoImportParams* _tmp20_ = NULL;
	PhotoRow* _tmp21_ = NULL;
	PhotoImportParams* _tmp22_ = NULL;
	PhotoRow* _tmp23_ = NULL;
	BackingPhotoRow* _tmp24_ = NULL;
	PhotoImportParams* _tmp25_ = NULL;
	PhotoRow* _tmp26_ = NULL;
	PhotoImportParams* _tmp27_ = NULL;
	ImportID _tmp28_ = {0};
	PhotoImportParams* _tmp29_ = NULL;
	PhotoRow* _tmp30_ = NULL;
	PhotoImportParams* _tmp31_ = NULL;
	PhotoRow* _tmp32_ = NULL;
	PhotoImportParams* _tmp33_ = NULL;
	PhotoRow* _tmp34_ = NULL;
	PhotoImportParams* _tmp35_ = NULL;
	PhotoRow* _tmp36_ = NULL;
	PhotoImportParams* _tmp37_ = NULL;
	PhotoRow* _tmp38_ = NULL;
	PhotoImportParams* _tmp39_ = NULL;
	PhotoRow* _tmp40_ = NULL;
	PhotoImportParams* _tmp41_ = NULL;
	PhotoRow* _tmp42_ = NULL;
	PhotoImportParams* _tmp43_ = NULL;
	PhotoRow* _tmp44_ = NULL;
	BackingPhotoRow* _tmp45_ = NULL;
	PhotoImportParams* _tmp46_ = NULL;
	PhotoRow* _tmp47_ = NULL;
	PhotoImportParams* _tmp48_ = NULL;
	PhotoRow* _tmp49_ = NULL;
	PhotoImportParams* _tmp50_ = NULL;
	PhotoRow* _tmp51_ = NULL;
	PhotoFileInterrogator* interrogator = NULL;
	PhotoImportParams* _tmp52_ = NULL;
	GFile* _tmp53_ = NULL;
	PhotoImportParams* _tmp54_ = NULL;
	PhotoFileSnifferOptions _tmp55_ = 0;
	PhotoFileInterrogator* _tmp56_ = NULL;
	GError * _inner_error_ = NULL;
#line 1277 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO_IMPORT_PARAMS (params));
#line 1278 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = params;
#line 1278 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_->file;
#line 1278 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = _g_object_ref0 (_tmp1_);
#line 1278 "/home/jens/Source/shotwell/src/Photo.vala"
	file = _tmp2_;
#line 1279 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = params;
#line 1279 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = _tmp3_->row;
#line 1279 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_id_init (&_tmp4_->photo_id, PHOTO_ID_INVALID);
#line 1280 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = params;
#line 1280 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = _tmp5_->row;
#line 1280 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = _tmp6_->master;
#line 1280 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = g_file_get_path (file);
#line 1280 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp7_->filepath);
#line 1280 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_->filepath = _tmp8_;
#line 1281 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = params;
#line 1281 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = _tmp9_->row;
#line 1281 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = _tmp10_->master;
#line 1281 "/home/jens/Source/shotwell/src/Photo.vala"
	dimensions_init (&_tmp11_->dim, 0, 0);
#line 1282 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = params;
#line 1282 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = _tmp12_->row;
#line 1282 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = _tmp13_->master;
#line 1282 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_->filesize = (gint64) 0;
#line 1283 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = params;
#line 1283 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_ = _tmp15_->row;
#line 1283 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = _tmp16_->master;
#line 1283 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_->timestamp = (time_t) 0;
#line 1284 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp18_ = params;
#line 1284 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp19_ = _tmp18_->row;
#line 1284 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp19_->exposure_time = (time_t) 0;
#line 1285 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp20_ = params;
#line 1285 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp21_ = _tmp20_->row;
#line 1285 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp21_->orientation = ORIENTATION_TOP_LEFT;
#line 1286 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_ = params;
#line 1286 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp23_ = _tmp22_->row;
#line 1286 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp24_ = _tmp23_->master;
#line 1286 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp24_->original_orientation = ORIENTATION_TOP_LEFT;
#line 1287 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp25_ = params;
#line 1287 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp26_ = _tmp25_->row;
#line 1287 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp27_ = params;
#line 1287 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp28_ = _tmp27_->import_id;
#line 1287 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp26_->import_id = _tmp28_;
#line 1288 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp29_ = params;
#line 1288 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp30_ = _tmp29_->row;
#line 1288 "/home/jens/Source/shotwell/src/Photo.vala"
	event_id_init (&_tmp30_->event_id, EVENT_ID_INVALID);
#line 1289 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp31_ = params;
#line 1289 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp32_ = _tmp31_->row;
#line 1289 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp32_->transformations);
#line 1289 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp32_->transformations = NULL;
#line 1290 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp33_ = params;
#line 1290 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp34_ = _tmp33_->row;
#line 1290 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp34_->md5);
#line 1290 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp34_->md5 = NULL;
#line 1291 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp35_ = params;
#line 1291 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp36_ = _tmp35_->row;
#line 1291 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp36_->thumbnail_md5);
#line 1291 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp36_->thumbnail_md5 = NULL;
#line 1292 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp37_ = params;
#line 1292 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp38_ = _tmp37_->row;
#line 1292 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp38_->exif_md5);
#line 1292 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp38_->exif_md5 = NULL;
#line 1293 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp39_ = params;
#line 1293 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp40_ = _tmp39_->row;
#line 1293 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp40_->time_created = (time_t) 0;
#line 1294 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp41_ = params;
#line 1294 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp42_ = _tmp41_->row;
#line 1294 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp42_->flags = (guint64) 0;
#line 1295 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp43_ = params;
#line 1295 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp44_ = _tmp43_->row;
#line 1295 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp45_ = _tmp44_->master;
#line 1295 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp45_->file_format = PHOTO_FILE_FORMAT_JFIF;
#line 1296 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp46_ = params;
#line 1296 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp47_ = _tmp46_->row;
#line 1296 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp47_->title);
#line 1296 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp47_->title = NULL;
#line 1297 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp48_ = params;
#line 1297 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp49_ = _tmp48_->row;
#line 1297 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp49_->comment);
#line 1297 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp49_->comment = NULL;
#line 1298 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp50_ = params;
#line 1298 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp51_ = _tmp50_->row;
#line 1298 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp51_->rating = RATING_UNRATED;
#line 1300 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp52_ = params;
#line 1300 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp53_ = _tmp52_->file;
#line 1300 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp54_ = params;
#line 1300 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp55_ = _tmp54_->sniffer_options;
#line 1300 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp56_ = photo_file_interrogator_new (_tmp53_, _tmp55_);
#line 1300 "/home/jens/Source/shotwell/src/Photo.vala"
	interrogator = _tmp56_;
#line 10328 "Photo.c"
	{
		DetectedPhotoInformation* detected = NULL;
		DetectedPhotoInformation* _tmp57_ = NULL;
		gboolean _tmp58_ = FALSE;
		gboolean _tmp59_ = FALSE;
		DetectedPhotoInformation* _tmp60_ = NULL;
#line 1302 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_file_interrogator_interrogate (interrogator, &_inner_error_);
#line 1302 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 10339 "Photo.c"
			goto __catch305_g_error;
		}
#line 1303 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp57_ = photo_file_interrogator_get_detected_photo_information (interrogator);
#line 1303 "/home/jens/Source/shotwell/src/Photo.vala"
		detected = _tmp57_;
#line 1304 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp60_ = detected;
#line 1304 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp60_ != NULL) {
#line 10350 "Photo.c"
			gboolean _tmp61_ = FALSE;
#line 1304 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp61_ = photo_file_interrogator_get_is_photo_corrupted (interrogator);
#line 1304 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp59_ = !_tmp61_;
#line 10356 "Photo.c"
		} else {
#line 1304 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp59_ = FALSE;
#line 10360 "Photo.c"
		}
#line 1304 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp59_) {
#line 10364 "Photo.c"
			DetectedPhotoInformation* _tmp62_ = NULL;
			PhotoFileFormat _tmp63_ = 0;
#line 1304 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp62_ = detected;
#line 1304 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp63_ = _tmp62_->file_format;
#line 1304 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp58_ = _tmp63_ != PHOTO_FILE_FORMAT_UNKNOWN;
#line 10373 "Photo.c"
		} else {
#line 1304 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp58_ = FALSE;
#line 10377 "Photo.c"
		}
#line 1304 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp58_) {
#line 10381 "Photo.c"
			PhotoImportParams* _tmp64_ = NULL;
			PhotoRow* _tmp65_ = NULL;
			BackingPhotoRow* _tmp66_ = NULL;
			DetectedPhotoInformation* _tmp67_ = NULL;
			PhotoFileFormat _tmp68_ = 0;
#line 1305 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp64_ = params;
#line 1305 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp65_ = _tmp64_->row;
#line 1305 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp66_ = _tmp65_->master;
#line 1305 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp67_ = detected;
#line 1305 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp68_ = _tmp67_->file_format;
#line 1305 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp66_->file_format = _tmp68_;
#line 10399 "Photo.c"
		}
#line 1301 "/home/jens/Source/shotwell/src/Photo.vala"
		_detected_photo_information_unref0 (detected);
#line 10403 "Photo.c"
	}
	goto __finally305;
	__catch305_g_error:
	{
		GError* err = NULL;
		gchar* _tmp69_ = NULL;
		gchar* _tmp70_ = NULL;
		GError* _tmp71_ = NULL;
		const gchar* _tmp72_ = NULL;
#line 1301 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 1301 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 1307 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp69_ = g_file_get_path (file);
#line 1307 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp70_ = _tmp69_;
#line 1307 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp71_ = err;
#line 1307 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp72_ = _tmp71_->message;
#line 1307 "/home/jens/Source/shotwell/src/Photo.vala"
		g_debug ("Photo.vala:1307: Unable to interrogate photo file %s: %s", _tmp70_, _tmp72_);
#line 1307 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp70_);
#line 1301 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 10431 "Photo.c"
	}
	__finally305:
#line 1301 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1301 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_interrogator_unref0 (interrogator);
#line 1301 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 1301 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1301 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1301 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 10446 "Photo.c"
	}
#line 1277 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_interrogator_unref0 (interrogator);
#line 1277 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (file);
#line 10452 "Photo.c"
}


BackingPhotoRow* photo_query_backing_photo_row (Photo* self, GFile* file, PhotoFileSnifferOptions options, DetectedPhotoInformation** detected, GError** error) {
	DetectedPhotoInformation* _vala_detected = NULL;
	BackingPhotoRow* result = NULL;
	BackingPhotoRow* backing = NULL;
	BackingPhotoRow* _tmp0_ = NULL;
	GFileInfo* info = NULL;
	PhotoFileInterrogator* interrogator = NULL;
	GFile* _tmp10_ = NULL;
	PhotoFileSnifferOptions _tmp11_ = 0;
	PhotoFileInterrogator* _tmp12_ = NULL;
	PhotoFileInterrogator* _tmp13_ = NULL;
	PhotoFileInterrogator* _tmp14_ = NULL;
	DetectedPhotoInformation* _tmp15_ = NULL;
	gboolean _tmp16_ = FALSE;
	DetectedPhotoInformation* _tmp17_ = NULL;
	GTimeVal modification_time = {0};
	GFileInfo* _tmp22_ = NULL;
	GTimeVal _tmp23_ = {0};
	BackingPhotoRow* _tmp24_ = NULL;
	GFile* _tmp25_ = NULL;
	gchar* _tmp26_ = NULL;
	BackingPhotoRow* _tmp27_ = NULL;
	GTimeVal _tmp28_ = {0};
	glong _tmp29_ = 0L;
	BackingPhotoRow* _tmp30_ = NULL;
	GFileInfo* _tmp31_ = NULL;
	gint64 _tmp32_ = 0LL;
	BackingPhotoRow* _tmp33_ = NULL;
	DetectedPhotoInformation* _tmp34_ = NULL;
	PhotoFileFormat _tmp35_ = 0;
	BackingPhotoRow* _tmp36_ = NULL;
	DetectedPhotoInformation* _tmp37_ = NULL;
	Dimensions _tmp38_ = {0};
	Orientation _tmp39_ = 0;
	DetectedPhotoInformation* _tmp40_ = NULL;
	PhotoMetadata* _tmp41_ = NULL;
	BackingPhotoRow* _tmp45_ = NULL;
	GError * _inner_error_ = NULL;
#line 1311 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 1311 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_IS_FILE (file), NULL);
#line 1313 "/home/jens/Source/shotwell/src/Photo.vala"
	_detected_photo_information_unref0 (_vala_detected);
#line 1313 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_detected = NULL;
#line 1315 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = backing_photo_row_new ();
#line 1315 "/home/jens/Source/shotwell/src/Photo.vala"
	backing = _tmp0_;
#line 1317 "/home/jens/Source/shotwell/src/Photo.vala"
	info = NULL;
#line 10508 "Photo.c"
	{
		GFileInfo* _tmp1_ = NULL;
		GFile* _tmp2_ = NULL;
		GFileInfo* _tmp3_ = NULL;
		GFileInfo* _tmp4_ = NULL;
#line 1319 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = file;
#line 1319 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = g_file_query_info (_tmp2_, DIRECTORY_MONITOR_SUPPLIED_ATTRIBUTES, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &_inner_error_);
#line 1319 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = _tmp3_;
#line 1319 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 10522 "Photo.c"
			goto __catch306_g_error;
		}
#line 1319 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = _tmp1_;
#line 1319 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = NULL;
#line 1319 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 1319 "/home/jens/Source/shotwell/src/Photo.vala"
		info = _tmp4_;
#line 1318 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp1_);
#line 10535 "Photo.c"
	}
	goto __finally306;
	__catch306_g_error:
	{
		GError* err = NULL;
		GFile* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
		GError* _tmp8_ = NULL;
		const gchar* _tmp9_ = NULL;
#line 1318 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 1318 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 1322 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = file;
#line 1322 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = g_file_get_path (_tmp5_);
#line 1322 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = _tmp6_;
#line 1322 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = err;
#line 1322 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp9_ = _tmp8_->message;
#line 1322 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("Photo.vala:1322: Unable to read file information for %s: %s", _tmp7_, _tmp9_);
#line 1322 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp7_);
#line 1324 "/home/jens/Source/shotwell/src/Photo.vala"
		result = NULL;
#line 1324 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 1324 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 1324 "/home/jens/Source/shotwell/src/Photo.vala"
		_backing_photo_row_unref0 (backing);
#line 1324 "/home/jens/Source/shotwell/src/Photo.vala"
		if (detected) {
#line 1324 "/home/jens/Source/shotwell/src/Photo.vala"
			*detected = _vala_detected;
#line 10576 "Photo.c"
		} else {
#line 1324 "/home/jens/Source/shotwell/src/Photo.vala"
			_detected_photo_information_unref0 (_vala_detected);
#line 10580 "Photo.c"
		}
#line 1324 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 10584 "Photo.c"
	}
	__finally306:
#line 1318 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1318 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 1318 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 1318 "/home/jens/Source/shotwell/src/Photo.vala"
		_backing_photo_row_unref0 (backing);
#line 1318 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 10597 "Photo.c"
	}
#line 1328 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = file;
#line 1328 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = options;
#line 1328 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = photo_file_interrogator_new (_tmp10_, _tmp11_);
#line 1328 "/home/jens/Source/shotwell/src/Photo.vala"
	interrogator = _tmp12_;
#line 1329 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = interrogator;
#line 1329 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_file_interrogator_interrogate (_tmp13_, &_inner_error_);
#line 1329 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1329 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 1329 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_interrogator_unref0 (interrogator);
#line 1329 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 1329 "/home/jens/Source/shotwell/src/Photo.vala"
		_backing_photo_row_unref0 (backing);
#line 1329 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 10623 "Photo.c"
	}
#line 1330 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = interrogator;
#line 1330 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = photo_file_interrogator_get_detected_photo_information (_tmp14_);
#line 1330 "/home/jens/Source/shotwell/src/Photo.vala"
	_detected_photo_information_unref0 (_vala_detected);
#line 1330 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_detected = _tmp15_;
#line 1331 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = _vala_detected;
#line 1331 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp17_ == NULL) {
#line 1331 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = TRUE;
#line 10639 "Photo.c"
	} else {
		PhotoFileInterrogator* _tmp18_ = NULL;
		gboolean _tmp19_ = FALSE;
#line 1331 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp18_ = interrogator;
#line 1331 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp19_ = photo_file_interrogator_get_is_photo_corrupted (_tmp18_);
#line 1331 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = _tmp19_;
#line 10649 "Photo.c"
	}
#line 1331 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp16_) {
#line 10653 "Photo.c"
		gchar* _tmp20_ = NULL;
		gchar* _tmp21_ = NULL;
#line 1332 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 1332 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = _tmp20_;
#line 1332 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("Photo.vala:1332: Photo update: %s no longer a recognized image", _tmp21_);
#line 1332 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp21_);
#line 1334 "/home/jens/Source/shotwell/src/Photo.vala"
		result = NULL;
#line 1334 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_interrogator_unref0 (interrogator);
#line 1334 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 1334 "/home/jens/Source/shotwell/src/Photo.vala"
		_backing_photo_row_unref0 (backing);
#line 1334 "/home/jens/Source/shotwell/src/Photo.vala"
		if (detected) {
#line 1334 "/home/jens/Source/shotwell/src/Photo.vala"
			*detected = _vala_detected;
#line 10676 "Photo.c"
		} else {
#line 1334 "/home/jens/Source/shotwell/src/Photo.vala"
			_detected_photo_information_unref0 (_vala_detected);
#line 10680 "Photo.c"
		}
#line 1334 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 10684 "Photo.c"
	}
#line 1337 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_ = info;
#line 1337 "/home/jens/Source/shotwell/src/Photo.vala"
	g_file_info_get_modification_time (_tmp22_, &_tmp23_);
#line 1337 "/home/jens/Source/shotwell/src/Photo.vala"
	modification_time = _tmp23_;
#line 1339 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp24_ = backing;
#line 1339 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp25_ = file;
#line 1339 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp26_ = g_file_get_path (_tmp25_);
#line 1339 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp24_->filepath);
#line 1339 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp24_->filepath = _tmp26_;
#line 1340 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp27_ = backing;
#line 1340 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp28_ = modification_time;
#line 1340 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp29_ = _tmp28_.tv_sec;
#line 1340 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp27_->timestamp = (time_t) _tmp29_;
#line 1341 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp30_ = backing;
#line 1341 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp31_ = info;
#line 1341 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp32_ = g_file_info_get_size (_tmp31_);
#line 1341 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp30_->filesize = _tmp32_;
#line 1342 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp33_ = backing;
#line 1342 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp34_ = _vala_detected;
#line 1342 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp35_ = _tmp34_->file_format;
#line 1342 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp33_->file_format = _tmp35_;
#line 1343 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp36_ = backing;
#line 1343 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp37_ = _vala_detected;
#line 1343 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp38_ = _tmp37_->image_dim;
#line 1343 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp36_->dim = _tmp38_;
#line 1344 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp40_ = _vala_detected;
#line 1344 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp41_ = _tmp40_->metadata;
#line 1344 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp41_ != NULL) {
#line 10740 "Photo.c"
		DetectedPhotoInformation* _tmp42_ = NULL;
		PhotoMetadata* _tmp43_ = NULL;
		Orientation _tmp44_ = 0;
#line 1345 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp42_ = _vala_detected;
#line 1345 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp43_ = _tmp42_->metadata;
#line 1345 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp44_ = photo_metadata_get_orientation (_tmp43_);
#line 1345 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp39_ = _tmp44_;
#line 10752 "Photo.c"
	} else {
#line 1345 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp39_ = ORIENTATION_TOP_LEFT;
#line 10756 "Photo.c"
	}
#line 1344 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp45_ = backing;
#line 1344 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp45_->original_orientation = _tmp39_;
#line 1347 "/home/jens/Source/shotwell/src/Photo.vala"
	result = backing;
#line 1347 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_interrogator_unref0 (interrogator);
#line 1347 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (info);
#line 1347 "/home/jens/Source/shotwell/src/Photo.vala"
	if (detected) {
#line 1347 "/home/jens/Source/shotwell/src/Photo.vala"
		*detected = _vala_detected;
#line 10772 "Photo.c"
	} else {
#line 1347 "/home/jens/Source/shotwell/src/Photo.vala"
		_detected_photo_information_unref0 (_vala_detected);
#line 10776 "Photo.c"
	}
#line 1347 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 10780 "Photo.c"
}


static void _vala_array_add89 (gchar*** array, int* length, int* size, gchar* value) {
#line 1443 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 1443 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 1443 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 10791 "Photo.c"
	}
#line 1443 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 1443 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 10797 "Photo.c"
}


static void _vala_array_add90 (gchar*** array, int* length, int* size, gchar* value) {
#line 1446 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 1446 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 1446 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 10808 "Photo.c"
	}
#line 1446 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 1446 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 10814 "Photo.c"
}


static void _vala_array_add91 (gchar*** array, int* length, int* size, gchar* value) {
#line 1453 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 1453 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 1453 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 10825 "Photo.c"
	}
#line 1453 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 1453 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 10831 "Photo.c"
}


static void _vala_array_add92 (gchar*** array, int* length, int* size, gchar* value) {
#line 1456 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 1456 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 1456 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 10842 "Photo.c"
	}
#line 1456 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 1456 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 10848 "Photo.c"
}


static void _vala_array_add93 (gchar*** array, int* length, int* size, gchar* value) {
#line 1459 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 1459 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 1459 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 10859 "Photo.c"
	}
#line 1459 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 1459 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 10865 "Photo.c"
}


static void _vala_array_add94 (gchar*** array, int* length, int* size, gchar* value) {
#line 1462 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 1462 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 1462 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 10876 "Photo.c"
	}
#line 1462 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 1462 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 10882 "Photo.c"
}


static gpointer _media_metadata_ref0 (gpointer self) {
#line 1472 "/home/jens/Source/shotwell/src/Photo.vala"
	return self ? media_metadata_ref (self) : NULL;
#line 10889 "Photo.c"
}


gboolean photo_prepare_for_reimport_master (Photo* self, PhotoReimportMasterState** reimport_state, GError** error) {
	PhotoReimportMasterState* _vala_reimport_state = NULL;
	gboolean result = FALSE;
	GFile* file = NULL;
	PhotoFileReader* _tmp0_ = NULL;
	PhotoFileReader* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	GFile* _tmp3_ = NULL;
	DetectedPhotoInformation* detected = NULL;
	BackingPhotoRow* backing = NULL;
	GFile* _tmp4_ = NULL;
	DetectedPhotoInformation* _tmp5_ = NULL;
	BackingPhotoRow* _tmp6_ = NULL;
	BackingPhotoRow* _tmp8_ = NULL;
	gboolean _tmp12_ = FALSE;
	gboolean _tmp13_ = FALSE;
	DetectedPhotoInformation* _tmp14_ = NULL;
	GdkColorspace _tmp15_ = 0;
	PhotoRow* updated_row = NULL;
	PhotoRow* _tmp23_ = NULL;
	gchar** list = NULL;
	gchar** _tmp29_ = NULL;
	gint list_length1 = 0;
	gint _list_size_ = 0;
	PhotoRow* _tmp30_ = NULL;
	const gchar* _tmp31_ = NULL;
	DetectedPhotoInformation* _tmp32_ = NULL;
	const gchar* _tmp33_ = NULL;
	PhotoRow* _tmp36_ = NULL;
	BackingPhotoRow* _tmp37_ = NULL;
	Orientation _tmp38_ = 0;
	BackingPhotoRow* _tmp39_ = NULL;
	Orientation _tmp40_ = 0;
	DetectedPhotoInformation* _tmp47_ = NULL;
	PhotoMetadata* _tmp48_ = NULL;
	PhotoRow* _tmp85_ = NULL;
	BackingPhotoRow* _tmp86_ = NULL;
	BackingPhotoRow* _tmp87_ = NULL;
	PhotoRow* _tmp88_ = NULL;
	DetectedPhotoInformation* _tmp89_ = NULL;
	const gchar* _tmp90_ = NULL;
	gchar* _tmp91_ = NULL;
	PhotoRow* _tmp92_ = NULL;
	DetectedPhotoInformation* _tmp93_ = NULL;
	const gchar* _tmp94_ = NULL;
	gchar* _tmp95_ = NULL;
	PhotoRow* _tmp96_ = NULL;
	DetectedPhotoInformation* _tmp97_ = NULL;
	const gchar* _tmp98_ = NULL;
	gchar* _tmp99_ = NULL;
	PhotoMetadata* metadata = NULL;
	DetectedPhotoInformation* _tmp100_ = NULL;
	PhotoMetadata* _tmp101_ = NULL;
	PhotoRow* _tmp124_ = NULL;
	PhotoMetadata* _tmp125_ = NULL;
	gchar** _tmp126_ = NULL;
	gint _tmp126__length1 = 0;
	PhotoReimportMasterStateImpl* _tmp127_ = NULL;
	GError * _inner_error_ = NULL;
#line 1411 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 1412 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_reimport_master_state_unref0 (_vala_reimport_state);
#line 1412 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_reimport_state = NULL;
#line 1414 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_master_reader (self);
#line 1414 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 1414 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 1414 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp2_;
#line 1414 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (_tmp1_);
#line 1414 "/home/jens/Source/shotwell/src/Photo.vala"
	file = _tmp3_;
#line 1417 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = file;
#line 1417 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = photo_query_backing_photo_row (self, _tmp4_, PHOTO_FILE_SNIFFER_OPTIONS_GET_ALL, &_tmp5_, &_inner_error_);
#line 1417 "/home/jens/Source/shotwell/src/Photo.vala"
	_detected_photo_information_unref0 (detected);
#line 1417 "/home/jens/Source/shotwell/src/Photo.vala"
	detected = _tmp5_;
#line 1417 "/home/jens/Source/shotwell/src/Photo.vala"
	backing = _tmp6_;
#line 1417 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 10982 "Photo.c"
		gboolean _tmp7_ = FALSE;
#line 1417 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 1417 "/home/jens/Source/shotwell/src/Photo.vala"
		_detected_photo_information_unref0 (detected);
#line 1417 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 1417 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp7_;
#line 10992 "Photo.c"
	}
#line 1419 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = backing;
#line 1419 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp8_ == NULL) {
#line 10998 "Photo.c"
		GFile* _tmp9_ = NULL;
		gchar* _tmp10_ = NULL;
		gchar* _tmp11_ = NULL;
#line 1420 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp9_ = file;
#line 1420 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp10_ = g_file_get_path (_tmp9_);
#line 1420 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = _tmp10_;
#line 1420 "/home/jens/Source/shotwell/src/Photo.vala"
		g_warning ("Photo.vala:1420: Unable to retrieve photo state from %s for reimport", _tmp11_);
#line 1420 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp11_);
#line 1421 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 1421 "/home/jens/Source/shotwell/src/Photo.vala"
		_backing_photo_row_unref0 (backing);
#line 1421 "/home/jens/Source/shotwell/src/Photo.vala"
		_detected_photo_information_unref0 (detected);
#line 1421 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 1421 "/home/jens/Source/shotwell/src/Photo.vala"
		if (reimport_state) {
#line 1421 "/home/jens/Source/shotwell/src/Photo.vala"
			*reimport_state = _vala_reimport_state;
#line 11024 "Photo.c"
		} else {
#line 1421 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_reimport_master_state_unref0 (_vala_reimport_state);
#line 11028 "Photo.c"
		}
#line 1421 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 11032 "Photo.c"
	}
#line 1425 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = detected;
#line 1425 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = _tmp14_->colorspace;
#line 1425 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp15_ != GDK_COLORSPACE_RGB) {
#line 1425 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp13_ = TRUE;
#line 11042 "Photo.c"
	} else {
		DetectedPhotoInformation* _tmp16_ = NULL;
		gint _tmp17_ = 0;
#line 1426 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = detected;
#line 1426 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp17_ = _tmp16_->channels;
#line 1426 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp13_ = _tmp17_ < 3;
#line 11052 "Photo.c"
	}
#line 1425 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp13_) {
#line 1425 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = TRUE;
#line 11058 "Photo.c"
	} else {
		DetectedPhotoInformation* _tmp18_ = NULL;
		gint _tmp19_ = 0;
#line 1427 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp18_ = detected;
#line 1427 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp19_ = _tmp18_->bits_per_channel;
#line 1427 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = _tmp19_ != 8;
#line 11068 "Photo.c"
	}
#line 1425 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp12_) {
#line 11072 "Photo.c"
		GFile* _tmp20_ = NULL;
		gchar* _tmp21_ = NULL;
		gchar* _tmp22_ = NULL;
#line 1428 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = file;
#line 1428 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = g_file_get_path (_tmp20_);
#line 1428 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp22_ = _tmp21_;
#line 1428 "/home/jens/Source/shotwell/src/Photo.vala"
		g_warning ("Photo.vala:1428: Not re-importing %s: Unsupported color format", _tmp22_);
#line 1428 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp22_);
#line 1430 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 1430 "/home/jens/Source/shotwell/src/Photo.vala"
		_backing_photo_row_unref0 (backing);
#line 1430 "/home/jens/Source/shotwell/src/Photo.vala"
		_detected_photo_information_unref0 (detected);
#line 1430 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 1430 "/home/jens/Source/shotwell/src/Photo.vala"
		if (reimport_state) {
#line 1430 "/home/jens/Source/shotwell/src/Photo.vala"
			*reimport_state = _vala_reimport_state;
#line 11098 "Photo.c"
		} else {
#line 1430 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_reimport_master_state_unref0 (_vala_reimport_state);
#line 11102 "Photo.c"
		}
#line 1430 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 11106 "Photo.c"
	}
#line 1434 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp23_ = photo_row_new ();
#line 1434 "/home/jens/Source/shotwell/src/Photo.vala"
	updated_row = _tmp23_;
#line 11112 "Photo.c"
	{
		PhotoRow* _tmp24_ = NULL;
#line 1435 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp24_ = self->row;
#line 1435 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 11119 "Photo.c"
		{
			PhotoRow* _tmp25_ = NULL;
			PhotoRow* _tmp26_ = NULL;
#line 1436 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp25_ = self->row;
#line 1436 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp26_ = _photo_row_ref0 (_tmp25_);
#line 1436 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_row_unref0 (updated_row);
#line 1436 "/home/jens/Source/shotwell/src/Photo.vala"
			updated_row = _tmp26_;
#line 11131 "Photo.c"
		}
		__finally307:
		{
			PhotoRow* _tmp27_ = NULL;
#line 1435 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp27_ = self->row;
#line 1435 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 11140 "Photo.c"
		}
#line 1435 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 11144 "Photo.c"
			gboolean _tmp28_ = FALSE;
#line 1435 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 1435 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_row_unref0 (updated_row);
#line 1435 "/home/jens/Source/shotwell/src/Photo.vala"
			_backing_photo_row_unref0 (backing);
#line 1435 "/home/jens/Source/shotwell/src/Photo.vala"
			_detected_photo_information_unref0 (detected);
#line 1435 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (file);
#line 1435 "/home/jens/Source/shotwell/src/Photo.vala"
			return _tmp28_;
#line 11158 "Photo.c"
		}
	}
#line 1440 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp29_ = g_new0 (gchar*, 0 + 1);
#line 1440 "/home/jens/Source/shotwell/src/Photo.vala"
	list = _tmp29_;
#line 1440 "/home/jens/Source/shotwell/src/Photo.vala"
	list_length1 = 0;
#line 1440 "/home/jens/Source/shotwell/src/Photo.vala"
	_list_size_ = list_length1;
#line 1442 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp30_ = updated_row;
#line 1442 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp31_ = _tmp30_->md5;
#line 1442 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp32_ = detected;
#line 1442 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp33_ = _tmp32_->md5;
#line 1442 "/home/jens/Source/shotwell/src/Photo.vala"
	if (g_strcmp0 (_tmp31_, _tmp33_) != 0) {
#line 11179 "Photo.c"
		gchar** _tmp34_ = NULL;
		gint _tmp34__length1 = 0;
		gchar* _tmp35_ = NULL;
#line 1443 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp34_ = list;
#line 1443 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp34__length1 = list_length1;
#line 1443 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp35_ = g_strdup ("metadata:md5");
#line 1443 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_array_add89 (&list, &list_length1, &_list_size_, _tmp35_);
#line 11191 "Photo.c"
	}
#line 1445 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp36_ = updated_row;
#line 1445 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp37_ = _tmp36_->master;
#line 1445 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp38_ = _tmp37_->original_orientation;
#line 1445 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp39_ = backing;
#line 1445 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp40_ = _tmp39_->original_orientation;
#line 1445 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp38_ != _tmp40_) {
#line 11205 "Photo.c"
		gchar** _tmp41_ = NULL;
		gint _tmp41__length1 = 0;
		gchar* _tmp42_ = NULL;
		PhotoRow* _tmp43_ = NULL;
		BackingPhotoRow* _tmp44_ = NULL;
		BackingPhotoRow* _tmp45_ = NULL;
		Orientation _tmp46_ = 0;
#line 1446 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp41_ = list;
#line 1446 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp41__length1 = list_length1;
#line 1446 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp42_ = g_strdup ("image:orientation");
#line 1446 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_array_add90 (&list, &list_length1, &_list_size_, _tmp42_);
#line 1447 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp43_ = updated_row;
#line 1447 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp44_ = _tmp43_->master;
#line 1447 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp45_ = backing;
#line 1447 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp46_ = _tmp45_->original_orientation;
#line 1447 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp44_->original_orientation = _tmp46_;
#line 11231 "Photo.c"
	}
#line 1450 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp47_ = detected;
#line 1450 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp48_ = _tmp47_->metadata;
#line 1450 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp48_ != NULL) {
#line 11239 "Photo.c"
		MetadataDateTime* date_time = NULL;
		DetectedPhotoInformation* _tmp49_ = NULL;
		PhotoMetadata* _tmp50_ = NULL;
		MetadataDateTime* _tmp51_ = NULL;
		gboolean _tmp52_ = FALSE;
		MetadataDateTime* _tmp53_ = NULL;
		PhotoRow* _tmp60_ = NULL;
		const gchar* _tmp61_ = NULL;
		DetectedPhotoInformation* _tmp62_ = NULL;
		PhotoMetadata* _tmp63_ = NULL;
		gchar* _tmp64_ = NULL;
		gchar* _tmp65_ = NULL;
		gboolean _tmp66_ = FALSE;
		PhotoRow* _tmp69_ = NULL;
		const gchar* _tmp70_ = NULL;
		DetectedPhotoInformation* _tmp71_ = NULL;
		PhotoMetadata* _tmp72_ = NULL;
		gchar* _tmp73_ = NULL;
		gchar* _tmp74_ = NULL;
		gboolean _tmp75_ = FALSE;
		PhotoRow* _tmp78_ = NULL;
		Rating _tmp79_ = 0;
		DetectedPhotoInformation* _tmp80_ = NULL;
		PhotoMetadata* _tmp81_ = NULL;
		Rating _tmp82_ = 0;
#line 1451 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp49_ = detected;
#line 1451 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp50_ = _tmp49_->metadata;
#line 1451 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp51_ = photo_metadata_get_exposure_date_time (_tmp50_);
#line 1451 "/home/jens/Source/shotwell/src/Photo.vala"
		date_time = _tmp51_;
#line 1452 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp53_ = date_time;
#line 1452 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp53_ != NULL) {
#line 11277 "Photo.c"
			PhotoRow* _tmp54_ = NULL;
			time_t _tmp55_ = 0;
			MetadataDateTime* _tmp56_ = NULL;
			time_t _tmp57_ = 0;
#line 1452 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp54_ = updated_row;
#line 1452 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp55_ = _tmp54_->exposure_time;
#line 1452 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp56_ = date_time;
#line 1452 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp57_ = metadata_date_time_get_timestamp (_tmp56_);
#line 1452 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp52_ = _tmp55_ != _tmp57_;
#line 11292 "Photo.c"
		} else {
#line 1452 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp52_ = FALSE;
#line 11296 "Photo.c"
		}
#line 1452 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp52_) {
#line 11300 "Photo.c"
			gchar** _tmp58_ = NULL;
			gint _tmp58__length1 = 0;
			gchar* _tmp59_ = NULL;
#line 1453 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp58_ = list;
#line 1453 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp58__length1 = list_length1;
#line 1453 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp59_ = g_strdup ("metadata:exposure-time");
#line 1453 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_array_add91 (&list, &list_length1, &_list_size_, _tmp59_);
#line 11312 "Photo.c"
		}
#line 1455 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp60_ = updated_row;
#line 1455 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp61_ = _tmp60_->title;
#line 1455 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp62_ = detected;
#line 1455 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp63_ = _tmp62_->metadata;
#line 1455 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp64_ = media_metadata_get_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp63_, TYPE_MEDIA_METADATA, MediaMetadata));
#line 1455 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp65_ = _tmp64_;
#line 1455 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp66_ = g_strcmp0 (_tmp61_, _tmp65_) != 0;
#line 1455 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp65_);
#line 1455 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp66_) {
#line 11332 "Photo.c"
			gchar** _tmp67_ = NULL;
			gint _tmp67__length1 = 0;
			gchar* _tmp68_ = NULL;
#line 1456 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp67_ = list;
#line 1456 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp67__length1 = list_length1;
#line 1456 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp68_ = g_strdup ("metadata:name");
#line 1456 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_array_add92 (&list, &list_length1, &_list_size_, _tmp68_);
#line 11344 "Photo.c"
		}
#line 1458 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp69_ = updated_row;
#line 1458 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp70_ = _tmp69_->comment;
#line 1458 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp71_ = detected;
#line 1458 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp72_ = _tmp71_->metadata;
#line 1458 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp73_ = media_metadata_get_comment (G_TYPE_CHECK_INSTANCE_CAST (_tmp72_, TYPE_MEDIA_METADATA, MediaMetadata));
#line 1458 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp74_ = _tmp73_;
#line 1458 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp75_ = g_strcmp0 (_tmp70_, _tmp74_) != 0;
#line 1458 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp74_);
#line 1458 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp75_) {
#line 11364 "Photo.c"
			gchar** _tmp76_ = NULL;
			gint _tmp76__length1 = 0;
			gchar* _tmp77_ = NULL;
#line 1459 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp76_ = list;
#line 1459 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp76__length1 = list_length1;
#line 1459 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp77_ = g_strdup ("metadata:comment");
#line 1459 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_array_add93 (&list, &list_length1, &_list_size_, _tmp77_);
#line 11376 "Photo.c"
		}
#line 1461 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp78_ = updated_row;
#line 1461 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp79_ = _tmp78_->rating;
#line 1461 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp80_ = detected;
#line 1461 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp81_ = _tmp80_->metadata;
#line 1461 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp82_ = photo_metadata_get_rating (_tmp81_);
#line 1461 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp79_ != _tmp82_) {
#line 11390 "Photo.c"
			gchar** _tmp83_ = NULL;
			gint _tmp83__length1 = 0;
			gchar* _tmp84_ = NULL;
#line 1462 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp83_ = list;
#line 1462 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp83__length1 = list_length1;
#line 1462 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp84_ = g_strdup ("metadata:rating");
#line 1462 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_array_add94 (&list, &list_length1, &_list_size_, _tmp84_);
#line 11402 "Photo.c"
		}
#line 1450 "/home/jens/Source/shotwell/src/Photo.vala"
		_metadata_date_time_unref0 (date_time);
#line 11406 "Photo.c"
	}
#line 1465 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp85_ = updated_row;
#line 1465 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp86_ = backing;
#line 1465 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp87_ = _backing_photo_row_ref0 (_tmp86_);
#line 1465 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (_tmp85_->master);
#line 1465 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp85_->master = _tmp87_;
#line 1466 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp88_ = updated_row;
#line 1466 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp89_ = detected;
#line 1466 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp90_ = _tmp89_->md5;
#line 1466 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp91_ = g_strdup (_tmp90_);
#line 1466 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp88_->md5);
#line 1466 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp88_->md5 = _tmp91_;
#line 1467 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp92_ = updated_row;
#line 1467 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp93_ = detected;
#line 1467 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp94_ = _tmp93_->exif_md5;
#line 1467 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp95_ = g_strdup (_tmp94_);
#line 1467 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp92_->exif_md5);
#line 1467 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp92_->exif_md5 = _tmp95_;
#line 1468 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp96_ = updated_row;
#line 1468 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp97_ = detected;
#line 1468 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp98_ = _tmp97_->thumbnail_md5;
#line 1468 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp99_ = g_strdup (_tmp98_);
#line 1468 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp96_->thumbnail_md5);
#line 1468 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp96_->thumbnail_md5 = _tmp99_;
#line 1470 "/home/jens/Source/shotwell/src/Photo.vala"
	metadata = NULL;
#line 1471 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp100_ = detected;
#line 1471 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp101_ = _tmp100_->metadata;
#line 1471 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp101_ != NULL) {
#line 11462 "Photo.c"
		DetectedPhotoInformation* _tmp102_ = NULL;
		PhotoMetadata* _tmp103_ = NULL;
		PhotoMetadata* _tmp104_ = NULL;
		MetadataDateTime* date_time = NULL;
		DetectedPhotoInformation* _tmp105_ = NULL;
		PhotoMetadata* _tmp106_ = NULL;
		MetadataDateTime* _tmp107_ = NULL;
		MetadataDateTime* _tmp108_ = NULL;
		PhotoRow* _tmp112_ = NULL;
		DetectedPhotoInformation* _tmp113_ = NULL;
		PhotoMetadata* _tmp114_ = NULL;
		gchar* _tmp115_ = NULL;
		PhotoRow* _tmp116_ = NULL;
		DetectedPhotoInformation* _tmp117_ = NULL;
		PhotoMetadata* _tmp118_ = NULL;
		gchar* _tmp119_ = NULL;
		PhotoRow* _tmp120_ = NULL;
		DetectedPhotoInformation* _tmp121_ = NULL;
		PhotoMetadata* _tmp122_ = NULL;
		Rating _tmp123_ = 0;
#line 1472 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp102_ = detected;
#line 1472 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp103_ = _tmp102_->metadata;
#line 1472 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp104_ = _media_metadata_ref0 (_tmp103_);
#line 1472 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (metadata);
#line 1472 "/home/jens/Source/shotwell/src/Photo.vala"
		metadata = _tmp104_;
#line 1474 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp105_ = detected;
#line 1474 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp106_ = _tmp105_->metadata;
#line 1474 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp107_ = photo_metadata_get_exposure_date_time (_tmp106_);
#line 1474 "/home/jens/Source/shotwell/src/Photo.vala"
		date_time = _tmp107_;
#line 1475 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp108_ = date_time;
#line 1475 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp108_ != NULL) {
#line 11505 "Photo.c"
			PhotoRow* _tmp109_ = NULL;
			MetadataDateTime* _tmp110_ = NULL;
			time_t _tmp111_ = 0;
#line 1476 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp109_ = updated_row;
#line 1476 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp110_ = date_time;
#line 1476 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp111_ = metadata_date_time_get_timestamp (_tmp110_);
#line 1476 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp109_->exposure_time = _tmp111_;
#line 11517 "Photo.c"
		}
#line 1478 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp112_ = updated_row;
#line 1478 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp113_ = detected;
#line 1478 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp114_ = _tmp113_->metadata;
#line 1478 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp115_ = media_metadata_get_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp114_, TYPE_MEDIA_METADATA, MediaMetadata));
#line 1478 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp112_->title);
#line 1478 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp112_->title = _tmp115_;
#line 1479 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp116_ = updated_row;
#line 1479 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp117_ = detected;
#line 1479 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp118_ = _tmp117_->metadata;
#line 1479 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp119_ = media_metadata_get_comment (G_TYPE_CHECK_INSTANCE_CAST (_tmp118_, TYPE_MEDIA_METADATA, MediaMetadata));
#line 1479 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp116_->comment);
#line 1479 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp116_->comment = _tmp119_;
#line 1480 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp120_ = updated_row;
#line 1480 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp121_ = detected;
#line 1480 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp122_ = _tmp121_->metadata;
#line 1480 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp123_ = photo_metadata_get_rating (_tmp122_);
#line 1480 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp120_->rating = _tmp123_;
#line 1471 "/home/jens/Source/shotwell/src/Photo.vala"
		_metadata_date_time_unref0 (date_time);
#line 11555 "Photo.c"
	}
#line 1483 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp124_ = updated_row;
#line 1483 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp125_ = metadata;
#line 1483 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp126_ = list;
#line 1483 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp126__length1 = list_length1;
#line 1483 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp127_ = photo_reimport_master_state_impl_new (_tmp124_, _tmp125_, _tmp126_, _tmp126__length1);
#line 1483 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_reimport_master_state_unref0 (_vala_reimport_state);
#line 1483 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_reimport_state = G_TYPE_CHECK_INSTANCE_CAST (_tmp127_, PHOTO_TYPE_REIMPORT_MASTER_STATE, PhotoReimportMasterState);
#line 1485 "/home/jens/Source/shotwell/src/Photo.vala"
	result = TRUE;
#line 1485 "/home/jens/Source/shotwell/src/Photo.vala"
	_media_metadata_unref0 (metadata);
#line 1485 "/home/jens/Source/shotwell/src/Photo.vala"
	list = (_vala_array_free (list, list_length1, (GDestroyNotify) g_free), NULL);
#line 1485 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_row_unref0 (updated_row);
#line 1485 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (backing);
#line 1485 "/home/jens/Source/shotwell/src/Photo.vala"
	_detected_photo_information_unref0 (detected);
#line 1485 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (file);
#line 1485 "/home/jens/Source/shotwell/src/Photo.vala"
	if (reimport_state) {
#line 1485 "/home/jens/Source/shotwell/src/Photo.vala"
		*reimport_state = _vala_reimport_state;
#line 11589 "Photo.c"
	} else {
#line 1485 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_reimport_master_state_unref0 (_vala_reimport_state);
#line 11593 "Photo.c"
	}
#line 1485 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 11597 "Photo.c"
}


static void photo_real_apply_user_metadata_for_reimport (Photo* self, PhotoMetadata* metadata) {
#line 1488 "/home/jens/Source/shotwell/src/Photo.vala"
	g_critical ("Type `%s' does not implement abstract method `photo_apply_user_metadata_for_reimport'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
#line 1488 "/home/jens/Source/shotwell/src/Photo.vala"
	return;
#line 11606 "Photo.c"
}


void photo_apply_user_metadata_for_reimport (Photo* self, PhotoMetadata* metadata) {
#line 1488 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 1488 "/home/jens/Source/shotwell/src/Photo.vala"
	PHOTO_GET_CLASS (self)->apply_user_metadata_for_reimport (self, metadata);
#line 11615 "Photo.c"
}


static gpointer _photo_reimport_master_state_ref0 (gpointer self) {
#line 1492 "/home/jens/Source/shotwell/src/Photo.vala"
	return self ? photo_reimport_master_state_ref (self) : NULL;
#line 11622 "Photo.c"
}


static void _vala_array_add95 (gchar*** array, int* length, int* size, gchar* value) {
#line 1510 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 1510 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 1510 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 11633 "Photo.c"
	}
#line 1510 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 1510 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 11639 "Photo.c"
}


static void _vala_array_add96 (gchar*** array, int* length, int* size, gchar* value) {
#line 1512 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 1512 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 1512 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 11650 "Photo.c"
	}
#line 1512 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 1512 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 11656 "Photo.c"
}


void photo_finish_reimport_master (Photo* self, PhotoReimportMasterState* state, GError** error) {
	PhotoReimportMasterStateImpl* reimport_state = NULL;
	PhotoReimportMasterState* _tmp0_ = NULL;
	PhotoReimportMasterStateImpl* _tmp1_ = NULL;
	PhotoTable* _tmp2_ = NULL;
	PhotoTable* _tmp3_ = NULL;
	PhotoRow* _tmp4_ = NULL;
	PhotoMetadata* _tmp20_ = NULL;
	gboolean _tmp22_ = FALSE;
	gchar** _tmp28_ = NULL;
	gint _tmp28__length1 = 0;
	PhotoMetadata* _tmp32_ = NULL;
	gboolean _tmp33_ = FALSE;
	gboolean _tmp35_ = FALSE;
	GError * _inner_error_ = NULL;
#line 1491 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 1491 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (PHOTO_IS_REIMPORT_MASTER_STATE (state));
#line 1492 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = state;
#line 1492 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _photo_reimport_master_state_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, PHOTO_TYPE_REIMPORT_MASTER_STATE_IMPL, PhotoReimportMasterStateImpl));
#line 1492 "/home/jens/Source/shotwell/src/Photo.vala"
	reimport_state = _tmp1_;
#line 1494 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_table_get_instance ();
#line 1494 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp2_;
#line 1494 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = reimport_state->row;
#line 1494 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_table_reimport (_tmp3_, _tmp4_, &_inner_error_);
#line 1494 "/home/jens/Source/shotwell/src/Photo.vala"
	_database_table_unref0 (_tmp3_);
#line 1494 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1494 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_inner_error_->domain == DATABASE_ERROR) {
#line 1494 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 1494 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_reimport_master_state_unref0 (reimport_state);
#line 1494 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 11705 "Photo.c"
		} else {
#line 1494 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_reimport_master_state_unref0 (reimport_state);
#line 1494 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1494 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 1494 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 11715 "Photo.c"
		}
	}
	{
		PhotoRow* _tmp5_ = NULL;
#line 1496 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = self->row;
#line 1496 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 11724 "Photo.c"
		{
			BackingPhotoRow* original_master = NULL;
			PhotoRow* _tmp6_ = NULL;
			BackingPhotoRow* _tmp7_ = NULL;
			BackingPhotoRow* _tmp8_ = NULL;
			PhotoRow* _tmp9_ = NULL;
			PhotoRow* _tmp10_ = NULL;
			PhotoRow* _tmp11_ = NULL;
			BackingPhotoRow* _tmp12_ = NULL;
			BackingPhotoRow* _tmp13_ = NULL;
			PhotoRow* _tmp14_ = NULL;
			BackingPhotoRow* _tmp15_ = NULL;
			PhotoRow* _tmp16_ = NULL;
			BackingPhotoRow* _tmp17_ = NULL;
			gboolean _tmp18_ = FALSE;
#line 1498 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = self->row;
#line 1498 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = _tmp6_->master;
#line 1498 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = _backing_photo_row_ref0 (_tmp7_);
#line 1498 "/home/jens/Source/shotwell/src/Photo.vala"
			original_master = _tmp8_;
#line 1499 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = reimport_state->row;
#line 1499 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = _photo_row_ref0 (_tmp9_);
#line 1499 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_row_unref0 (self->row);
#line 1499 "/home/jens/Source/shotwell/src/Photo.vala"
			self->row = _tmp10_;
#line 1500 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = self->row;
#line 1500 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = original_master;
#line 1500 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = _backing_photo_row_ref0 (_tmp12_);
#line 1500 "/home/jens/Source/shotwell/src/Photo.vala"
			_backing_photo_row_unref0 (_tmp11_->master);
#line 1500 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_->master = _tmp13_;
#line 1501 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp14_ = self->row;
#line 1501 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp15_ = _tmp14_->master;
#line 1501 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp16_ = reimport_state->row;
#line 1501 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp17_ = _tmp16_->master;
#line 1501 "/home/jens/Source/shotwell/src/Photo.vala"
			backing_photo_row_copy_from (_tmp15_, _tmp17_);
#line 1502 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp18_ = reimport_state->metadata_only;
#line 1502 "/home/jens/Source/shotwell/src/Photo.vala"
			if (!_tmp18_) {
#line 1503 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_internal_remove_all_transformations (self, FALSE);
#line 11782 "Photo.c"
			}
#line 1496 "/home/jens/Source/shotwell/src/Photo.vala"
			_backing_photo_row_unref0 (original_master);
#line 11786 "Photo.c"
		}
		__finally308:
		{
			PhotoRow* _tmp19_ = NULL;
#line 1496 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp19_ = self->row;
#line 1496 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 11795 "Photo.c"
		}
#line 1496 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1496 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_inner_error_->domain == DATABASE_ERROR) {
#line 1496 "/home/jens/Source/shotwell/src/Photo.vala"
				g_propagate_error (error, _inner_error_);
#line 1496 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_reimport_master_state_unref0 (reimport_state);
#line 1496 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 11807 "Photo.c"
			} else {
#line 1496 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_reimport_master_state_unref0 (reimport_state);
#line 1496 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1496 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 1496 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 11817 "Photo.c"
			}
		}
	}
#line 1506 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp20_ = reimport_state->metadata;
#line 1506 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp20_ != NULL) {
#line 11825 "Photo.c"
		PhotoMetadata* _tmp21_ = NULL;
#line 1507 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = reimport_state->metadata;
#line 1507 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_apply_user_metadata_for_reimport (self, _tmp21_);
#line 11831 "Photo.c"
	}
#line 1509 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_ = reimport_state->metadata_only;
#line 1509 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp22_) {
#line 11837 "Photo.c"
		gchar** _tmp23_ = NULL;
		gint _tmp23__length1 = 0;
		gchar* _tmp24_ = NULL;
		gboolean _tmp25_ = FALSE;
#line 1510 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp23_ = reimport_state->alterations;
#line 1510 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp23__length1 = reimport_state->alterations_length1;
#line 1510 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp24_ = g_strdup ("image:master");
#line 1510 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_array_add95 (&reimport_state->alterations, &reimport_state->alterations_length1, &reimport_state->_alterations_size_, _tmp24_);
#line 1511 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp25_ = photo_is_master_baseline (self);
#line 1511 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp25_) {
#line 11854 "Photo.c"
			gchar** _tmp26_ = NULL;
			gint _tmp26__length1 = 0;
			gchar* _tmp27_ = NULL;
#line 1512 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp26_ = reimport_state->alterations;
#line 1512 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp26__length1 = reimport_state->alterations_length1;
#line 1512 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp27_ = g_strdup ("image:baseline");
#line 1512 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_array_add96 (&reimport_state->alterations, &reimport_state->alterations_length1, &reimport_state->_alterations_size_, _tmp27_);
#line 11866 "Photo.c"
		}
	}
#line 1515 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp28_ = reimport_state->alterations;
#line 1515 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp28__length1 = reimport_state->alterations_length1;
#line 1515 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp28__length1 > 0) {
#line 11875 "Photo.c"
		gchar** _tmp29_ = NULL;
		gint _tmp29__length1 = 0;
		Alteration* _tmp30_ = NULL;
		Alteration* _tmp31_ = NULL;
#line 1516 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp29_ = reimport_state->alterations;
#line 1516 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp29__length1 = reimport_state->alterations_length1;
#line 1516 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp30_ = alteration_new_from_array (_tmp29_, _tmp29__length1);
#line 1516 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp31_ = _tmp30_;
#line 1516 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp31_);
#line 1516 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp31_);
#line 11892 "Photo.c"
	}
#line 1518 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp32_ = reimport_state->metadata;
#line 1518 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_notify_master_reimported (self, _tmp32_);
#line 1520 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp33_ = photo_is_master_baseline (self);
#line 1520 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp33_) {
#line 11902 "Photo.c"
		PhotoMetadata* _tmp34_ = NULL;
#line 1521 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp34_ = reimport_state->metadata;
#line 1521 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_notify_baseline_reimported (self, _tmp34_);
#line 11908 "Photo.c"
	}
#line 1523 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp35_ = photo_is_master_source (self);
#line 1523 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp35_) {
#line 11914 "Photo.c"
		PhotoMetadata* _tmp36_ = NULL;
#line 1524 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp36_ = reimport_state->metadata;
#line 1524 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_notify_source_reimported (self, _tmp36_);
#line 11920 "Photo.c"
	}
#line 1491 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_reimport_master_state_unref0 (reimport_state);
#line 11924 "Photo.c"
}


static gboolean photo_verify_file_for_reimport (Photo* self, GFile* file, BackingPhotoRow** backing, DetectedPhotoInformation** detected, GError** error) {
	BackingPhotoRow* _vala_backing = NULL;
	DetectedPhotoInformation* _vala_detected = NULL;
	gboolean result = FALSE;
	BackingPhotoRow* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	DetectedPhotoInformation* _tmp2_ = NULL;
	BackingPhotoRow* _tmp3_ = NULL;
	BackingPhotoRow* _tmp5_ = NULL;
	BackingPhotoRow* _tmp6_ = NULL;
	gboolean _tmp7_ = FALSE;
	gboolean _tmp8_ = FALSE;
	DetectedPhotoInformation* _tmp9_ = NULL;
	GdkColorspace _tmp10_ = 0;
	GError * _inner_error_ = NULL;
#line 1528 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 1528 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_IS_FILE (file), FALSE);
#line 1530 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = file;
#line 1530 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = photo_query_backing_photo_row (self, _tmp1_, PHOTO_FILE_SNIFFER_OPTIONS_NO_MD5, &_tmp2_, &_inner_error_);
#line 1530 "/home/jens/Source/shotwell/src/Photo.vala"
	_detected_photo_information_unref0 (_vala_detected);
#line 1530 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_detected = _tmp2_;
#line 1530 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = _tmp3_;
#line 1530 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 11959 "Photo.c"
		gboolean _tmp4_ = FALSE;
#line 1530 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 1530 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp4_;
#line 11965 "Photo.c"
	}
#line 1530 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = _tmp0_;
#line 1530 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = NULL;
#line 1530 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (_vala_backing);
#line 1530 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_backing = _tmp5_;
#line 1532 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = _vala_backing;
#line 1532 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp6_ == NULL) {
#line 1533 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 1533 "/home/jens/Source/shotwell/src/Photo.vala"
		_backing_photo_row_unref0 (_tmp0_);
#line 1533 "/home/jens/Source/shotwell/src/Photo.vala"
		if (backing) {
#line 1533 "/home/jens/Source/shotwell/src/Photo.vala"
			*backing = _vala_backing;
#line 11987 "Photo.c"
		} else {
#line 1533 "/home/jens/Source/shotwell/src/Photo.vala"
			_backing_photo_row_unref0 (_vala_backing);
#line 11991 "Photo.c"
		}
#line 1533 "/home/jens/Source/shotwell/src/Photo.vala"
		if (detected) {
#line 1533 "/home/jens/Source/shotwell/src/Photo.vala"
			*detected = _vala_detected;
#line 11997 "Photo.c"
		} else {
#line 1533 "/home/jens/Source/shotwell/src/Photo.vala"
			_detected_photo_information_unref0 (_vala_detected);
#line 12001 "Photo.c"
		}
#line 1533 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 12005 "Photo.c"
	}
#line 1537 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = _vala_detected;
#line 1537 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = _tmp9_->colorspace;
#line 1537 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp10_ != GDK_COLORSPACE_RGB) {
#line 1537 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = TRUE;
#line 12015 "Photo.c"
	} else {
		DetectedPhotoInformation* _tmp11_ = NULL;
		gint _tmp12_ = 0;
#line 1538 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = _vala_detected;
#line 1538 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = _tmp11_->channels;
#line 1538 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = _tmp12_ < 3;
#line 12025 "Photo.c"
	}
#line 1537 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp8_) {
#line 1537 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = TRUE;
#line 12031 "Photo.c"
	} else {
		DetectedPhotoInformation* _tmp13_ = NULL;
		gint _tmp14_ = 0;
#line 1539 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp13_ = _vala_detected;
#line 1539 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp14_ = _tmp13_->bits_per_channel;
#line 1539 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = _tmp14_ != 8;
#line 12041 "Photo.c"
	}
#line 1537 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp7_) {
#line 12045 "Photo.c"
		GFile* _tmp15_ = NULL;
		gchar* _tmp16_ = NULL;
		gchar* _tmp17_ = NULL;
#line 1540 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp15_ = file;
#line 1540 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = g_file_get_path (_tmp15_);
#line 1540 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp17_ = _tmp16_;
#line 1540 "/home/jens/Source/shotwell/src/Photo.vala"
		g_warning ("Photo.vala:1540: Not re-importing %s: Unsupported color format", _tmp17_);
#line 1540 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp17_);
#line 1542 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 1542 "/home/jens/Source/shotwell/src/Photo.vala"
		_backing_photo_row_unref0 (_tmp0_);
#line 1542 "/home/jens/Source/shotwell/src/Photo.vala"
		if (backing) {
#line 1542 "/home/jens/Source/shotwell/src/Photo.vala"
			*backing = _vala_backing;
#line 12067 "Photo.c"
		} else {
#line 1542 "/home/jens/Source/shotwell/src/Photo.vala"
			_backing_photo_row_unref0 (_vala_backing);
#line 12071 "Photo.c"
		}
#line 1542 "/home/jens/Source/shotwell/src/Photo.vala"
		if (detected) {
#line 1542 "/home/jens/Source/shotwell/src/Photo.vala"
			*detected = _vala_detected;
#line 12077 "Photo.c"
		} else {
#line 1542 "/home/jens/Source/shotwell/src/Photo.vala"
			_detected_photo_information_unref0 (_vala_detected);
#line 12081 "Photo.c"
		}
#line 1542 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 12085 "Photo.c"
	}
#line 1545 "/home/jens/Source/shotwell/src/Photo.vala"
	result = TRUE;
#line 1545 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (_tmp0_);
#line 1545 "/home/jens/Source/shotwell/src/Photo.vala"
	if (backing) {
#line 1545 "/home/jens/Source/shotwell/src/Photo.vala"
		*backing = _vala_backing;
#line 12095 "Photo.c"
	} else {
#line 1545 "/home/jens/Source/shotwell/src/Photo.vala"
		_backing_photo_row_unref0 (_vala_backing);
#line 12099 "Photo.c"
	}
#line 1545 "/home/jens/Source/shotwell/src/Photo.vala"
	if (detected) {
#line 1545 "/home/jens/Source/shotwell/src/Photo.vala"
		*detected = _vala_detected;
#line 12105 "Photo.c"
	} else {
#line 1545 "/home/jens/Source/shotwell/src/Photo.vala"
		_detected_photo_information_unref0 (_vala_detected);
#line 12109 "Photo.c"
	}
#line 1545 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 12113 "Photo.c"
}


gboolean photo_prepare_for_reimport_editable (Photo* self, PhotoReimportEditableState** state, GError** error) {
	PhotoReimportEditableState* _vala_state = NULL;
	gboolean result = FALSE;
	GFile* file = NULL;
	GFile* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	DetectedPhotoInformation* detected = NULL;
	BackingPhotoRow* backing = NULL;
	gboolean _tmp2_ = FALSE;
	GFile* _tmp3_ = NULL;
	BackingPhotoRow* _tmp4_ = NULL;
	DetectedPhotoInformation* _tmp5_ = NULL;
	gboolean _tmp6_ = FALSE;
	BackingPhotoRow* _tmp8_ = NULL;
	DetectedPhotoInformation* _tmp9_ = NULL;
	PhotoMetadata* _tmp10_ = NULL;
	PhotoReimportEditableStateImpl* _tmp11_ = NULL;
	GError * _inner_error_ = NULL;
#line 1549 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 1550 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_reimport_editable_state_unref0 (_vala_state);
#line 1550 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_state = NULL;
#line 1552 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_editable_file (self);
#line 1552 "/home/jens/Source/shotwell/src/Photo.vala"
	file = _tmp0_;
#line 1553 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = file;
#line 1553 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_ == NULL) {
#line 1554 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 1554 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 1554 "/home/jens/Source/shotwell/src/Photo.vala"
		if (state) {
#line 1554 "/home/jens/Source/shotwell/src/Photo.vala"
			*state = _vala_state;
#line 12157 "Photo.c"
		} else {
#line 1554 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_reimport_editable_state_unref0 (_vala_state);
#line 12161 "Photo.c"
		}
#line 1554 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 12165 "Photo.c"
	}
#line 1558 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = file;
#line 1558 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = photo_verify_file_for_reimport (self, _tmp3_, &_tmp4_, &_tmp5_, &_inner_error_);
#line 1558 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (backing);
#line 1558 "/home/jens/Source/shotwell/src/Photo.vala"
	backing = _tmp4_;
#line 1558 "/home/jens/Source/shotwell/src/Photo.vala"
	_detected_photo_information_unref0 (detected);
#line 1558 "/home/jens/Source/shotwell/src/Photo.vala"
	detected = _tmp5_;
#line 1558 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = _tmp6_;
#line 1558 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 12183 "Photo.c"
		gboolean _tmp7_ = FALSE;
#line 1558 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 1558 "/home/jens/Source/shotwell/src/Photo.vala"
		_backing_photo_row_unref0 (backing);
#line 1558 "/home/jens/Source/shotwell/src/Photo.vala"
		_detected_photo_information_unref0 (detected);
#line 1558 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 1558 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp7_;
#line 12195 "Photo.c"
	}
#line 1558 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp2_) {
#line 1559 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 1559 "/home/jens/Source/shotwell/src/Photo.vala"
		_backing_photo_row_unref0 (backing);
#line 1559 "/home/jens/Source/shotwell/src/Photo.vala"
		_detected_photo_information_unref0 (detected);
#line 1559 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 1559 "/home/jens/Source/shotwell/src/Photo.vala"
		if (state) {
#line 1559 "/home/jens/Source/shotwell/src/Photo.vala"
			*state = _vala_state;
#line 12211 "Photo.c"
		} else {
#line 1559 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_reimport_editable_state_unref0 (_vala_state);
#line 12215 "Photo.c"
		}
#line 1559 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 12219 "Photo.c"
	}
#line 1561 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = backing;
#line 1561 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = detected;
#line 1561 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = _tmp9_->metadata;
#line 1561 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = photo_reimport_editable_state_impl_new (_tmp8_, _tmp10_);
#line 1561 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_reimport_editable_state_unref0 (_vala_state);
#line 1561 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_state = G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, PHOTO_TYPE_REIMPORT_EDITABLE_STATE, PhotoReimportEditableState);
#line 1563 "/home/jens/Source/shotwell/src/Photo.vala"
	result = TRUE;
#line 1563 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (backing);
#line 1563 "/home/jens/Source/shotwell/src/Photo.vala"
	_detected_photo_information_unref0 (detected);
#line 1563 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (file);
#line 1563 "/home/jens/Source/shotwell/src/Photo.vala"
	if (state) {
#line 1563 "/home/jens/Source/shotwell/src/Photo.vala"
		*state = _vala_state;
#line 12245 "Photo.c"
	} else {
#line 1563 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_reimport_editable_state_unref0 (_vala_state);
#line 12249 "Photo.c"
	}
#line 1563 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 12253 "Photo.c"
}


static gpointer _photo_reimport_editable_state_ref0 (gpointer self) {
#line 1572 "/home/jens/Source/shotwell/src/Photo.vala"
	return self ? photo_reimport_editable_state_ref (self) : NULL;
#line 12260 "Photo.c"
}


void photo_finish_reimport_editable (Photo* self, PhotoReimportEditableState* state, GError** error) {
	BackingPhotoID editable_id = {0};
	BackingPhotoID _tmp0_ = {0};
	gboolean _tmp1_ = FALSE;
	PhotoReimportEditableStateImpl* reimport_state = NULL;
	PhotoReimportEditableState* _tmp2_ = NULL;
	PhotoReimportEditableStateImpl* _tmp3_ = NULL;
	PhotoReimportEditableStateImpl* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	PhotoReimportEditableStateImpl* _tmp21_ = NULL;
	PhotoMetadata* _tmp22_ = NULL;
	gchar* list = NULL;
	gchar* _tmp36_ = NULL;
	PhotoReimportEditableStateImpl* _tmp37_ = NULL;
	gboolean _tmp38_ = FALSE;
	const gchar* _tmp41_ = NULL;
	Alteration* _tmp42_ = NULL;
	Alteration* _tmp43_ = NULL;
	PhotoReimportEditableStateImpl* _tmp44_ = NULL;
	PhotoMetadata* _tmp45_ = NULL;
	gboolean _tmp46_ = FALSE;
	gboolean _tmp49_ = FALSE;
	GError * _inner_error_ = NULL;
#line 1567 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 1567 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (PHOTO_IS_REIMPORT_EDITABLE_STATE (state));
#line 1568 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_get_editable_id (self, &_tmp0_);
#line 1568 "/home/jens/Source/shotwell/src/Photo.vala"
	editable_id = _tmp0_;
#line 1569 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = backing_photo_id_is_invalid (&editable_id);
#line 1569 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_) {
#line 1570 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 12301 "Photo.c"
	}
#line 1572 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = state;
#line 1572 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _photo_reimport_editable_state_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, PHOTO_TYPE_REIMPORT_EDITABLE_STATE_IMPL, PhotoReimportEditableStateImpl));
#line 1572 "/home/jens/Source/shotwell/src/Photo.vala"
	reimport_state = _tmp3_;
#line 1574 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = reimport_state;
#line 1574 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = _tmp4_->metadata_only;
#line 1574 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp5_) {
#line 12315 "Photo.c"
		BackingPhotoTable* _tmp6_ = NULL;
		BackingPhotoTable* _tmp7_ = NULL;
		PhotoReimportEditableStateImpl* _tmp8_ = NULL;
		BackingPhotoRow* _tmp9_ = NULL;
#line 1575 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = backing_photo_table_get_instance ();
#line 1575 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = _tmp6_;
#line 1575 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = reimport_state;
#line 1575 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp9_ = _tmp8_->backing_state;
#line 1575 "/home/jens/Source/shotwell/src/Photo.vala"
		backing_photo_table_update (_tmp7_, _tmp9_, &_inner_error_);
#line 1575 "/home/jens/Source/shotwell/src/Photo.vala"
		_database_table_unref0 (_tmp7_);
#line 1575 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1575 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_inner_error_->domain == DATABASE_ERROR) {
#line 1575 "/home/jens/Source/shotwell/src/Photo.vala"
				g_propagate_error (error, _inner_error_);
#line 1575 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_reimport_editable_state_unref0 (reimport_state);
#line 1575 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 12342 "Photo.c"
			} else {
#line 1575 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_reimport_editable_state_unref0 (reimport_state);
#line 1575 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1575 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 1575 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 12352 "Photo.c"
			}
		}
		{
			PhotoRow* _tmp10_ = NULL;
#line 1577 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = self->row;
#line 1577 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_lock (&self->priv->__lock_row);
#line 12361 "Photo.c"
			{
				PhotoReimportEditableStateImpl* _tmp11_ = NULL;
				BackingPhotoRow* _tmp12_ = NULL;
				BackingPhotoRow* _tmp13_ = NULL;
				PhotoReimportEditableStateImpl* _tmp14_ = NULL;
				BackingPhotoRow* _tmp15_ = NULL;
				Orientation _tmp16_ = 0;
#line 1578 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = reimport_state;
#line 1578 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = _tmp11_->backing_state;
#line 1578 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = _backing_photo_row_ref0 (_tmp12_);
#line 1578 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (self->priv->editable);
#line 1578 "/home/jens/Source/shotwell/src/Photo.vala"
				self->priv->editable = _tmp13_;
#line 1579 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = reimport_state;
#line 1579 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = _tmp14_->backing_state;
#line 1579 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = _tmp15_->original_orientation;
#line 1579 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_set_orientation (self, _tmp16_);
#line 1580 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_internal_remove_all_transformations (self, FALSE);
#line 12389 "Photo.c"
			}
			__finally309:
			{
				PhotoRow* _tmp17_ = NULL;
#line 1577 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp17_ = self->row;
#line 1577 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 12398 "Photo.c"
			}
#line 1577 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1577 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_inner_error_->domain == DATABASE_ERROR) {
#line 1577 "/home/jens/Source/shotwell/src/Photo.vala"
					g_propagate_error (error, _inner_error_);
#line 1577 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_reimport_editable_state_unref0 (reimport_state);
#line 1577 "/home/jens/Source/shotwell/src/Photo.vala"
					return;
#line 12410 "Photo.c"
				} else {
#line 1577 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_reimport_editable_state_unref0 (reimport_state);
#line 1577 "/home/jens/Source/shotwell/src/Photo.vala"
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1577 "/home/jens/Source/shotwell/src/Photo.vala"
					g_clear_error (&_inner_error_);
#line 1577 "/home/jens/Source/shotwell/src/Photo.vala"
					return;
#line 12420 "Photo.c"
				}
			}
		}
	} else {
		PhotoReimportEditableStateImpl* _tmp18_ = NULL;
		BackingPhotoRow* _tmp19_ = NULL;
		Orientation _tmp20_ = 0;
#line 1583 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp18_ = reimport_state;
#line 1583 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp19_ = _tmp18_->backing_state;
#line 1583 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = _tmp19_->original_orientation;
#line 1583 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_set_orientation (self, _tmp20_);
#line 12436 "Photo.c"
	}
#line 1586 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp21_ = reimport_state;
#line 1586 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_ = _tmp21_->metadata;
#line 1586 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp22_ != NULL) {
#line 12444 "Photo.c"
		PhotoReimportEditableStateImpl* _tmp23_ = NULL;
		PhotoMetadata* _tmp24_ = NULL;
		gchar* _tmp25_ = NULL;
		gchar* _tmp26_ = NULL;
		PhotoReimportEditableStateImpl* _tmp27_ = NULL;
		PhotoMetadata* _tmp28_ = NULL;
		gchar* _tmp29_ = NULL;
		gchar* _tmp30_ = NULL;
		PhotoReimportEditableStateImpl* _tmp31_ = NULL;
		PhotoMetadata* _tmp32_ = NULL;
		Rating _tmp33_ = 0;
		PhotoReimportEditableStateImpl* _tmp34_ = NULL;
		PhotoMetadata* _tmp35_ = NULL;
#line 1587 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp23_ = reimport_state;
#line 1587 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp24_ = _tmp23_->metadata;
#line 1587 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp25_ = media_metadata_get_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, TYPE_MEDIA_METADATA, MediaMetadata));
#line 1587 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp26_ = _tmp25_;
#line 1587 "/home/jens/Source/shotwell/src/Photo.vala"
		media_source_set_title (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), _tmp26_);
#line 1587 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp26_);
#line 1588 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp27_ = reimport_state;
#line 1588 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp28_ = _tmp27_->metadata;
#line 1588 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp29_ = media_metadata_get_comment (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, TYPE_MEDIA_METADATA, MediaMetadata));
#line 1588 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp30_ = _tmp29_;
#line 1588 "/home/jens/Source/shotwell/src/Photo.vala"
		media_source_set_comment (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), _tmp30_);
#line 1588 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp30_);
#line 1589 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp31_ = reimport_state;
#line 1589 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp32_ = _tmp31_->metadata;
#line 1589 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp33_ = photo_metadata_get_rating (_tmp32_);
#line 1589 "/home/jens/Source/shotwell/src/Photo.vala"
		media_source_set_rating (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), _tmp33_);
#line 1590 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp34_ = reimport_state;
#line 1590 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp35_ = _tmp34_->metadata;
#line 1590 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_apply_user_metadata_for_reimport (self, _tmp35_);
#line 12496 "Photo.c"
	}
#line 1593 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp36_ = g_strdup ("metadata:name,image:orientation,metadata:rating,metadata:exposure-time");
#line 1593 "/home/jens/Source/shotwell/src/Photo.vala"
	list = _tmp36_;
#line 1594 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp37_ = reimport_state;
#line 1594 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp38_ = _tmp37_->metadata_only;
#line 1594 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp38_) {
#line 12508 "Photo.c"
		const gchar* _tmp39_ = NULL;
		gchar* _tmp40_ = NULL;
#line 1595 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp39_ = list;
#line 1595 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp40_ = g_strconcat (_tmp39_, "image:editable,image:baseline", NULL);
#line 1595 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (list);
#line 1595 "/home/jens/Source/shotwell/src/Photo.vala"
		list = _tmp40_;
#line 12519 "Photo.c"
	}
#line 1597 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp41_ = list;
#line 1597 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp42_ = alteration_new_from_list (_tmp41_);
#line 1597 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp43_ = _tmp42_;
#line 1597 "/home/jens/Source/shotwell/src/Photo.vala"
	data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp43_);
#line 1597 "/home/jens/Source/shotwell/src/Photo.vala"
	_alteration_unref0 (_tmp43_);
#line 1599 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp44_ = reimport_state;
#line 1599 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp45_ = _tmp44_->metadata;
#line 1599 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_notify_editable_reimported (self, _tmp45_);
#line 1601 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp46_ = photo_is_editable_baseline (self);
#line 1601 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp46_) {
#line 12541 "Photo.c"
		PhotoReimportEditableStateImpl* _tmp47_ = NULL;
		PhotoMetadata* _tmp48_ = NULL;
#line 1602 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp47_ = reimport_state;
#line 1602 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp48_ = _tmp47_->metadata;
#line 1602 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_notify_baseline_reimported (self, _tmp48_);
#line 12550 "Photo.c"
	}
#line 1604 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp49_ = photo_is_editable_source (self);
#line 1604 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp49_) {
#line 12556 "Photo.c"
		PhotoReimportEditableStateImpl* _tmp50_ = NULL;
		PhotoMetadata* _tmp51_ = NULL;
#line 1605 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp50_ = reimport_state;
#line 1605 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp51_ = _tmp50_->metadata;
#line 1605 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_notify_source_reimported (self, _tmp51_);
#line 12565 "Photo.c"
	}
#line 1567 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (list);
#line 1567 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_reimport_editable_state_unref0 (reimport_state);
#line 12571 "Photo.c"
}


static gpointer _photo_reimport_raw_development_state_ref0 (gpointer self) {
#line 1627 "/home/jens/Source/shotwell/src/Photo.vala"
	return self ? photo_reimport_raw_development_state_ref (self) : NULL;
#line 12578 "Photo.c"
}


gboolean photo_prepare_for_reimport_raw_development (Photo* self, PhotoReimportRawDevelopmentState** state, GError** error) {
	PhotoReimportRawDevelopmentState* _vala_state = NULL;
	gboolean result = FALSE;
	GeeCollection* files = NULL;
	GeeCollection* _tmp0_ = NULL;
	GeeCollection* _tmp1_ = NULL;
	PhotoReimportRawDevelopmentStateImpl* reimport_state = NULL;
	PhotoReimportRawDevelopmentStateImpl* _tmp2_ = NULL;
	PhotoReimportRawDevelopmentStateImpl* _tmp19_ = NULL;
	PhotoReimportRawDevelopmentState* _tmp20_ = NULL;
	PhotoReimportRawDevelopmentStateImpl* _tmp21_ = NULL;
	gint _tmp22_ = 0;
	GError * _inner_error_ = NULL;
#line 1609 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 1610 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_reimport_raw_development_state_unref0 (_vala_state);
#line 1610 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_state = NULL;
#line 1612 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_raw_developer_files (self);
#line 1612 "/home/jens/Source/shotwell/src/Photo.vala"
	files = _tmp0_;
#line 1613 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = files;
#line 1613 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_ == NULL) {
#line 1614 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 1614 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (files);
#line 1614 "/home/jens/Source/shotwell/src/Photo.vala"
		if (state) {
#line 1614 "/home/jens/Source/shotwell/src/Photo.vala"
			*state = _vala_state;
#line 12617 "Photo.c"
		} else {
#line 1614 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_reimport_raw_development_state_unref0 (_vala_state);
#line 12621 "Photo.c"
		}
#line 1614 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 12625 "Photo.c"
	}
#line 1616 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_reimport_raw_development_state_impl_new ();
#line 1616 "/home/jens/Source/shotwell/src/Photo.vala"
	reimport_state = _tmp2_;
#line 12631 "Photo.c"
	{
		GeeIterator* _file_it = NULL;
		GeeCollection* _tmp3_ = NULL;
		GeeIterator* _tmp4_ = NULL;
#line 1618 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = files;
#line 1618 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ITERABLE, GeeIterable));
#line 1618 "/home/jens/Source/shotwell/src/Photo.vala"
		_file_it = _tmp4_;
#line 1618 "/home/jens/Source/shotwell/src/Photo.vala"
		while (TRUE) {
#line 12644 "Photo.c"
			GeeIterator* _tmp5_ = NULL;
			gboolean _tmp6_ = FALSE;
			GFile* file = NULL;
			GeeIterator* _tmp7_ = NULL;
			gpointer _tmp8_ = NULL;
			DetectedPhotoInformation* detected = NULL;
			BackingPhotoRow* backing = NULL;
			gboolean _tmp9_ = FALSE;
			GFile* _tmp10_ = NULL;
			BackingPhotoRow* _tmp11_ = NULL;
			DetectedPhotoInformation* _tmp12_ = NULL;
			gboolean _tmp13_ = FALSE;
			PhotoReimportRawDevelopmentStateImpl* _tmp15_ = NULL;
			BackingPhotoRow* _tmp16_ = NULL;
			DetectedPhotoInformation* _tmp17_ = NULL;
			PhotoMetadata* _tmp18_ = NULL;
#line 1618 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = _file_it;
#line 1618 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = gee_iterator_next (_tmp5_);
#line 1618 "/home/jens/Source/shotwell/src/Photo.vala"
			if (!_tmp6_) {
#line 1618 "/home/jens/Source/shotwell/src/Photo.vala"
				break;
#line 12669 "Photo.c"
			}
#line 1618 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = _file_it;
#line 1618 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = gee_iterator_get (_tmp7_);
#line 1618 "/home/jens/Source/shotwell/src/Photo.vala"
			file = (GFile*) _tmp8_;
#line 1621 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = file;
#line 1621 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = photo_verify_file_for_reimport (self, _tmp10_, &_tmp11_, &_tmp12_, &_inner_error_);
#line 1621 "/home/jens/Source/shotwell/src/Photo.vala"
			_backing_photo_row_unref0 (backing);
#line 1621 "/home/jens/Source/shotwell/src/Photo.vala"
			backing = _tmp11_;
#line 1621 "/home/jens/Source/shotwell/src/Photo.vala"
			_detected_photo_information_unref0 (detected);
#line 1621 "/home/jens/Source/shotwell/src/Photo.vala"
			detected = _tmp12_;
#line 1621 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = _tmp13_;
#line 1621 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 12693 "Photo.c"
				gboolean _tmp14_ = FALSE;
#line 1621 "/home/jens/Source/shotwell/src/Photo.vala"
				g_propagate_error (error, _inner_error_);
#line 1621 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (backing);
#line 1621 "/home/jens/Source/shotwell/src/Photo.vala"
				_detected_photo_information_unref0 (detected);
#line 1621 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (file);
#line 1621 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (_file_it);
#line 1621 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_reimport_raw_development_state_unref0 (reimport_state);
#line 1621 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (files);
#line 1621 "/home/jens/Source/shotwell/src/Photo.vala"
				return _tmp14_;
#line 12711 "Photo.c"
			}
#line 1621 "/home/jens/Source/shotwell/src/Photo.vala"
			if (!_tmp9_) {
#line 1622 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (backing);
#line 1622 "/home/jens/Source/shotwell/src/Photo.vala"
				_detected_photo_information_unref0 (detected);
#line 1622 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (file);
#line 1622 "/home/jens/Source/shotwell/src/Photo.vala"
				continue;
#line 12723 "Photo.c"
			}
#line 1624 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp15_ = reimport_state;
#line 1624 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp16_ = backing;
#line 1624 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp17_ = detected;
#line 1624 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp18_ = _tmp17_->metadata;
#line 1624 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_reimport_raw_development_state_impl_add (_tmp15_, _tmp16_, _tmp18_);
#line 1618 "/home/jens/Source/shotwell/src/Photo.vala"
			_backing_photo_row_unref0 (backing);
#line 1618 "/home/jens/Source/shotwell/src/Photo.vala"
			_detected_photo_information_unref0 (detected);
#line 1618 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (file);
#line 12741 "Photo.c"
		}
#line 1618 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_file_it);
#line 12745 "Photo.c"
	}
#line 1627 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp19_ = reimport_state;
#line 1627 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp20_ = _photo_reimport_raw_development_state_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE, PhotoReimportRawDevelopmentState));
#line 1627 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_reimport_raw_development_state_unref0 (_vala_state);
#line 1627 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_state = _tmp20_;
#line 1628 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp21_ = reimport_state;
#line 1628 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_ = photo_reimport_raw_development_state_impl_get_size (_tmp21_);
#line 1628 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp22_ > 0;
#line 1628 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_reimport_raw_development_state_unref0 (reimport_state);
#line 1628 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (files);
#line 1628 "/home/jens/Source/shotwell/src/Photo.vala"
	if (state) {
#line 1628 "/home/jens/Source/shotwell/src/Photo.vala"
		*state = _vala_state;
#line 12769 "Photo.c"
	} else {
#line 1628 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_reimport_raw_development_state_unref0 (_vala_state);
#line 12773 "Photo.c"
	}
#line 1628 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 12777 "Photo.c"
}


void photo_finish_reimport_raw_development (Photo* self, PhotoReimportRawDevelopmentState* state, GError** error) {
	PhotoFileFormat _tmp0_ = 0;
	PhotoReimportRawDevelopmentStateImpl* reimport_state = NULL;
	PhotoReimportRawDevelopmentState* _tmp1_ = NULL;
	PhotoReimportRawDevelopmentStateImpl* _tmp2_ = NULL;
	gchar* list = NULL;
	gchar* _tmp32_ = NULL;
	PhotoReimportRawDevelopmentStateImpl* _tmp33_ = NULL;
	gboolean _tmp34_ = FALSE;
	const gchar* _tmp37_ = NULL;
	Alteration* _tmp38_ = NULL;
	Alteration* _tmp39_ = NULL;
	GError * _inner_error_ = NULL;
#line 1632 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 1632 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (PHOTO_IS_REIMPORT_RAW_DEVELOPMENT_STATE (state));
#line 1633 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_master_file_format (self);
#line 1633 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp0_ != PHOTO_FILE_FORMAT_RAW) {
#line 1634 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 12804 "Photo.c"
	}
#line 1636 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = state;
#line 1636 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = _photo_reimport_raw_development_state_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL, PhotoReimportRawDevelopmentStateImpl));
#line 1636 "/home/jens/Source/shotwell/src/Photo.vala"
	reimport_state = _tmp2_;
#line 12812 "Photo.c"
	{
		GeeIterator* _dev_it = NULL;
		PhotoReimportRawDevelopmentStateImpl* _tmp3_ = NULL;
		GeeCollection* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
#line 1638 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = reimport_state;
#line 1638 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = _tmp3_->list;
#line 1638 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_ITERABLE, GeeIterable));
#line 1638 "/home/jens/Source/shotwell/src/Photo.vala"
		_dev_it = _tmp5_;
#line 1638 "/home/jens/Source/shotwell/src/Photo.vala"
		while (TRUE) {
#line 12828 "Photo.c"
			GeeIterator* _tmp6_ = NULL;
			gboolean _tmp7_ = FALSE;
			PhotoReimportRawDevelopmentStateImplDevToReimport* dev = NULL;
			GeeIterator* _tmp8_ = NULL;
			gpointer _tmp9_ = NULL;
			PhotoReimportRawDevelopmentStateImpl* _tmp10_ = NULL;
			gboolean _tmp11_ = FALSE;
#line 1638 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = _dev_it;
#line 1638 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = gee_iterator_next (_tmp6_);
#line 1638 "/home/jens/Source/shotwell/src/Photo.vala"
			if (!_tmp7_) {
#line 1638 "/home/jens/Source/shotwell/src/Photo.vala"
				break;
#line 12844 "Photo.c"
			}
#line 1638 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = _dev_it;
#line 1638 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = gee_iterator_get (_tmp8_);
#line 1638 "/home/jens/Source/shotwell/src/Photo.vala"
			dev = (PhotoReimportRawDevelopmentStateImplDevToReimport*) _tmp9_;
#line 1639 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = reimport_state;
#line 1639 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = _tmp10_->metadata_only;
#line 1639 "/home/jens/Source/shotwell/src/Photo.vala"
			if (!_tmp11_) {
#line 12858 "Photo.c"
				BackingPhotoTable* _tmp12_ = NULL;
				BackingPhotoTable* _tmp13_ = NULL;
				PhotoReimportRawDevelopmentStateImplDevToReimport* _tmp14_ = NULL;
				BackingPhotoRow* _tmp15_ = NULL;
#line 1640 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = backing_photo_table_get_instance ();
#line 1640 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = _tmp12_;
#line 1640 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = dev;
#line 1640 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = _tmp14_->backing;
#line 1640 "/home/jens/Source/shotwell/src/Photo.vala"
				backing_photo_table_update (_tmp13_, _tmp15_, &_inner_error_);
#line 1640 "/home/jens/Source/shotwell/src/Photo.vala"
				_database_table_unref0 (_tmp13_);
#line 1640 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1640 "/home/jens/Source/shotwell/src/Photo.vala"
					if (_inner_error_->domain == DATABASE_ERROR) {
#line 1640 "/home/jens/Source/shotwell/src/Photo.vala"
						g_propagate_error (error, _inner_error_);
#line 1640 "/home/jens/Source/shotwell/src/Photo.vala"
						_photo_reimport_raw_development_state_impl_dev_to_reimport_unref0 (dev);
#line 1640 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_object_unref0 (_dev_it);
#line 1640 "/home/jens/Source/shotwell/src/Photo.vala"
						_photo_reimport_raw_development_state_unref0 (reimport_state);
#line 1640 "/home/jens/Source/shotwell/src/Photo.vala"
						return;
#line 12889 "Photo.c"
					} else {
#line 1640 "/home/jens/Source/shotwell/src/Photo.vala"
						_photo_reimport_raw_development_state_impl_dev_to_reimport_unref0 (dev);
#line 1640 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_object_unref0 (_dev_it);
#line 1640 "/home/jens/Source/shotwell/src/Photo.vala"
						_photo_reimport_raw_development_state_unref0 (reimport_state);
#line 1640 "/home/jens/Source/shotwell/src/Photo.vala"
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1640 "/home/jens/Source/shotwell/src/Photo.vala"
						g_clear_error (&_inner_error_);
#line 1640 "/home/jens/Source/shotwell/src/Photo.vala"
						return;
#line 12903 "Photo.c"
					}
				}
				{
					PhotoRow* _tmp16_ = NULL;
#line 1642 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp16_ = self->row;
#line 1642 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_lock (&self->priv->__lock_row);
#line 12912 "Photo.c"
					{
						gint _tmp17_ = 0;
						RawDeveloper* _tmp18_ = NULL;
#line 1644 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp18_ = raw_developer_as_array (&_tmp17_);
#line 12918 "Photo.c"
						{
							RawDeveloper* d_collection = NULL;
							gint d_collection_length1 = 0;
							gint _d_collection_size_ = 0;
							gint d_it = 0;
#line 1644 "/home/jens/Source/shotwell/src/Photo.vala"
							d_collection = _tmp18_;
#line 1644 "/home/jens/Source/shotwell/src/Photo.vala"
							d_collection_length1 = _tmp17_;
#line 1644 "/home/jens/Source/shotwell/src/Photo.vala"
							for (d_it = 0; d_it < _tmp17_; d_it = d_it + 1) {
#line 12930 "Photo.c"
								RawDeveloper d = 0;
#line 1644 "/home/jens/Source/shotwell/src/Photo.vala"
								d = d_collection[d_it];
#line 12934 "Photo.c"
								{
									BackingPhotoID id = {0};
									PhotoRow* _tmp19_ = NULL;
									BackingPhotoID* _tmp20_ = NULL;
									gint _tmp20__length1 = 0;
									RawDeveloper _tmp21_ = 0;
									BackingPhotoID _tmp22_ = {0};
									BackingPhotoID _tmp23_ = {0};
									gint64 _tmp24_ = 0LL;
#line 1645 "/home/jens/Source/shotwell/src/Photo.vala"
									_tmp19_ = self->row;
#line 1645 "/home/jens/Source/shotwell/src/Photo.vala"
									_tmp20_ = _tmp19_->development_ids;
#line 1645 "/home/jens/Source/shotwell/src/Photo.vala"
									_tmp20__length1 = _tmp19_->development_ids_length1;
#line 1645 "/home/jens/Source/shotwell/src/Photo.vala"
									_tmp21_ = d;
#line 1645 "/home/jens/Source/shotwell/src/Photo.vala"
									_tmp22_ = _tmp20_[_tmp21_];
#line 1645 "/home/jens/Source/shotwell/src/Photo.vala"
									id = _tmp22_;
#line 1646 "/home/jens/Source/shotwell/src/Photo.vala"
									_tmp23_ = id;
#line 1646 "/home/jens/Source/shotwell/src/Photo.vala"
									_tmp24_ = _tmp23_.id;
#line 1646 "/home/jens/Source/shotwell/src/Photo.vala"
									if (_tmp24_ != BACKING_PHOTO_ID_INVALID) {
#line 12962 "Photo.c"
										BackingPhotoRow* bpr = NULL;
										BackingPhotoID _tmp25_ = {0};
										BackingPhotoRow* _tmp26_ = NULL;
										BackingPhotoRow* _tmp27_ = NULL;
#line 1647 "/home/jens/Source/shotwell/src/Photo.vala"
										_tmp25_ = id;
#line 1647 "/home/jens/Source/shotwell/src/Photo.vala"
										_tmp26_ = photo_get_backing_row (self, &_tmp25_);
#line 1647 "/home/jens/Source/shotwell/src/Photo.vala"
										bpr = _tmp26_;
#line 1648 "/home/jens/Source/shotwell/src/Photo.vala"
										_tmp27_ = bpr;
#line 1648 "/home/jens/Source/shotwell/src/Photo.vala"
										if (_tmp27_ != NULL) {
#line 12977 "Photo.c"
											GeeHashMap* _tmp28_ = NULL;
											RawDeveloper _tmp29_ = 0;
											BackingPhotoRow* _tmp30_ = NULL;
#line 1649 "/home/jens/Source/shotwell/src/Photo.vala"
											_tmp28_ = self->priv->developments;
#line 1649 "/home/jens/Source/shotwell/src/Photo.vala"
											_tmp29_ = d;
#line 1649 "/home/jens/Source/shotwell/src/Photo.vala"
											_tmp30_ = bpr;
#line 1649 "/home/jens/Source/shotwell/src/Photo.vala"
											gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((gintptr) _tmp29_), _tmp30_);
#line 12989 "Photo.c"
										}
#line 1646 "/home/jens/Source/shotwell/src/Photo.vala"
										_backing_photo_row_unref0 (bpr);
#line 12993 "Photo.c"
									}
								}
							}
#line 1644 "/home/jens/Source/shotwell/src/Photo.vala"
							d_collection = (g_free (d_collection), NULL);
#line 12999 "Photo.c"
						}
					}
					__finally310:
					{
						PhotoRow* _tmp31_ = NULL;
#line 1642 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp31_ = self->row;
#line 1642 "/home/jens/Source/shotwell/src/Photo.vala"
						g_rec_mutex_unlock (&self->priv->__lock_row);
#line 13009 "Photo.c"
					}
#line 1642 "/home/jens/Source/shotwell/src/Photo.vala"
					if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1642 "/home/jens/Source/shotwell/src/Photo.vala"
						if (_inner_error_->domain == DATABASE_ERROR) {
#line 1642 "/home/jens/Source/shotwell/src/Photo.vala"
							g_propagate_error (error, _inner_error_);
#line 1642 "/home/jens/Source/shotwell/src/Photo.vala"
							_photo_reimport_raw_development_state_impl_dev_to_reimport_unref0 (dev);
#line 1642 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_object_unref0 (_dev_it);
#line 1642 "/home/jens/Source/shotwell/src/Photo.vala"
							_photo_reimport_raw_development_state_unref0 (reimport_state);
#line 1642 "/home/jens/Source/shotwell/src/Photo.vala"
							return;
#line 13025 "Photo.c"
						} else {
#line 1642 "/home/jens/Source/shotwell/src/Photo.vala"
							_photo_reimport_raw_development_state_impl_dev_to_reimport_unref0 (dev);
#line 1642 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_object_unref0 (_dev_it);
#line 1642 "/home/jens/Source/shotwell/src/Photo.vala"
							_photo_reimport_raw_development_state_unref0 (reimport_state);
#line 1642 "/home/jens/Source/shotwell/src/Photo.vala"
							g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1642 "/home/jens/Source/shotwell/src/Photo.vala"
							g_clear_error (&_inner_error_);
#line 1642 "/home/jens/Source/shotwell/src/Photo.vala"
							return;
#line 13039 "Photo.c"
						}
					}
				}
			}
#line 1638 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_reimport_raw_development_state_impl_dev_to_reimport_unref0 (dev);
#line 13046 "Photo.c"
		}
#line 1638 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_dev_it);
#line 13050 "Photo.c"
	}
#line 1656 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp32_ = g_strdup ("metadata:name,image:orientation,metadata:rating,metadata:exposure-time");
#line 1656 "/home/jens/Source/shotwell/src/Photo.vala"
	list = _tmp32_;
#line 1657 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp33_ = reimport_state;
#line 1657 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp34_ = _tmp33_->metadata_only;
#line 1657 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp34_) {
#line 13062 "Photo.c"
		const gchar* _tmp35_ = NULL;
		gchar* _tmp36_ = NULL;
#line 1658 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp35_ = list;
#line 1658 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp36_ = g_strconcat (_tmp35_, "image:editable,image:baseline", NULL);
#line 1658 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (list);
#line 1658 "/home/jens/Source/shotwell/src/Photo.vala"
		list = _tmp36_;
#line 13073 "Photo.c"
	}
#line 1660 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp37_ = list;
#line 1660 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp38_ = alteration_new_from_list (_tmp37_);
#line 1660 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp39_ = _tmp38_;
#line 1660 "/home/jens/Source/shotwell/src/Photo.vala"
	data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp39_);
#line 1660 "/home/jens/Source/shotwell/src/Photo.vala"
	_alteration_unref0 (_tmp39_);
#line 1662 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_notify_raw_development_modified (self);
#line 1632 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (list);
#line 1632 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_reimport_raw_development_state_unref0 (reimport_state);
#line 13091 "Photo.c"
}


static gchar* photo_real_get_typename (DataSource* base) {
	Photo * self;
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
#line 1665 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 1666 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = g_strdup (PHOTO_TYPENAME);
#line 1666 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 1666 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 13107 "Photo.c"
}


static gint64 photo_real_get_instance_id (DataSource* base) {
	Photo * self;
	gint64 result = 0LL;
	PhotoID _tmp0_ = {0};
	gint64 _tmp1_ = 0LL;
#line 1669 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 1670 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_get_photo_id (self, &_tmp0_);
#line 1670 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_.id;
#line 1670 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp1_;
#line 1670 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 13126 "Photo.c"
}


static gchar* photo_real_get_source_id (DataSource* base) {
	Photo * self;
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gint64 _tmp2_ = 0LL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
#line 1673 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 1677 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = data_source_get_typename (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_SOURCE, DataSource));
#line 1677 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 1677 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = data_source_get_instance_id (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_SOURCE, DataSource));
#line 1677 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = g_strdup_printf ("%s%016" G_GINT64_MODIFIER "x", _tmp1_, _tmp2_);
#line 1677 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = _tmp3_;
#line 1677 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp1_);
#line 1677 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp4_;
#line 1677 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 13156 "Photo.c"
}


void photo_set_master_timestamp (Photo* self, GFileInfo* info) {
	GTimeVal modification = {0};
	GFileInfo* _tmp0_ = NULL;
	GTimeVal _tmp1_ = {0};
	gboolean _tmp21_ = FALSE;
	GError * _inner_error_ = NULL;
#line 1681 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 1681 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_IS_FILE_INFO (info));
#line 1682 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = info;
#line 1682 "/home/jens/Source/shotwell/src/Photo.vala"
	g_file_info_get_modification_time (_tmp0_, &_tmp1_);
#line 1682 "/home/jens/Source/shotwell/src/Photo.vala"
	modification = _tmp1_;
#line 13176 "Photo.c"
	{
		{
			PhotoRow* _tmp2_ = NULL;
#line 1685 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = self->row;
#line 1685 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_lock (&self->priv->__lock_row);
#line 13184 "Photo.c"
			{
				PhotoRow* _tmp3_ = NULL;
				BackingPhotoRow* _tmp4_ = NULL;
				time_t _tmp5_ = 0;
				GTimeVal _tmp6_ = {0};
				glong _tmp7_ = 0L;
				PhotoTable* _tmp9_ = NULL;
				PhotoTable* _tmp10_ = NULL;
				PhotoRow* _tmp11_ = NULL;
				PhotoID _tmp12_ = {0};
				GTimeVal _tmp13_ = {0};
				glong _tmp14_ = 0L;
				PhotoRow* _tmp15_ = NULL;
				BackingPhotoRow* _tmp16_ = NULL;
				GTimeVal _tmp17_ = {0};
				glong _tmp18_ = 0L;
#line 1686 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 1686 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = _tmp3_->master;
#line 1686 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = _tmp4_->timestamp;
#line 1686 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = modification;
#line 1686 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = _tmp6_.tv_sec;
#line 1686 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp5_ == ((time_t) _tmp7_)) {
#line 13213 "Photo.c"
					{
						PhotoRow* _tmp8_ = NULL;
#line 1685 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp8_ = self->row;
#line 1685 "/home/jens/Source/shotwell/src/Photo.vala"
						g_rec_mutex_unlock (&self->priv->__lock_row);
#line 13220 "Photo.c"
					}
#line 1687 "/home/jens/Source/shotwell/src/Photo.vala"
					return;
#line 13224 "Photo.c"
				}
#line 1689 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = photo_table_get_instance ();
#line 1689 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = _tmp9_;
#line 1689 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = self->row;
#line 1689 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = _tmp11_->photo_id;
#line 1689 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = modification;
#line 1689 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = _tmp13_.tv_sec;
#line 1689 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_table_update_timestamp (_tmp10_, &_tmp12_, (time_t) _tmp14_, &_inner_error_);
#line 1689 "/home/jens/Source/shotwell/src/Photo.vala"
				_database_table_unref0 (_tmp10_);
#line 1689 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 13244 "Photo.c"
					goto __finally312;
				}
#line 1690 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = self->row;
#line 1690 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = _tmp15_->master;
#line 1690 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp17_ = modification;
#line 1690 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp18_ = _tmp17_.tv_sec;
#line 1690 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_->timestamp = (time_t) _tmp18_;
#line 13257 "Photo.c"
			}
			__finally312:
			{
				PhotoRow* _tmp19_ = NULL;
#line 1685 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp19_ = self->row;
#line 1685 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 13266 "Photo.c"
			}
#line 1685 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1685 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_inner_error_->domain == DATABASE_ERROR) {
#line 13272 "Photo.c"
					goto __catch311_database_error;
				}
#line 1685 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1685 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 1685 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 13281 "Photo.c"
			}
		}
	}
	goto __finally311;
	__catch311_database_error:
	{
		GError* err = NULL;
		GError* _tmp20_ = NULL;
#line 1684 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 1684 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 1693 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = err;
#line 1693 "/home/jens/Source/shotwell/src/Photo.vala"
		app_window_database_error (_tmp20_);
#line 1695 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 1695 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 13302 "Photo.c"
	}
	__finally311:
#line 1684 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1684 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1684 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1684 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 13313 "Photo.c"
	}
#line 1698 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp21_ = photo_is_master_baseline (self);
#line 1698 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp21_) {
#line 13319 "Photo.c"
		Alteration* _tmp22_ = NULL;
		Alteration* _tmp23_ = NULL;
#line 1699 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp22_ = alteration_new_from_list ("metadata:master-timestamp,metadata:baseline-timestamp");
#line 1699 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp23_ = _tmp22_;
#line 1699 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp23_);
#line 1699 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp23_);
#line 13330 "Photo.c"
	} else {
		Alteration* _tmp24_ = NULL;
		Alteration* _tmp25_ = NULL;
#line 1701 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp24_ = alteration_new ("metadata", "master-timestamp");
#line 1701 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp25_ = _tmp24_;
#line 1701 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp25_);
#line 1701 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp25_);
#line 13342 "Photo.c"
	}
}


void photo_update_editable_modification_time (Photo* self, GFileInfo* info, GError** error) {
	GTimeVal modification = {0};
	GFileInfo* _tmp0_ = NULL;
	GTimeVal _tmp1_ = {0};
	gboolean altered = FALSE;
	gboolean _tmp20_ = FALSE;
	GError * _inner_error_ = NULL;
#line 1705 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 1705 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_IS_FILE_INFO (info));
#line 1706 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = info;
#line 1706 "/home/jens/Source/shotwell/src/Photo.vala"
	g_file_info_get_modification_time (_tmp0_, &_tmp1_);
#line 1706 "/home/jens/Source/shotwell/src/Photo.vala"
	modification = _tmp1_;
#line 1708 "/home/jens/Source/shotwell/src/Photo.vala"
	altered = FALSE;
#line 13366 "Photo.c"
	{
		PhotoRow* _tmp2_ = NULL;
#line 1709 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = self->row;
#line 1709 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 13373 "Photo.c"
		{
			gboolean _tmp3_ = FALSE;
			PhotoRow* _tmp4_ = NULL;
			gboolean _tmp5_ = FALSE;
#line 1710 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 1710 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = backing_photo_id_is_valid (&_tmp4_->editable_id);
#line 1710 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp5_) {
#line 13384 "Photo.c"
				BackingPhotoRow* _tmp6_ = NULL;
				time_t _tmp7_ = 0;
				GTimeVal _tmp8_ = {0};
				glong _tmp9_ = 0L;
#line 1710 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = self->priv->editable;
#line 1710 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = _tmp6_->timestamp;
#line 1710 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = modification;
#line 1710 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = _tmp8_.tv_sec;
#line 1710 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = _tmp7_ != ((time_t) _tmp9_);
#line 13399 "Photo.c"
			} else {
#line 1710 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = FALSE;
#line 13403 "Photo.c"
			}
#line 1710 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp3_) {
#line 13407 "Photo.c"
				BackingPhotoTable* _tmp10_ = NULL;
				BackingPhotoTable* _tmp11_ = NULL;
				PhotoRow* _tmp12_ = NULL;
				BackingPhotoID _tmp13_ = {0};
				GTimeVal _tmp14_ = {0};
				glong _tmp15_ = 0L;
				BackingPhotoRow* _tmp16_ = NULL;
				GTimeVal _tmp17_ = {0};
				glong _tmp18_ = 0L;
#line 1711 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = backing_photo_table_get_instance ();
#line 1711 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = _tmp10_;
#line 1711 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = self->row;
#line 1711 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = _tmp12_->editable_id;
#line 1711 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = modification;
#line 1711 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = _tmp14_.tv_sec;
#line 1711 "/home/jens/Source/shotwell/src/Photo.vala"
				backing_photo_table_update_timestamp (_tmp11_, &_tmp13_, (time_t) _tmp15_, &_inner_error_);
#line 1711 "/home/jens/Source/shotwell/src/Photo.vala"
				_database_table_unref0 (_tmp11_);
#line 1711 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 13435 "Photo.c"
					goto __finally313;
				}
#line 1713 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = self->priv->editable;
#line 1713 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp17_ = modification;
#line 1713 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp18_ = _tmp17_.tv_sec;
#line 1713 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_->timestamp = (time_t) _tmp18_;
#line 1714 "/home/jens/Source/shotwell/src/Photo.vala"
				altered = TRUE;
#line 13448 "Photo.c"
			}
		}
		__finally313:
		{
			PhotoRow* _tmp19_ = NULL;
#line 1709 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp19_ = self->row;
#line 1709 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 13458 "Photo.c"
		}
#line 1709 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1709 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_inner_error_->domain == DATABASE_ERROR) {
#line 1709 "/home/jens/Source/shotwell/src/Photo.vala"
				g_propagate_error (error, _inner_error_);
#line 1709 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 13468 "Photo.c"
			} else {
#line 1709 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1709 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 1709 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 13476 "Photo.c"
			}
		}
	}
#line 1718 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp20_ = altered;
#line 1718 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp20_) {
#line 13484 "Photo.c"
		Alteration* _tmp21_ = NULL;
		Alteration* _tmp22_ = NULL;
#line 1719 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = alteration_new_from_list ("metadata:editable-timestamp,metadata:baseline-timestamp");
#line 1719 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp22_ = _tmp21_;
#line 1719 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp22_);
#line 1719 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp22_);
#line 13495 "Photo.c"
	}
}


void photo_update_many_editable_timestamps (GeeMap* map, GError** error) {
	GError * _inner_error_ = NULL;
#line 1723 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (GEE_IS_MAP (map));
#line 1725 "/home/jens/Source/shotwell/src/Photo.vala"
	database_table_begin_transaction ();
#line 13506 "Photo.c"
	{
		GeeIterator* _photo_it = NULL;
		GeeMap* _tmp0_ = NULL;
		GeeSet* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeIterator* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
#line 1726 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = map;
#line 1726 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = gee_map_get_keys (_tmp0_);
#line 1726 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = _tmp1_;
#line 1726 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = _tmp2_;
#line 1726 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ITERABLE, GeeIterable));
#line 1726 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = _tmp4_;
#line 1726 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp3_);
#line 1726 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_it = _tmp5_;
#line 1726 "/home/jens/Source/shotwell/src/Photo.vala"
		while (TRUE) {
#line 13533 "Photo.c"
			GeeIterator* _tmp6_ = NULL;
			gboolean _tmp7_ = FALSE;
			Photo* photo = NULL;
			GeeIterator* _tmp8_ = NULL;
			gpointer _tmp9_ = NULL;
			Photo* _tmp10_ = NULL;
			GeeMap* _tmp11_ = NULL;
			Photo* _tmp12_ = NULL;
			gpointer _tmp13_ = NULL;
			GFileInfo* _tmp14_ = NULL;
#line 1726 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = _photo_it;
#line 1726 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = gee_iterator_next (_tmp6_);
#line 1726 "/home/jens/Source/shotwell/src/Photo.vala"
			if (!_tmp7_) {
#line 1726 "/home/jens/Source/shotwell/src/Photo.vala"
				break;
#line 13552 "Photo.c"
			}
#line 1726 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = _photo_it;
#line 1726 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = gee_iterator_get (_tmp8_);
#line 1726 "/home/jens/Source/shotwell/src/Photo.vala"
			photo = (Photo*) _tmp9_;
#line 1727 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = photo;
#line 1727 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = map;
#line 1727 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = photo;
#line 1727 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = gee_map_get (_tmp11_, _tmp12_);
#line 1727 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp14_ = (GFileInfo*) _tmp13_;
#line 1727 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_update_editable_modification_time (_tmp10_, _tmp14_, &_inner_error_);
#line 1727 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tmp14_);
#line 1727 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1727 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_inner_error_->domain == DATABASE_ERROR) {
#line 1727 "/home/jens/Source/shotwell/src/Photo.vala"
					g_propagate_error (error, _inner_error_);
#line 1727 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (photo);
#line 1727 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_photo_it);
#line 1727 "/home/jens/Source/shotwell/src/Photo.vala"
					return;
#line 13586 "Photo.c"
				} else {
#line 1727 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (photo);
#line 1727 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_photo_it);
#line 1727 "/home/jens/Source/shotwell/src/Photo.vala"
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1727 "/home/jens/Source/shotwell/src/Photo.vala"
					g_clear_error (&_inner_error_);
#line 1727 "/home/jens/Source/shotwell/src/Photo.vala"
					return;
#line 13598 "Photo.c"
				}
			}
#line 1726 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (photo);
#line 13603 "Photo.c"
		}
#line 1726 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_photo_it);
#line 13607 "Photo.c"
	}
#line 1728 "/home/jens/Source/shotwell/src/Photo.vala"
	database_table_commit_transaction (&_inner_error_);
#line 1728 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1728 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_inner_error_->domain == DATABASE_ERROR) {
#line 1728 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 1728 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 13619 "Photo.c"
		} else {
#line 1728 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1728 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 1728 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 13627 "Photo.c"
		}
	}
}


static PhotoFileFormat photo_real_get_preferred_thumbnail_format (ThumbnailSource* base) {
	Photo * self;
	PhotoFileFormat result = 0;
	PhotoFileFormat _tmp0_ = 0;
	PhotoFileFormat _tmp1_ = 0;
	gboolean _tmp2_ = FALSE;
#line 1731 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 1732 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = photo_get_file_format (self);
#line 1732 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_file_format_can_write_image (_tmp1_);
#line 1732 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp2_) {
#line 13647 "Photo.c"
		PhotoFileFormat _tmp3_ = 0;
#line 1732 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = photo_get_file_format (self);
#line 1732 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = _tmp3_;
#line 13653 "Photo.c"
	} else {
		PhotoFileFormat _tmp4_ = 0;
#line 1733 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = photo_file_format_get_system_default_format ();
#line 1733 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = _tmp4_;
#line 13660 "Photo.c"
	}
#line 1732 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 1732 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 13666 "Photo.c"
}


static GdkPixbuf* photo_real_create_thumbnail (ThumbnailSource* base, gint scale, GError** error) {
	Photo * self;
	GdkPixbuf* result = NULL;
	GdkPixbuf* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	Scaling _tmp2_ = {0};
	GdkPixbuf* _tmp3_ = NULL;
	GdkPixbuf* _tmp4_ = NULL;
	GError * _inner_error_ = NULL;
#line 1736 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 1737 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = scale;
#line 1737 "/home/jens/Source/shotwell/src/Photo.vala"
	scaling_for_best_fit (_tmp1_, TRUE, &_tmp2_);
#line 1737 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = photo_source_get_pixbuf (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_SOURCE, PhotoSource), &_tmp2_, &_inner_error_);
#line 1737 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = _tmp3_;
#line 1737 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1737 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 1737 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 13695 "Photo.c"
	}
#line 1737 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = _tmp0_;
#line 1737 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = NULL;
#line 1737 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp4_;
#line 1737 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp0_);
#line 1737 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 13707 "Photo.c"
}


gboolean photo_is_file_image (GFile* file) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	GFile* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
#line 1740 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_IS_FILE (file), FALSE);
#line 1744 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = file;
#line 1744 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_file_format_is_file_supported (_tmp1_);
#line 1744 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp2_) {
#line 1745 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = TRUE;
#line 13726 "Photo.c"
	} else {
		GFile* _tmp3_ = NULL;
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		gboolean _tmp6_ = FALSE;
#line 1745 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = file;
#line 1745 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = g_file_get_basename (_tmp3_);
#line 1745 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = _tmp4_;
#line 1745 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = photo_is_extension_found (_tmp5_, PHOTO_IMAGE_EXTENSIONS, G_N_ELEMENTS (PHOTO_IMAGE_EXTENSIONS));
#line 1745 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = _tmp6_;
#line 1745 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp5_);
#line 13744 "Photo.c"
	}
#line 1744 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 1744 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 13750 "Photo.c"
}


static gboolean photo_is_extension_found (const gchar* basename, gchar** extensions, int extensions_length1) {
	gboolean result = FALSE;
	gchar* name = NULL;
	gchar* ext = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar** _tmp6_ = NULL;
	gint _tmp6__length1 = 0;
#line 1748 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (basename != NULL, FALSE);
#line 1750 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = basename;
#line 1750 "/home/jens/Source/shotwell/src/Photo.vala"
	disassemble_filename (_tmp0_, &_tmp1_, &_tmp2_);
#line 1750 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (name);
#line 1750 "/home/jens/Source/shotwell/src/Photo.vala"
	name = _tmp1_;
#line 1750 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (ext);
#line 1750 "/home/jens/Source/shotwell/src/Photo.vala"
	ext = _tmp2_;
#line 1751 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = ext;
#line 1751 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp3_ == NULL) {
#line 1752 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 1752 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (ext);
#line 1752 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (name);
#line 1752 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 13792 "Photo.c"
	}
#line 1755 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = ext;
#line 1755 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = g_utf8_strdown (_tmp4_, (gssize) -1);
#line 1755 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (ext);
#line 1755 "/home/jens/Source/shotwell/src/Photo.vala"
	ext = _tmp5_;
#line 1758 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = extensions;
#line 1758 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6__length1 = extensions_length1;
#line 13806 "Photo.c"
	{
		gchar** extension_collection = NULL;
		gint extension_collection_length1 = 0;
		gint _extension_collection_size_ = 0;
		gint extension_it = 0;
#line 1758 "/home/jens/Source/shotwell/src/Photo.vala"
		extension_collection = _tmp6_;
#line 1758 "/home/jens/Source/shotwell/src/Photo.vala"
		extension_collection_length1 = _tmp6__length1;
#line 1758 "/home/jens/Source/shotwell/src/Photo.vala"
		for (extension_it = 0; extension_it < _tmp6__length1; extension_it = extension_it + 1) {
#line 13818 "Photo.c"
			gchar* _tmp7_ = NULL;
			gchar* extension = NULL;
#line 1758 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = g_strdup (extension_collection[extension_it]);
#line 1758 "/home/jens/Source/shotwell/src/Photo.vala"
			extension = _tmp7_;
#line 13825 "Photo.c"
			{
				const gchar* _tmp8_ = NULL;
				const gchar* _tmp9_ = NULL;
#line 1759 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = ext;
#line 1759 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = extension;
#line 1759 "/home/jens/Source/shotwell/src/Photo.vala"
				if (g_strcmp0 (_tmp8_, _tmp9_) == 0) {
#line 1760 "/home/jens/Source/shotwell/src/Photo.vala"
					result = TRUE;
#line 1760 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_free0 (extension);
#line 1760 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_free0 (ext);
#line 1760 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_free0 (name);
#line 1760 "/home/jens/Source/shotwell/src/Photo.vala"
					return result;
#line 13845 "Photo.c"
				}
#line 1758 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (extension);
#line 13849 "Photo.c"
			}
		}
	}
#line 1763 "/home/jens/Source/shotwell/src/Photo.vala"
	result = FALSE;
#line 1763 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (ext);
#line 1763 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (name);
#line 1763 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 13861 "Photo.c"
}


gboolean photo_is_duplicate (GFile* file, const gchar* thumbnail_md5, const gchar* full_md5, PhotoFileFormat file_format) {
	gboolean result = FALSE;
	PhotoTable* _tmp0_ = NULL;
	PhotoTable* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	PhotoFileFormat _tmp5_ = 0;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp7_ = FALSE;
#line 1769 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail ((file == NULL) || G_IS_FILE (file), FALSE);
#line 1772 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_table_get_instance ();
#line 1772 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 1772 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = file;
#line 1772 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = thumbnail_md5;
#line 1772 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = full_md5;
#line 1772 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = file_format;
#line 1772 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = photo_table_has_duplicate (_tmp1_, _tmp2_, _tmp3_, _tmp4_, _tmp5_);
#line 1772 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = _tmp6_;
#line 1772 "/home/jens/Source/shotwell/src/Photo.vala"
	_database_table_unref0 (_tmp1_);
#line 1772 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp7_;
#line 1772 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 13899 "Photo.c"
}


PhotoID* photo_get_duplicate_ids (GFile* file, const gchar* thumbnail_md5, const gchar* full_md5, PhotoFileFormat file_format, int* result_length1) {
	PhotoID* result = NULL;
	PhotoTable* _tmp0_ = NULL;
	PhotoTable* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	PhotoFileFormat _tmp5_ = 0;
	gint _tmp6_ = 0;
	PhotoID* _tmp7_ = NULL;
	PhotoID* _tmp8_ = NULL;
	gint _tmp8__length1 = 0;
	PhotoID* _tmp9_ = NULL;
	gint _tmp9__length1 = 0;
#line 1778 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail ((file == NULL) || G_IS_FILE (file), NULL);
#line 1781 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_table_get_instance ();
#line 1781 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 1781 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = file;
#line 1781 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = thumbnail_md5;
#line 1781 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = full_md5;
#line 1781 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = file_format;
#line 1781 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = photo_table_get_duplicate_ids (_tmp1_, _tmp2_, _tmp3_, _tmp4_, _tmp5_, &_tmp6_);
#line 1781 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = _tmp7_;
#line 1781 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8__length1 = _tmp6_;
#line 1781 "/home/jens/Source/shotwell/src/Photo.vala"
	_database_table_unref0 (_tmp1_);
#line 1781 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = _tmp8_;
#line 1781 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9__length1 = _tmp8__length1;
#line 1781 "/home/jens/Source/shotwell/src/Photo.vala"
	if (result_length1) {
#line 1781 "/home/jens/Source/shotwell/src/Photo.vala"
		*result_length1 = _tmp9__length1;
#line 13947 "Photo.c"
	}
#line 1781 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp9_;
#line 1781 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 13953 "Photo.c"
}


gint64 photo_get_photo_key (DataSource* source) {
	gint64 result = 0LL;
	DataSource* _tmp0_ = NULL;
	PhotoID _tmp1_ = {0};
	gint64 _tmp2_ = 0LL;
#line 1788 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_DATA_SOURCE (source), 0LL);
#line 1789 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = source;
#line 1789 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_get_photo_id (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_LIBRARY_PHOTO, LibraryPhoto), TYPE_PHOTO, Photo), &_tmp1_);
#line 1789 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = _tmp1_.id;
#line 1789 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp2_;
#line 1789 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 13974 "Photo.c"
}


static GFile* photo_real_get_file (MediaSource* base) {
	Photo * self;
	GFile* result = NULL;
	PhotoFileReader* _tmp0_ = NULL;
	PhotoFileReader* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	GFile* _tmp3_ = NULL;
#line 1807 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 1808 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_source_reader (self);
#line 1808 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 1808 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 1808 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp2_;
#line 1808 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (_tmp1_);
#line 1808 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp3_;
#line 1808 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 14001 "Photo.c"
}


static void _vala_array_add97 (gchar*** array, int* length, int* size, gchar* value) {
#line 1851 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 1851 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 1851 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 14012 "Photo.c"
	}
#line 1851 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 1851 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 14018 "Photo.c"
}


static void _vala_array_add98 (gchar*** array, int* length, int* size, gchar* value) {
#line 1856 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 1856 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 1856 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 14029 "Photo.c"
	}
#line 1856 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 1856 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 14035 "Photo.c"
}


static void _vala_array_add99 (gchar*** array, int* length, int* size, gchar* value) {
#line 1859 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 1859 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 1859 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 14046 "Photo.c"
	}
#line 1859 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 1859 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 14052 "Photo.c"
}


static void _vala_array_add100 (gchar*** array, int* length, int* size, gchar* value) {
#line 1862 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 1862 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 1862 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 14063 "Photo.c"
	}
#line 1862 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 1862 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 14069 "Photo.c"
}


void photo_set_master_file (Photo* self, GFile* file) {
	gchar* filepath = NULL;
	GFile* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gboolean altered = FALSE;
	gboolean is_baseline = FALSE;
	gboolean is_source = FALSE;
	gboolean name_changed = FALSE;
	GFile* old_file = NULL;
	gboolean _tmp41_ = FALSE;
	GError * _inner_error_ = NULL;
#line 1813 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 1813 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_IS_FILE (file));
#line 1814 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = file;
#line 1814 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = g_file_get_path (_tmp0_);
#line 1814 "/home/jens/Source/shotwell/src/Photo.vala"
	filepath = _tmp1_;
#line 1816 "/home/jens/Source/shotwell/src/Photo.vala"
	altered = FALSE;
#line 1817 "/home/jens/Source/shotwell/src/Photo.vala"
	is_baseline = FALSE;
#line 1818 "/home/jens/Source/shotwell/src/Photo.vala"
	is_source = FALSE;
#line 1819 "/home/jens/Source/shotwell/src/Photo.vala"
	name_changed = FALSE;
#line 1820 "/home/jens/Source/shotwell/src/Photo.vala"
	old_file = NULL;
#line 14104 "Photo.c"
	{
		{
			PhotoRow* _tmp2_ = NULL;
#line 1822 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = self->row;
#line 1822 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_lock (&self->priv->__lock_row);
#line 14112 "Photo.c"
			{
				{
					PhotoBackingReaders* _tmp3_ = NULL;
#line 1823 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp3_ = self->priv->readers;
#line 1823 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_lock (&self->priv->__lock_readers);
#line 14120 "Photo.c"
					{
						PhotoBackingReaders* _tmp4_ = NULL;
						PhotoFileReader* _tmp5_ = NULL;
						GFile* _tmp6_ = NULL;
						GFile* _tmp7_ = NULL;
						GFile* _tmp8_ = NULL;
						gboolean _tmp9_ = FALSE;
#line 1824 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp4_ = self->priv->readers;
#line 1824 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp5_ = _tmp4_->master;
#line 1824 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp6_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 1824 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_object_unref0 (old_file);
#line 1824 "/home/jens/Source/shotwell/src/Photo.vala"
						old_file = _tmp6_;
#line 1825 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp7_ = file;
#line 1825 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp8_ = old_file;
#line 1825 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp9_ = g_file_equal (_tmp7_, _tmp8_);
#line 1825 "/home/jens/Source/shotwell/src/Photo.vala"
						if (!_tmp9_) {
#line 14146 "Photo.c"
							PhotoTable* _tmp10_ = NULL;
							PhotoTable* _tmp11_ = NULL;
							PhotoID _tmp12_ = {0};
							const gchar* _tmp13_ = NULL;
							PhotoRow* _tmp14_ = NULL;
							BackingPhotoRow* _tmp15_ = NULL;
							const gchar* _tmp16_ = NULL;
							gchar* _tmp17_ = NULL;
							GFile* _tmp18_ = NULL;
							gchar* _tmp19_ = NULL;
							PhotoBackingReaders* _tmp20_ = NULL;
							PhotoRow* _tmp21_ = NULL;
							BackingPhotoRow* _tmp22_ = NULL;
							PhotoFileFormat _tmp23_ = 0;
							const gchar* _tmp24_ = NULL;
							PhotoFileReader* _tmp25_ = NULL;
							gboolean _tmp26_ = FALSE;
							gboolean _tmp27_ = FALSE;
							gboolean _tmp28_ = FALSE;
							PhotoRow* _tmp29_ = NULL;
							const gchar* _tmp30_ = NULL;
							gboolean _tmp31_ = FALSE;
#line 1826 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp10_ = photo_table_get_instance ();
#line 1826 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp11_ = _tmp10_;
#line 1826 "/home/jens/Source/shotwell/src/Photo.vala"
							photo_get_photo_id (self, &_tmp12_);
#line 1826 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp13_ = filepath;
#line 1826 "/home/jens/Source/shotwell/src/Photo.vala"
							photo_table_set_filepath (_tmp11_, &_tmp12_, _tmp13_, &_inner_error_);
#line 1826 "/home/jens/Source/shotwell/src/Photo.vala"
							_database_table_unref0 (_tmp11_);
#line 1826 "/home/jens/Source/shotwell/src/Photo.vala"
							if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 14183 "Photo.c"
								goto __finally316;
							}
#line 1828 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp14_ = self->row;
#line 1828 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp15_ = _tmp14_->master;
#line 1828 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp16_ = filepath;
#line 1828 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp17_ = g_strdup (_tmp16_);
#line 1828 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_free0 (_tmp15_->filepath);
#line 1828 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp15_->filepath = _tmp17_;
#line 1829 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp18_ = file;
#line 1829 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp19_ = g_file_get_basename (_tmp18_);
#line 1829 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_free0 (self->priv->file_title);
#line 1829 "/home/jens/Source/shotwell/src/Photo.vala"
							self->priv->file_title = _tmp19_;
#line 1830 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp20_ = self->priv->readers;
#line 1830 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp21_ = self->row;
#line 1830 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp22_ = _tmp21_->master;
#line 1830 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp23_ = _tmp22_->file_format;
#line 1830 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp24_ = filepath;
#line 1830 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp25_ = photo_file_format_create_reader (_tmp23_, _tmp24_);
#line 1830 "/home/jens/Source/shotwell/src/Photo.vala"
							_photo_file_adapter_unref0 (_tmp20_->master);
#line 1830 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp20_->master = _tmp25_;
#line 1832 "/home/jens/Source/shotwell/src/Photo.vala"
							altered = TRUE;
#line 1833 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp26_ = photo_is_master_baseline (self);
#line 1833 "/home/jens/Source/shotwell/src/Photo.vala"
							is_baseline = _tmp26_;
#line 1834 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp27_ = photo_is_master_source (self);
#line 1834 "/home/jens/Source/shotwell/src/Photo.vala"
							is_source = _tmp27_;
#line 1835 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp29_ = self->row;
#line 1835 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp30_ = _tmp29_->title;
#line 1835 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp31_ = is_string_empty (_tmp30_);
#line 1835 "/home/jens/Source/shotwell/src/Photo.vala"
							if (_tmp31_) {
#line 14240 "Photo.c"
								GFile* _tmp32_ = NULL;
								gchar* _tmp33_ = NULL;
								gchar* _tmp34_ = NULL;
								GFile* _tmp35_ = NULL;
								gchar* _tmp36_ = NULL;
								gchar* _tmp37_ = NULL;
#line 1836 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp32_ = old_file;
#line 1836 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp33_ = g_file_get_basename (_tmp32_);
#line 1836 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp34_ = _tmp33_;
#line 1836 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp35_ = file;
#line 1836 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp36_ = g_file_get_basename (_tmp35_);
#line 1836 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp37_ = _tmp36_;
#line 1836 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp28_ = g_strcmp0 (_tmp34_, _tmp37_) != 0;
#line 1836 "/home/jens/Source/shotwell/src/Photo.vala"
								_g_free0 (_tmp37_);
#line 1836 "/home/jens/Source/shotwell/src/Photo.vala"
								_g_free0 (_tmp34_);
#line 14265 "Photo.c"
							} else {
#line 1835 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp28_ = FALSE;
#line 14269 "Photo.c"
							}
#line 1835 "/home/jens/Source/shotwell/src/Photo.vala"
							name_changed = _tmp28_;
#line 14273 "Photo.c"
						}
					}
					__finally316:
					{
						PhotoBackingReaders* _tmp38_ = NULL;
#line 1823 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp38_ = self->priv->readers;
#line 1823 "/home/jens/Source/shotwell/src/Photo.vala"
						g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 14283 "Photo.c"
					}
#line 1823 "/home/jens/Source/shotwell/src/Photo.vala"
					if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 14287 "Photo.c"
						goto __finally315;
					}
				}
			}
			__finally315:
			{
				PhotoRow* _tmp39_ = NULL;
#line 1822 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp39_ = self->row;
#line 1822 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 14299 "Photo.c"
			}
#line 1822 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1822 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_inner_error_->domain == DATABASE_ERROR) {
#line 14305 "Photo.c"
					goto __catch314_database_error;
				}
#line 1822 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (old_file);
#line 1822 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (filepath);
#line 1822 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1822 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 1822 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 14318 "Photo.c"
			}
		}
	}
	goto __finally314;
	__catch314_database_error:
	{
		GError* err = NULL;
		GError* _tmp40_ = NULL;
#line 1821 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 1821 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 1841 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp40_ = err;
#line 1841 "/home/jens/Source/shotwell/src/Photo.vala"
		app_window_database_error (_tmp40_);
#line 1821 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 14337 "Photo.c"
	}
	__finally314:
#line 1821 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1821 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (old_file);
#line 1821 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (filepath);
#line 1821 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1821 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1821 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 14352 "Photo.c"
	}
#line 1844 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp41_ = altered;
#line 1844 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp41_) {
#line 14358 "Photo.c"
		GFile* _tmp42_ = NULL;
		GFile* _tmp43_ = NULL;
		gboolean _tmp44_ = FALSE;
		gchar** alteration_list = NULL;
		gchar** _tmp45_ = NULL;
		gint alteration_list_length1 = 0;
		gint _alteration_list_size_ = 0;
		gchar** _tmp46_ = NULL;
		gint _tmp46__length1 = 0;
		gchar* _tmp47_ = NULL;
		gboolean _tmp48_ = FALSE;
		gboolean _tmp51_ = FALSE;
		gboolean _tmp54_ = FALSE;
		gchar** _tmp57_ = NULL;
		gint _tmp57__length1 = 0;
		Alteration* _tmp58_ = NULL;
		Alteration* _tmp59_ = NULL;
#line 1845 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp42_ = old_file;
#line 1845 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp43_ = file;
#line 1845 "/home/jens/Source/shotwell/src/Photo.vala"
		media_source_notify_master_replaced (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), _tmp42_, _tmp43_);
#line 1847 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp44_ = is_baseline;
#line 1847 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp44_) {
#line 1848 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_notify_baseline_replaced (self);
#line 14388 "Photo.c"
		}
#line 1850 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp45_ = g_new0 (gchar*, 0 + 1);
#line 1850 "/home/jens/Source/shotwell/src/Photo.vala"
		alteration_list = _tmp45_;
#line 1850 "/home/jens/Source/shotwell/src/Photo.vala"
		alteration_list_length1 = 0;
#line 1850 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_list_size_ = alteration_list_length1;
#line 1851 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp46_ = alteration_list;
#line 1851 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp46__length1 = alteration_list_length1;
#line 1851 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp47_ = g_strdup ("backing:master");
#line 1851 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_array_add97 (&alteration_list, &alteration_list_length1, &_alteration_list_size_, _tmp47_);
#line 1855 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp48_ = name_changed;
#line 1855 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp48_) {
#line 14410 "Photo.c"
			gchar** _tmp49_ = NULL;
			gint _tmp49__length1 = 0;
			gchar* _tmp50_ = NULL;
#line 1856 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp49_ = alteration_list;
#line 1856 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp49__length1 = alteration_list_length1;
#line 1856 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp50_ = g_strdup ("metadata:name");
#line 1856 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_array_add98 (&alteration_list, &alteration_list_length1, &_alteration_list_size_, _tmp50_);
#line 14422 "Photo.c"
		}
#line 1858 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp51_ = is_source;
#line 1858 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp51_) {
#line 14428 "Photo.c"
			gchar** _tmp52_ = NULL;
			gint _tmp52__length1 = 0;
			gchar* _tmp53_ = NULL;
#line 1859 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp52_ = alteration_list;
#line 1859 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp52__length1 = alteration_list_length1;
#line 1859 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp53_ = g_strdup ("backing:source");
#line 1859 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_array_add99 (&alteration_list, &alteration_list_length1, &_alteration_list_size_, _tmp53_);
#line 14440 "Photo.c"
		}
#line 1861 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp54_ = is_baseline;
#line 1861 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp54_) {
#line 14446 "Photo.c"
			gchar** _tmp55_ = NULL;
			gint _tmp55__length1 = 0;
			gchar* _tmp56_ = NULL;
#line 1862 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp55_ = alteration_list;
#line 1862 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp55__length1 = alteration_list_length1;
#line 1862 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp56_ = g_strdup ("backing:baseline");
#line 1862 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_array_add100 (&alteration_list, &alteration_list_length1, &_alteration_list_size_, _tmp56_);
#line 14458 "Photo.c"
		}
#line 1864 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp57_ = alteration_list;
#line 1864 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp57__length1 = alteration_list_length1;
#line 1864 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp58_ = alteration_new_from_array (_tmp57_, _tmp57__length1);
#line 1864 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp59_ = _tmp58_;
#line 1864 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp59_);
#line 1864 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp59_);
#line 1844 "/home/jens/Source/shotwell/src/Photo.vala"
		alteration_list = (_vala_array_free (alteration_list, alteration_list_length1, (GDestroyNotify) g_free), NULL);
#line 14474 "Photo.c"
	}
#line 1813 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (old_file);
#line 1813 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (filepath);
#line 14480 "Photo.c"
}


static void _vala_array_add101 (gchar*** array, int* length, int* size, gchar* value) {
#line 1904 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 1904 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 1904 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 14491 "Photo.c"
	}
#line 1904 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 1904 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 14497 "Photo.c"
}


static void _vala_array_add102 (gchar*** array, int* length, int* size, gchar* value) {
#line 1907 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 1907 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 1907 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 14508 "Photo.c"
	}
#line 1907 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 1907 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 14514 "Photo.c"
}


static void _vala_array_add103 (gchar*** array, int* length, int* size, gchar* value) {
#line 1910 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 1910 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 1910 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 14525 "Photo.c"
	}
#line 1910 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 1910 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 14531 "Photo.c"
}


void photo_set_editable_file (Photo* self, GFile* file) {
	gchar* filepath = NULL;
	GFile* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gboolean altered = FALSE;
	gboolean is_baseline = FALSE;
	gboolean is_source = FALSE;
	GFile* old_file = NULL;
	gboolean _tmp34_ = FALSE;
	GError * _inner_error_ = NULL;
#line 1870 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 1870 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_IS_FILE (file));
#line 1871 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = file;
#line 1871 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = g_file_get_path (_tmp0_);
#line 1871 "/home/jens/Source/shotwell/src/Photo.vala"
	filepath = _tmp1_;
#line 1873 "/home/jens/Source/shotwell/src/Photo.vala"
	altered = FALSE;
#line 1874 "/home/jens/Source/shotwell/src/Photo.vala"
	is_baseline = FALSE;
#line 1875 "/home/jens/Source/shotwell/src/Photo.vala"
	is_source = FALSE;
#line 1876 "/home/jens/Source/shotwell/src/Photo.vala"
	old_file = NULL;
#line 14563 "Photo.c"
	{
		{
			PhotoRow* _tmp2_ = NULL;
#line 1878 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = self->row;
#line 1878 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_lock (&self->priv->__lock_row);
#line 14571 "Photo.c"
			{
				{
					PhotoBackingReaders* _tmp3_ = NULL;
#line 1879 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp3_ = self->priv->readers;
#line 1879 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_lock (&self->priv->__lock_readers);
#line 14579 "Photo.c"
					{
						GFile* _tmp4_ = NULL;
						PhotoBackingReaders* _tmp5_ = NULL;
						PhotoFileReader* _tmp6_ = NULL;
						GFile* _tmp10_ = NULL;
						gboolean _tmp11_ = FALSE;
						GFile* _tmp12_ = NULL;
#line 1880 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp5_ = self->priv->readers;
#line 1880 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp6_ = _tmp5_->editable;
#line 1880 "/home/jens/Source/shotwell/src/Photo.vala"
						if (_tmp6_ != NULL) {
#line 14593 "Photo.c"
							PhotoBackingReaders* _tmp7_ = NULL;
							PhotoFileReader* _tmp8_ = NULL;
							GFile* _tmp9_ = NULL;
#line 1880 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp7_ = self->priv->readers;
#line 1880 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp8_ = _tmp7_->editable;
#line 1880 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp9_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 1880 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_object_unref0 (_tmp4_);
#line 1880 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp4_ = _tmp9_;
#line 14607 "Photo.c"
						} else {
#line 1880 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_object_unref0 (_tmp4_);
#line 1880 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp4_ = NULL;
#line 14613 "Photo.c"
						}
#line 1880 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp10_ = _g_object_ref0 (_tmp4_);
#line 1880 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_object_unref0 (old_file);
#line 1880 "/home/jens/Source/shotwell/src/Photo.vala"
						old_file = _tmp10_;
#line 1881 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp12_ = old_file;
#line 1881 "/home/jens/Source/shotwell/src/Photo.vala"
						if (_tmp12_ != NULL) {
#line 14625 "Photo.c"
							GFile* _tmp13_ = NULL;
							GFile* _tmp14_ = NULL;
							gboolean _tmp15_ = FALSE;
#line 1881 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp13_ = old_file;
#line 1881 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp14_ = file;
#line 1881 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp15_ = g_file_equal (_tmp13_, _tmp14_);
#line 1881 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp11_ = !_tmp15_;
#line 14637 "Photo.c"
						} else {
#line 1881 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp11_ = FALSE;
#line 14641 "Photo.c"
						}
#line 1881 "/home/jens/Source/shotwell/src/Photo.vala"
						if (_tmp11_) {
#line 14645 "Photo.c"
							BackingPhotoTable* _tmp16_ = NULL;
							BackingPhotoTable* _tmp17_ = NULL;
							PhotoRow* _tmp18_ = NULL;
							BackingPhotoID _tmp19_ = {0};
							const gchar* _tmp20_ = NULL;
							BackingPhotoRow* _tmp21_ = NULL;
							const gchar* _tmp22_ = NULL;
							gchar* _tmp23_ = NULL;
							PhotoBackingReaders* _tmp24_ = NULL;
							BackingPhotoRow* _tmp25_ = NULL;
							PhotoFileFormat _tmp26_ = 0;
							const gchar* _tmp27_ = NULL;
							PhotoFileReader* _tmp28_ = NULL;
							gboolean _tmp29_ = FALSE;
							gboolean _tmp30_ = FALSE;
#line 1882 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp16_ = backing_photo_table_get_instance ();
#line 1882 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp17_ = _tmp16_;
#line 1882 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp18_ = self->row;
#line 1882 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp19_ = _tmp18_->editable_id;
#line 1882 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp20_ = filepath;
#line 1882 "/home/jens/Source/shotwell/src/Photo.vala"
							backing_photo_table_set_filepath (_tmp17_, &_tmp19_, _tmp20_, &_inner_error_);
#line 1882 "/home/jens/Source/shotwell/src/Photo.vala"
							_database_table_unref0 (_tmp17_);
#line 1882 "/home/jens/Source/shotwell/src/Photo.vala"
							if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1882 "/home/jens/Source/shotwell/src/Photo.vala"
								_g_object_unref0 (_tmp4_);
#line 14679 "Photo.c"
								goto __finally319;
							}
#line 1884 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp21_ = self->priv->editable;
#line 1884 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp22_ = filepath;
#line 1884 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp23_ = g_strdup (_tmp22_);
#line 1884 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_free0 (_tmp21_->filepath);
#line 1884 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp21_->filepath = _tmp23_;
#line 1885 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp24_ = self->priv->readers;
#line 1885 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp25_ = self->priv->editable;
#line 1885 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp26_ = _tmp25_->file_format;
#line 1885 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp27_ = filepath;
#line 1885 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp28_ = photo_file_format_create_reader (_tmp26_, _tmp27_);
#line 1885 "/home/jens/Source/shotwell/src/Photo.vala"
							_photo_file_adapter_unref0 (_tmp24_->editable);
#line 1885 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp24_->editable = _tmp28_;
#line 1887 "/home/jens/Source/shotwell/src/Photo.vala"
							altered = TRUE;
#line 1888 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp29_ = photo_is_editable_baseline (self);
#line 1888 "/home/jens/Source/shotwell/src/Photo.vala"
							is_baseline = _tmp29_;
#line 1889 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp30_ = photo_is_editable_source (self);
#line 1889 "/home/jens/Source/shotwell/src/Photo.vala"
							is_source = _tmp30_;
#line 14716 "Photo.c"
						}
#line 1879 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_object_unref0 (_tmp4_);
#line 14720 "Photo.c"
					}
					__finally319:
					{
						PhotoBackingReaders* _tmp31_ = NULL;
#line 1879 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp31_ = self->priv->readers;
#line 1879 "/home/jens/Source/shotwell/src/Photo.vala"
						g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 14729 "Photo.c"
					}
#line 1879 "/home/jens/Source/shotwell/src/Photo.vala"
					if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 14733 "Photo.c"
						goto __finally318;
					}
				}
			}
			__finally318:
			{
				PhotoRow* _tmp32_ = NULL;
#line 1878 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp32_ = self->row;
#line 1878 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 14745 "Photo.c"
			}
#line 1878 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1878 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_inner_error_->domain == DATABASE_ERROR) {
#line 14751 "Photo.c"
					goto __catch317_database_error;
				}
#line 1878 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (old_file);
#line 1878 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (filepath);
#line 1878 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1878 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 1878 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 14764 "Photo.c"
			}
		}
	}
	goto __finally317;
	__catch317_database_error:
	{
		GError* err = NULL;
		GError* _tmp33_ = NULL;
#line 1877 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 1877 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 1894 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp33_ = err;
#line 1894 "/home/jens/Source/shotwell/src/Photo.vala"
		app_window_database_error (_tmp33_);
#line 1877 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 14783 "Photo.c"
	}
	__finally317:
#line 1877 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1877 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (old_file);
#line 1877 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (filepath);
#line 1877 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1877 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1877 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 14798 "Photo.c"
	}
#line 1897 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp34_ = altered;
#line 1897 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp34_) {
#line 14804 "Photo.c"
		GFile* _tmp35_ = NULL;
		GFile* _tmp36_ = NULL;
		gboolean _tmp37_ = FALSE;
		gchar** alteration_list = NULL;
		gchar** _tmp38_ = NULL;
		gint alteration_list_length1 = 0;
		gint _alteration_list_size_ = 0;
		gchar** _tmp39_ = NULL;
		gint _tmp39__length1 = 0;
		gchar* _tmp40_ = NULL;
		gboolean _tmp41_ = FALSE;
		gboolean _tmp44_ = FALSE;
		gchar** _tmp47_ = NULL;
		gint _tmp47__length1 = 0;
		Alteration* _tmp48_ = NULL;
		Alteration* _tmp49_ = NULL;
#line 1898 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp35_ = old_file;
#line 1898 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp36_ = file;
#line 1898 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_notify_editable_replaced (self, _tmp35_, _tmp36_);
#line 1900 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp37_ = is_baseline;
#line 1900 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp37_) {
#line 1901 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_notify_baseline_replaced (self);
#line 14833 "Photo.c"
		}
#line 1903 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp38_ = g_new0 (gchar*, 0 + 1);
#line 1903 "/home/jens/Source/shotwell/src/Photo.vala"
		alteration_list = _tmp38_;
#line 1903 "/home/jens/Source/shotwell/src/Photo.vala"
		alteration_list_length1 = 0;
#line 1903 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_list_size_ = alteration_list_length1;
#line 1904 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp39_ = alteration_list;
#line 1904 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp39__length1 = alteration_list_length1;
#line 1904 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp40_ = g_strdup ("backing:editable");
#line 1904 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_array_add101 (&alteration_list, &alteration_list_length1, &_alteration_list_size_, _tmp40_);
#line 1906 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp41_ = is_baseline;
#line 1906 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp41_) {
#line 14855 "Photo.c"
			gchar** _tmp42_ = NULL;
			gint _tmp42__length1 = 0;
			gchar* _tmp43_ = NULL;
#line 1907 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp42_ = alteration_list;
#line 1907 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp42__length1 = alteration_list_length1;
#line 1907 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp43_ = g_strdup ("backing:baseline");
#line 1907 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_array_add102 (&alteration_list, &alteration_list_length1, &_alteration_list_size_, _tmp43_);
#line 14867 "Photo.c"
		}
#line 1909 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp44_ = is_source;
#line 1909 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp44_) {
#line 14873 "Photo.c"
			gchar** _tmp45_ = NULL;
			gint _tmp45__length1 = 0;
			gchar* _tmp46_ = NULL;
#line 1910 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp45_ = alteration_list;
#line 1910 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp45__length1 = alteration_list_length1;
#line 1910 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp46_ = g_strdup ("backing:source");
#line 1910 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_array_add103 (&alteration_list, &alteration_list_length1, &_alteration_list_size_, _tmp46_);
#line 14885 "Photo.c"
		}
#line 1912 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp47_ = alteration_list;
#line 1912 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp47__length1 = alteration_list_length1;
#line 1912 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp48_ = alteration_new_from_array (_tmp47_, _tmp47__length1);
#line 1912 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp49_ = _tmp48_;
#line 1912 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp49_);
#line 1912 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp49_);
#line 1897 "/home/jens/Source/shotwell/src/Photo.vala"
		alteration_list = (_vala_array_free (alteration_list, alteration_list_length1, (GDestroyNotify) g_free), NULL);
#line 14901 "Photo.c"
	}
#line 1870 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (old_file);
#line 1870 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (filepath);
#line 14907 "Photo.c"
}


void photo_set_many_editable_file (GeeMap* map, GError** error) {
	GeeMapIterator* map_iter = NULL;
	GeeMap* _tmp0_ = NULL;
	GeeMapIterator* _tmp1_ = NULL;
	GError * _inner_error_ = NULL;
#line 1917 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (GEE_IS_MAP (map));
#line 1918 "/home/jens/Source/shotwell/src/Photo.vala"
	database_table_begin_transaction ();
#line 1920 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = map;
#line 1920 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = gee_map_map_iterator (_tmp0_);
#line 1920 "/home/jens/Source/shotwell/src/Photo.vala"
	map_iter = _tmp1_;
#line 1921 "/home/jens/Source/shotwell/src/Photo.vala"
	while (TRUE) {
#line 14928 "Photo.c"
		GeeMapIterator* _tmp2_ = NULL;
		gboolean _tmp3_ = FALSE;
		GeeMapIterator* _tmp4_ = NULL;
		gpointer _tmp5_ = NULL;
		Photo* _tmp6_ = NULL;
		GeeMapIterator* _tmp7_ = NULL;
		gpointer _tmp8_ = NULL;
		GFile* _tmp9_ = NULL;
#line 1921 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = map_iter;
#line 1921 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = gee_map_iterator_next (_tmp2_);
#line 1921 "/home/jens/Source/shotwell/src/Photo.vala"
		if (!_tmp3_) {
#line 1921 "/home/jens/Source/shotwell/src/Photo.vala"
			break;
#line 14945 "Photo.c"
		}
#line 1922 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = map_iter;
#line 1922 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = gee_map_iterator_get_key (_tmp4_);
#line 1922 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = (Photo*) _tmp5_;
#line 1922 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = map_iter;
#line 1922 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = gee_map_iterator_get_value (_tmp7_);
#line 1922 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp9_ = (GFile*) _tmp8_;
#line 1922 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_set_editable_file (_tmp6_, _tmp9_);
#line 1922 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp9_);
#line 1922 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp6_);
#line 14965 "Photo.c"
	}
#line 1924 "/home/jens/Source/shotwell/src/Photo.vala"
	database_table_commit_transaction (&_inner_error_);
#line 1924 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1924 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_inner_error_->domain == DATABASE_ERROR) {
#line 1924 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 1924 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (map_iter);
#line 1924 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 14979 "Photo.c"
		} else {
#line 1924 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (map_iter);
#line 1924 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1924 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 1924 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 14989 "Photo.c"
		}
	}
#line 1917 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (map_iter);
#line 14994 "Photo.c"
}


GFile* photo_get_actual_file (Photo* self) {
	GFile* result = NULL;
	PhotoFileReader* _tmp0_ = NULL;
	PhotoFileReader* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	GFile* _tmp3_ = NULL;
#line 1929 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 1930 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_baseline_reader (self);
#line 1930 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 1930 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 1930 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp2_;
#line 1930 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (_tmp1_);
#line 1930 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp3_;
#line 1930 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 15020 "Photo.c"
}


static GFile* photo_real_get_master_file (MediaSource* base) {
	Photo * self;
	GFile* result = NULL;
	PhotoFileReader* _tmp0_ = NULL;
	PhotoFileReader* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	GFile* _tmp3_ = NULL;
#line 1933 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 1934 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_master_reader (self);
#line 1934 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 1934 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 1934 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp2_;
#line 1934 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (_tmp1_);
#line 1934 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp3_;
#line 1934 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 15047 "Photo.c"
}


GFile* photo_get_editable_file (Photo* self) {
	GFile* result = NULL;
	PhotoFileReader* reader = NULL;
	PhotoFileReader* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	PhotoFileReader* _tmp2_ = NULL;
#line 1937 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 1938 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_editable_reader (self);
#line 1938 "/home/jens/Source/shotwell/src/Photo.vala"
	reader = _tmp0_;
#line 1940 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = reader;
#line 1940 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp2_ != NULL) {
#line 15067 "Photo.c"
		PhotoFileReader* _tmp3_ = NULL;
		GFile* _tmp4_ = NULL;
#line 1940 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = reader;
#line 1940 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 1940 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp1_);
#line 1940 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = _tmp4_;
#line 15078 "Photo.c"
	} else {
#line 1940 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp1_);
#line 1940 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = NULL;
#line 15084 "Photo.c"
	}
#line 1940 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp1_;
#line 1940 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (reader);
#line 1940 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 15092 "Photo.c"
}


GeeCollection* photo_get_raw_developer_files (Photo* self) {
	GeeCollection* result = NULL;
	PhotoFileFormat _tmp0_ = 0;
	GeeArrayList* ret = NULL;
	GeeArrayList* _tmp1_ = NULL;
	GError * _inner_error_ = NULL;
#line 1943 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 1944 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_master_file_format (self);
#line 1944 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp0_ != PHOTO_FILE_FORMAT_RAW) {
#line 1945 "/home/jens/Source/shotwell/src/Photo.vala"
		result = NULL;
#line 1945 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 15112 "Photo.c"
	}
#line 1947 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = gee_array_list_new (g_file_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
#line 1947 "/home/jens/Source/shotwell/src/Photo.vala"
	ret = _tmp1_;
#line 15118 "Photo.c"
	{
		PhotoRow* _tmp2_ = NULL;
#line 1948 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = self->row;
#line 1948 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 15125 "Photo.c"
		{
			{
				GeeIterator* _row_it = NULL;
				GeeHashMap* _tmp3_ = NULL;
				GeeCollection* _tmp4_ = NULL;
				GeeCollection* _tmp5_ = NULL;
				GeeCollection* _tmp6_ = NULL;
				GeeIterator* _tmp7_ = NULL;
				GeeIterator* _tmp8_ = NULL;
#line 1949 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->priv->developments;
#line 1949 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = gee_abstract_map_get_values (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
#line 1949 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = _tmp4_;
#line 1949 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = _tmp5_;
#line 1949 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_ITERABLE, GeeIterable));
#line 1949 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = _tmp7_;
#line 1949 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (_tmp6_);
#line 1949 "/home/jens/Source/shotwell/src/Photo.vala"
				_row_it = _tmp8_;
#line 1949 "/home/jens/Source/shotwell/src/Photo.vala"
				while (TRUE) {
#line 15153 "Photo.c"
					GeeIterator* _tmp9_ = NULL;
					gboolean _tmp10_ = FALSE;
					BackingPhotoRow* row = NULL;
					GeeIterator* _tmp11_ = NULL;
					gpointer _tmp12_ = NULL;
					GeeArrayList* _tmp13_ = NULL;
					BackingPhotoRow* _tmp14_ = NULL;
					const gchar* _tmp15_ = NULL;
					GFile* _tmp16_ = NULL;
					GFile* _tmp17_ = NULL;
#line 1949 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp9_ = _row_it;
#line 1949 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp10_ = gee_iterator_next (_tmp9_);
#line 1949 "/home/jens/Source/shotwell/src/Photo.vala"
					if (!_tmp10_) {
#line 1949 "/home/jens/Source/shotwell/src/Photo.vala"
						break;
#line 15172 "Photo.c"
					}
#line 1949 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp11_ = _row_it;
#line 1949 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp12_ = gee_iterator_get (_tmp11_);
#line 1949 "/home/jens/Source/shotwell/src/Photo.vala"
					row = (BackingPhotoRow*) _tmp12_;
#line 1950 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp13_ = ret;
#line 1950 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp14_ = row;
#line 1950 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp15_ = _tmp14_->filepath;
#line 1950 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp16_ = g_file_new_for_path (_tmp15_);
#line 1950 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp17_ = _tmp16_;
#line 1950 "/home/jens/Source/shotwell/src/Photo.vala"
					gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp17_);
#line 1950 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_tmp17_);
#line 1949 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (row);
#line 15196 "Photo.c"
				}
#line 1949 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (_row_it);
#line 15200 "Photo.c"
			}
		}
		__finally320:
		{
			PhotoRow* _tmp18_ = NULL;
#line 1948 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp18_ = self->row;
#line 1948 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15210 "Photo.c"
		}
#line 1948 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1948 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (ret);
#line 1948 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1948 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 1948 "/home/jens/Source/shotwell/src/Photo.vala"
			return NULL;
#line 15222 "Photo.c"
		}
	}
#line 1953 "/home/jens/Source/shotwell/src/Photo.vala"
	result = G_TYPE_CHECK_INSTANCE_CAST (ret, GEE_TYPE_COLLECTION, GeeCollection);
#line 1953 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 15229 "Photo.c"
}


GFile* photo_get_source_file (Photo* self) {
	GFile* result = NULL;
	PhotoFileReader* _tmp0_ = NULL;
	PhotoFileReader* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	GFile* _tmp3_ = NULL;
#line 1956 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 1957 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_source_reader (self);
#line 1957 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 1957 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 1957 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp2_;
#line 1957 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (_tmp1_);
#line 1957 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp3_;
#line 1957 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 15255 "Photo.c"
}


PhotoFileFormat photo_get_file_format (Photo* self) {
	PhotoFileFormat result = 0;
	GError * _inner_error_ = NULL;
#line 1960 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), 0);
#line 15264 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 1961 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 1961 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 15271 "Photo.c"
		{
			BackingPhotoRow* _tmp1_ = NULL;
			PhotoFileFormat _tmp2_ = 0;
#line 1962 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->backing_photo_row;
#line 1962 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->file_format;
#line 1962 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp2_;
#line 15281 "Photo.c"
			{
				PhotoRow* _tmp3_ = NULL;
#line 1961 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 1961 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15288 "Photo.c"
			}
#line 1962 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 15292 "Photo.c"
		}
		__finally321:
		{
			PhotoRow* _tmp4_ = NULL;
#line 1961 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 1961 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15301 "Photo.c"
		}
#line 1961 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1961 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1961 "/home/jens/Source/shotwell/src/Photo.vala"
		return 0;
#line 15309 "Photo.c"
	}
}


PhotoFileFormat photo_get_best_export_file_format (Photo* self) {
	PhotoFileFormat result = 0;
	PhotoFileFormat file_format = 0;
	PhotoFileFormat _tmp0_ = 0;
	PhotoFileFormat _tmp1_ = 0;
	gboolean _tmp2_ = FALSE;
#line 1966 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), 0);
#line 1967 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_file_format (self);
#line 1967 "/home/jens/Source/shotwell/src/Photo.vala"
	file_format = _tmp0_;
#line 1968 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = file_format;
#line 1968 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_file_format_can_write (_tmp1_);
#line 1968 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp2_) {
#line 15332 "Photo.c"
		PhotoFileFormat _tmp3_ = 0;
#line 1969 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = photo_file_format_get_system_default_format ();
#line 1969 "/home/jens/Source/shotwell/src/Photo.vala"
		file_format = _tmp3_;
#line 15338 "Photo.c"
	}
#line 1971 "/home/jens/Source/shotwell/src/Photo.vala"
	result = file_format;
#line 1971 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 15344 "Photo.c"
}


PhotoFileFormat photo_get_master_file_format (Photo* self) {
	PhotoFileFormat result = 0;
	GError * _inner_error_ = NULL;
#line 1974 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), 0);
#line 15353 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 1975 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 1975 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 15360 "Photo.c"
		{
			PhotoBackingReaders* _tmp1_ = NULL;
			PhotoFileReader* _tmp2_ = NULL;
			PhotoFileFormat _tmp3_ = 0;
#line 1976 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->readers;
#line 1976 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->master;
#line 1976 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = photo_file_adapter_get_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 1976 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp3_;
#line 15373 "Photo.c"
			{
				PhotoRow* _tmp4_ = NULL;
#line 1975 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = self->row;
#line 1975 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15380 "Photo.c"
			}
#line 1976 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 15384 "Photo.c"
		}
		__finally322:
		{
			PhotoRow* _tmp5_ = NULL;
#line 1975 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->row;
#line 1975 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15393 "Photo.c"
		}
#line 1975 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1975 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1975 "/home/jens/Source/shotwell/src/Photo.vala"
		return 0;
#line 15401 "Photo.c"
	}
}


static time_t photo_real_get_timestamp (MediaSource* base) {
	Photo * self;
	time_t result = 0;
	GError * _inner_error_ = NULL;
#line 1980 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 15412 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
		time_t _tmp5_ = 0;
#line 1981 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 1981 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 15420 "Photo.c"
		{
			BackingPhotoRow* _tmp1_ = NULL;
			time_t _tmp2_ = 0;
#line 1982 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->backing_photo_row;
#line 1982 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->timestamp;
#line 1982 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp2_;
#line 15430 "Photo.c"
			{
				PhotoRow* _tmp3_ = NULL;
#line 1981 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 1981 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15437 "Photo.c"
			}
#line 1982 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 15441 "Photo.c"
		}
		__finally323:
		{
			PhotoRow* _tmp4_ = NULL;
#line 1981 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 1981 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15450 "Photo.c"
		}
#line 1981 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1981 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1981 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp5_;
#line 15458 "Photo.c"
	}
}


void photo_get_photo_id (Photo* self, PhotoID* result) {
	GError * _inner_error_ = NULL;
#line 1986 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 15467 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 1987 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 1987 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 15474 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			PhotoID _tmp2_ = {0};
#line 1988 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 1988 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->photo_id;
#line 1988 "/home/jens/Source/shotwell/src/Photo.vala"
			*result = _tmp2_;
#line 15484 "Photo.c"
			{
				PhotoRow* _tmp3_ = NULL;
#line 1987 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 1987 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15491 "Photo.c"
			}
#line 1988 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 15495 "Photo.c"
		}
		__finally324:
		{
			PhotoRow* _tmp4_ = NULL;
#line 1987 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 1987 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15504 "Photo.c"
		}
#line 1987 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1987 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 1987 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 15512 "Photo.c"
	}
}


static inline void photo_real_get_event_id (MediaSource* base, EventID* result) {
	Photo * self;
	PhotoRow* _tmp0_ = NULL;
	EventID _tmp1_ = {0};
#line 1993 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 1994 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = self->row;
#line 1994 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_->event_id;
#line 1994 "/home/jens/Source/shotwell/src/Photo.vala"
	*result = _tmp1_;
#line 1994 "/home/jens/Source/shotwell/src/Photo.vala"
	return;
#line 15531 "Photo.c"
}


inline gint64 photo_get_raw_event_id (Photo* self) {
	gint64 result = 0LL;
	PhotoRow* _tmp0_ = NULL;
	EventID _tmp1_ = {0};
	gint64 _tmp2_ = 0LL;
#line 1998 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), 0LL);
#line 1999 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = self->row;
#line 1999 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_->event_id;
#line 1999 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = _tmp1_.id;
#line 1999 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp2_;
#line 1999 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 15552 "Photo.c"
}


static void photo_real_get_import_id (MediaSource* base, ImportID* result) {
	Photo * self;
	GError * _inner_error_ = NULL;
#line 2002 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 15561 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2003 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2003 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 15568 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			ImportID _tmp2_ = {0};
#line 2004 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2004 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->import_id;
#line 2004 "/home/jens/Source/shotwell/src/Photo.vala"
			*result = _tmp2_;
#line 15578 "Photo.c"
			{
				PhotoRow* _tmp3_ = NULL;
#line 2003 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 2003 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15585 "Photo.c"
			}
#line 2004 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 15589 "Photo.c"
		}
		__finally325:
		{
			PhotoRow* _tmp4_ = NULL;
#line 2003 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 2003 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15598 "Photo.c"
		}
#line 2003 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2003 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2003 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 15606 "Photo.c"
	}
}


void photo_get_editable_id (Photo* self, BackingPhotoID* result) {
	GError * _inner_error_ = NULL;
#line 2008 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 15615 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2009 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2009 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 15622 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			BackingPhotoID _tmp2_ = {0};
#line 2010 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2010 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->editable_id;
#line 2010 "/home/jens/Source/shotwell/src/Photo.vala"
			*result = _tmp2_;
#line 15632 "Photo.c"
			{
				PhotoRow* _tmp3_ = NULL;
#line 2009 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 2009 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15639 "Photo.c"
			}
#line 2010 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 15643 "Photo.c"
		}
		__finally326:
		{
			PhotoRow* _tmp4_ = NULL;
#line 2009 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 2009 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15652 "Photo.c"
		}
#line 2009 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2009 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2009 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 15660 "Photo.c"
	}
}


static gchar* photo_real_get_master_md5 (MediaSource* base) {
	Photo * self;
	gchar* result = NULL;
	GError * _inner_error_ = NULL;
#line 2014 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 15671 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2015 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2015 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 15678 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			const gchar* _tmp2_ = NULL;
			gchar* _tmp3_ = NULL;
#line 2016 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2016 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->md5;
#line 2016 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = g_strdup (_tmp2_);
#line 2016 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp3_;
#line 15691 "Photo.c"
			{
				PhotoRow* _tmp4_ = NULL;
#line 2015 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = self->row;
#line 2015 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15698 "Photo.c"
			}
#line 2016 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 15702 "Photo.c"
		}
		__finally327:
		{
			PhotoRow* _tmp5_ = NULL;
#line 2015 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->row;
#line 2015 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15711 "Photo.c"
		}
#line 2015 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2015 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2015 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 15719 "Photo.c"
	}
}


guint64 photo_get_flags (Photo* self) {
	guint64 result = 0ULL;
	GError * _inner_error_ = NULL;
#line 2022 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), 0ULL);
#line 15729 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
		guint64 _tmp5_ = 0ULL;
#line 2023 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2023 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 15737 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			guint64 _tmp2_ = 0ULL;
#line 2024 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2024 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->flags;
#line 2024 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp2_;
#line 15747 "Photo.c"
			{
				PhotoRow* _tmp3_ = NULL;
#line 2023 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 2023 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15754 "Photo.c"
			}
#line 2024 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 15758 "Photo.c"
		}
		__finally328:
		{
			PhotoRow* _tmp4_ = NULL;
#line 2023 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 2023 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15767 "Photo.c"
		}
#line 2023 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2023 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2023 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp5_;
#line 15775 "Photo.c"
	}
}


static void photo_notify_flags_altered (Photo* self, Alteration* additional_alteration) {
	Alteration* alteration = NULL;
	Alteration* _tmp0_ = NULL;
	Alteration* _tmp1_ = NULL;
	Alteration* _tmp5_ = NULL;
#line 2028 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 2028 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((additional_alteration == NULL) || IS_ALTERATION (additional_alteration));
#line 2029 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = alteration_new ("metadata", "flags");
#line 2029 "/home/jens/Source/shotwell/src/Photo.vala"
	alteration = _tmp0_;
#line 2030 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = additional_alteration;
#line 2030 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_ != NULL) {
#line 15797 "Photo.c"
		Alteration* _tmp2_ = NULL;
		Alteration* _tmp3_ = NULL;
		Alteration* _tmp4_ = NULL;
#line 2031 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = alteration;
#line 2031 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = additional_alteration;
#line 2031 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = alteration_compress (_tmp2_, _tmp3_);
#line 2031 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (alteration);
#line 2031 "/home/jens/Source/shotwell/src/Photo.vala"
		alteration = _tmp4_;
#line 15811 "Photo.c"
	}
#line 2033 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = alteration;
#line 2033 "/home/jens/Source/shotwell/src/Photo.vala"
	data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp5_);
#line 2028 "/home/jens/Source/shotwell/src/Photo.vala"
	_alteration_unref0 (alteration);
#line 15819 "Photo.c"
}


guint64 photo_replace_flags (Photo* self, guint64 flags, Alteration* additional_alteration) {
	guint64 result = 0ULL;
	gboolean committed = FALSE;
	gboolean _tmp11_ = FALSE;
	guint64 _tmp13_ = 0ULL;
	GError * _inner_error_ = NULL;
#line 2036 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), 0ULL);
#line 2036 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail ((additional_alteration == NULL) || IS_ALTERATION (additional_alteration), 0ULL);
#line 15833 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2038 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2038 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 15840 "Photo.c"
		{
			PhotoTable* _tmp1_ = NULL;
			PhotoTable* _tmp2_ = NULL;
			PhotoID _tmp3_ = {0};
			guint64 _tmp4_ = 0ULL;
			gboolean _tmp5_ = FALSE;
			gboolean _tmp6_ = FALSE;
#line 2039 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = photo_table_get_instance ();
#line 2039 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_;
#line 2039 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_get_photo_id (self, &_tmp3_);
#line 2039 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = flags;
#line 2039 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = photo_table_replace_flags (_tmp2_, &_tmp3_, _tmp4_);
#line 2039 "/home/jens/Source/shotwell/src/Photo.vala"
			committed = _tmp5_;
#line 2039 "/home/jens/Source/shotwell/src/Photo.vala"
			_database_table_unref0 (_tmp2_);
#line 2040 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = committed;
#line 2040 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp6_) {
#line 15866 "Photo.c"
				PhotoRow* _tmp7_ = NULL;
				guint64 _tmp8_ = 0ULL;
#line 2041 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = self->row;
#line 2041 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = flags;
#line 2041 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_->flags = _tmp8_;
#line 15875 "Photo.c"
			}
		}
		__finally329:
		{
			PhotoRow* _tmp9_ = NULL;
#line 2038 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = self->row;
#line 2038 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15885 "Photo.c"
		}
#line 2038 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 15889 "Photo.c"
			guint64 _tmp10_ = 0ULL;
#line 2038 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2038 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2038 "/home/jens/Source/shotwell/src/Photo.vala"
			return _tmp10_;
#line 15897 "Photo.c"
		}
	}
#line 2044 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = committed;
#line 2044 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp11_) {
#line 15904 "Photo.c"
		Alteration* _tmp12_ = NULL;
#line 2045 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = additional_alteration;
#line 2045 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_notify_flags_altered (self, _tmp12_);
#line 15910 "Photo.c"
	}
#line 2047 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = flags;
#line 2047 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp13_;
#line 2047 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 15918 "Photo.c"
}


gboolean photo_is_flag_set (Photo* self, guint64 mask) {
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
#line 2050 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 15927 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
		gboolean _tmp7_ = FALSE;
#line 2051 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2051 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 15935 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			guint64 _tmp2_ = 0ULL;
			guint64 _tmp3_ = 0ULL;
			gboolean _tmp4_ = FALSE;
#line 2052 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2052 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->flags;
#line 2052 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = mask;
#line 2052 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = media_source_internal_is_flag_set (_tmp2_, _tmp3_);
#line 2052 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp4_;
#line 15951 "Photo.c"
			{
				PhotoRow* _tmp5_ = NULL;
#line 2051 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = self->row;
#line 2051 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15958 "Photo.c"
			}
#line 2052 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 15962 "Photo.c"
		}
		__finally330:
		{
			PhotoRow* _tmp6_ = NULL;
#line 2051 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = self->row;
#line 2051 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 15971 "Photo.c"
		}
#line 2051 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2051 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2051 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp7_;
#line 15979 "Photo.c"
	}
}


guint64 photo_add_flags (Photo* self, guint64 mask, Alteration* additional_alteration) {
	guint64 result = 0ULL;
	guint64 flags = 0ULL;
	gboolean committed = FALSE;
	gboolean _tmp18_ = FALSE;
	GError * _inner_error_ = NULL;
#line 2056 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), 0ULL);
#line 2056 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail ((additional_alteration == NULL) || IS_ALTERATION (additional_alteration), 0ULL);
#line 2057 "/home/jens/Source/shotwell/src/Photo.vala"
	flags = (guint64) 0;
#line 2059 "/home/jens/Source/shotwell/src/Photo.vala"
	committed = FALSE;
#line 15998 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2060 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2060 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 16005 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			guint64 _tmp2_ = 0ULL;
			guint64 _tmp3_ = 0ULL;
			guint64 _tmp4_ = 0ULL;
			PhotoRow* _tmp5_ = NULL;
			guint64 _tmp6_ = 0ULL;
			guint64 _tmp7_ = 0ULL;
#line 2061 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2061 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->flags;
#line 2061 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = mask;
#line 2061 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = media_source_internal_add_flags (_tmp2_, _tmp3_);
#line 2061 "/home/jens/Source/shotwell/src/Photo.vala"
			flags = _tmp4_;
#line 2062 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->row;
#line 2062 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = _tmp5_->flags;
#line 2062 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = flags;
#line 2062 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp6_ != _tmp7_) {
#line 16032 "Photo.c"
				PhotoTable* _tmp8_ = NULL;
				PhotoTable* _tmp9_ = NULL;
				PhotoID _tmp10_ = {0};
				guint64 _tmp11_ = 0ULL;
				gboolean _tmp12_ = FALSE;
				gboolean _tmp13_ = FALSE;
#line 2063 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = photo_table_get_instance ();
#line 2063 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = _tmp8_;
#line 2063 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_get_photo_id (self, &_tmp10_);
#line 2063 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = flags;
#line 2063 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = photo_table_replace_flags (_tmp9_, &_tmp10_, _tmp11_);
#line 2063 "/home/jens/Source/shotwell/src/Photo.vala"
				committed = _tmp12_;
#line 2063 "/home/jens/Source/shotwell/src/Photo.vala"
				_database_table_unref0 (_tmp9_);
#line 2064 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = committed;
#line 2064 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp13_) {
#line 16057 "Photo.c"
					PhotoRow* _tmp14_ = NULL;
					guint64 _tmp15_ = 0ULL;
#line 2065 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp14_ = self->row;
#line 2065 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp15_ = flags;
#line 2065 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp14_->flags = _tmp15_;
#line 16066 "Photo.c"
				}
			}
		}
		__finally331:
		{
			PhotoRow* _tmp16_ = NULL;
#line 2060 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp16_ = self->row;
#line 2060 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 16077 "Photo.c"
		}
#line 2060 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 16081 "Photo.c"
			guint64 _tmp17_ = 0ULL;
#line 2060 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2060 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2060 "/home/jens/Source/shotwell/src/Photo.vala"
			return _tmp17_;
#line 16089 "Photo.c"
		}
	}
#line 2069 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp18_ = committed;
#line 2069 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp18_) {
#line 16096 "Photo.c"
		Alteration* _tmp19_ = NULL;
#line 2070 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp19_ = additional_alteration;
#line 2070 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_notify_flags_altered (self, _tmp19_);
#line 16102 "Photo.c"
	}
#line 2072 "/home/jens/Source/shotwell/src/Photo.vala"
	result = flags;
#line 2072 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 16108 "Photo.c"
}


guint64 photo_remove_flags (Photo* self, guint64 mask, Alteration* additional_alteration) {
	guint64 result = 0ULL;
	guint64 flags = 0ULL;
	gboolean committed = FALSE;
	gboolean _tmp18_ = FALSE;
	GError * _inner_error_ = NULL;
#line 2075 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), 0ULL);
#line 2075 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail ((additional_alteration == NULL) || IS_ALTERATION (additional_alteration), 0ULL);
#line 2076 "/home/jens/Source/shotwell/src/Photo.vala"
	flags = (guint64) 0;
#line 2078 "/home/jens/Source/shotwell/src/Photo.vala"
	committed = FALSE;
#line 16126 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2079 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2079 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 16133 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			guint64 _tmp2_ = 0ULL;
			guint64 _tmp3_ = 0ULL;
			guint64 _tmp4_ = 0ULL;
			PhotoRow* _tmp5_ = NULL;
			guint64 _tmp6_ = 0ULL;
			guint64 _tmp7_ = 0ULL;
#line 2080 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2080 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->flags;
#line 2080 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = mask;
#line 2080 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = media_source_internal_remove_flags (_tmp2_, _tmp3_);
#line 2080 "/home/jens/Source/shotwell/src/Photo.vala"
			flags = _tmp4_;
#line 2081 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->row;
#line 2081 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = _tmp5_->flags;
#line 2081 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = flags;
#line 2081 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp6_ != _tmp7_) {
#line 16160 "Photo.c"
				PhotoTable* _tmp8_ = NULL;
				PhotoTable* _tmp9_ = NULL;
				PhotoID _tmp10_ = {0};
				guint64 _tmp11_ = 0ULL;
				gboolean _tmp12_ = FALSE;
				gboolean _tmp13_ = FALSE;
#line 2082 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = photo_table_get_instance ();
#line 2082 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = _tmp8_;
#line 2082 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_get_photo_id (self, &_tmp10_);
#line 2082 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = flags;
#line 2082 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = photo_table_replace_flags (_tmp9_, &_tmp10_, _tmp11_);
#line 2082 "/home/jens/Source/shotwell/src/Photo.vala"
				committed = _tmp12_;
#line 2082 "/home/jens/Source/shotwell/src/Photo.vala"
				_database_table_unref0 (_tmp9_);
#line 2083 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = committed;
#line 2083 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp13_) {
#line 16185 "Photo.c"
					PhotoRow* _tmp14_ = NULL;
					guint64 _tmp15_ = 0ULL;
#line 2084 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp14_ = self->row;
#line 2084 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp15_ = flags;
#line 2084 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp14_->flags = _tmp15_;
#line 16194 "Photo.c"
				}
			}
		}
		__finally332:
		{
			PhotoRow* _tmp16_ = NULL;
#line 2079 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp16_ = self->row;
#line 2079 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 16205 "Photo.c"
		}
#line 2079 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 16209 "Photo.c"
			guint64 _tmp17_ = 0ULL;
#line 2079 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2079 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2079 "/home/jens/Source/shotwell/src/Photo.vala"
			return _tmp17_;
#line 16217 "Photo.c"
		}
	}
#line 2088 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp18_ = committed;
#line 2088 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp18_) {
#line 16224 "Photo.c"
		Alteration* _tmp19_ = NULL;
#line 2089 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp19_ = additional_alteration;
#line 2089 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_notify_flags_altered (self, _tmp19_);
#line 16230 "Photo.c"
	}
#line 2091 "/home/jens/Source/shotwell/src/Photo.vala"
	result = flags;
#line 2091 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 16236 "Photo.c"
}


guint64 photo_add_remove_flags (Photo* self, guint64 add, guint64 remove, Alteration* additional_alteration) {
	guint64 result = 0ULL;
	guint64 flags = 0ULL;
	gboolean committed = FALSE;
	gboolean _tmp18_ = FALSE;
	GError * _inner_error_ = NULL;
#line 2094 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), 0ULL);
#line 2094 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail ((additional_alteration == NULL) || IS_ALTERATION (additional_alteration), 0ULL);
#line 2095 "/home/jens/Source/shotwell/src/Photo.vala"
	flags = (guint64) 0;
#line 2097 "/home/jens/Source/shotwell/src/Photo.vala"
	committed = FALSE;
#line 16254 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2098 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2098 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 16261 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			guint64 _tmp2_ = 0ULL;
			guint64 _tmp3_ = 0ULL;
			guint64 _tmp4_ = 0ULL;
			PhotoRow* _tmp5_ = NULL;
			guint64 _tmp6_ = 0ULL;
			guint64 _tmp7_ = 0ULL;
#line 2099 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2099 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->flags;
#line 2099 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = add;
#line 2099 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = remove;
#line 2099 "/home/jens/Source/shotwell/src/Photo.vala"
			flags = (_tmp2_ | _tmp3_) & (~_tmp4_);
#line 2100 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->row;
#line 2100 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = _tmp5_->flags;
#line 2100 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = flags;
#line 2100 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp6_ != _tmp7_) {
#line 16288 "Photo.c"
				PhotoTable* _tmp8_ = NULL;
				PhotoTable* _tmp9_ = NULL;
				PhotoID _tmp10_ = {0};
				guint64 _tmp11_ = 0ULL;
				gboolean _tmp12_ = FALSE;
				gboolean _tmp13_ = FALSE;
#line 2101 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = photo_table_get_instance ();
#line 2101 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = _tmp8_;
#line 2101 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_get_photo_id (self, &_tmp10_);
#line 2101 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = flags;
#line 2101 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = photo_table_replace_flags (_tmp9_, &_tmp10_, _tmp11_);
#line 2101 "/home/jens/Source/shotwell/src/Photo.vala"
				committed = _tmp12_;
#line 2101 "/home/jens/Source/shotwell/src/Photo.vala"
				_database_table_unref0 (_tmp9_);
#line 2102 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = committed;
#line 2102 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp13_) {
#line 16313 "Photo.c"
					PhotoRow* _tmp14_ = NULL;
					guint64 _tmp15_ = 0ULL;
#line 2103 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp14_ = self->row;
#line 2103 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp15_ = flags;
#line 2103 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp14_->flags = _tmp15_;
#line 16322 "Photo.c"
				}
			}
		}
		__finally333:
		{
			PhotoRow* _tmp16_ = NULL;
#line 2098 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp16_ = self->row;
#line 2098 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 16333 "Photo.c"
		}
#line 2098 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 16337 "Photo.c"
			guint64 _tmp17_ = 0ULL;
#line 2098 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2098 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2098 "/home/jens/Source/shotwell/src/Photo.vala"
			return _tmp17_;
#line 16345 "Photo.c"
		}
	}
#line 2107 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp18_ = committed;
#line 2107 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp18_) {
#line 16352 "Photo.c"
		Alteration* _tmp19_ = NULL;
#line 2108 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp19_ = additional_alteration;
#line 2108 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_notify_flags_altered (self, _tmp19_);
#line 16358 "Photo.c"
	}
#line 2110 "/home/jens/Source/shotwell/src/Photo.vala"
	result = flags;
#line 2110 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 16364 "Photo.c"
}


void photo_add_remove_many_flags (GeeCollection* add, guint64 add_mask, Alteration* additional_add_alteration, GeeCollection* remove, guint64 remove_mask, Alteration* additional_remove_alteration, GError** error) {
	GeeCollection* _tmp0_ = NULL;
	GeeCollection* _tmp10_ = NULL;
	GError * _inner_error_ = NULL;
#line 2113 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((add == NULL) || GEE_IS_COLLECTION (add));
#line 2113 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((additional_add_alteration == NULL) || IS_ALTERATION (additional_add_alteration));
#line 2113 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((remove == NULL) || GEE_IS_COLLECTION (remove));
#line 2113 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((additional_remove_alteration == NULL) || IS_ALTERATION (additional_remove_alteration));
#line 2116 "/home/jens/Source/shotwell/src/Photo.vala"
	database_table_begin_transaction ();
#line 2118 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = add;
#line 2118 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp0_ != NULL) {
#line 16386 "Photo.c"
		{
			GeeIterator* _photo_it = NULL;
			GeeCollection* _tmp1_ = NULL;
			GeeIterator* _tmp2_ = NULL;
#line 2119 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = add;
#line 2119 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ITERABLE, GeeIterable));
#line 2119 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_it = _tmp2_;
#line 2119 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 16399 "Photo.c"
				GeeIterator* _tmp3_ = NULL;
				gboolean _tmp4_ = FALSE;
				Photo* photo = NULL;
				GeeIterator* _tmp5_ = NULL;
				gpointer _tmp6_ = NULL;
				Photo* _tmp7_ = NULL;
				guint64 _tmp8_ = 0ULL;
				Alteration* _tmp9_ = NULL;
#line 2119 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = _photo_it;
#line 2119 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = gee_iterator_next (_tmp3_);
#line 2119 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp4_) {
#line 2119 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 16416 "Photo.c"
				}
#line 2119 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = _photo_it;
#line 2119 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = gee_iterator_get (_tmp5_);
#line 2119 "/home/jens/Source/shotwell/src/Photo.vala"
				photo = (Photo*) _tmp6_;
#line 2120 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = photo;
#line 2120 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = add_mask;
#line 2120 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = additional_add_alteration;
#line 2120 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_add_flags (_tmp7_, _tmp8_, _tmp9_);
#line 2119 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (photo);
#line 16434 "Photo.c"
			}
#line 2119 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_photo_it);
#line 16438 "Photo.c"
		}
	}
#line 2123 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = remove;
#line 2123 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp10_ != NULL) {
#line 16445 "Photo.c"
		{
			GeeIterator* _photo_it = NULL;
			GeeCollection* _tmp11_ = NULL;
			GeeIterator* _tmp12_ = NULL;
#line 2124 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = remove;
#line 2124 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GEE_TYPE_ITERABLE, GeeIterable));
#line 2124 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_it = _tmp12_;
#line 2124 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 16458 "Photo.c"
				GeeIterator* _tmp13_ = NULL;
				gboolean _tmp14_ = FALSE;
				Photo* photo = NULL;
				GeeIterator* _tmp15_ = NULL;
				gpointer _tmp16_ = NULL;
				Photo* _tmp17_ = NULL;
				guint64 _tmp18_ = 0ULL;
				Alteration* _tmp19_ = NULL;
#line 2124 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = _photo_it;
#line 2124 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = gee_iterator_next (_tmp13_);
#line 2124 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp14_) {
#line 2124 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 16475 "Photo.c"
				}
#line 2124 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = _photo_it;
#line 2124 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = gee_iterator_get (_tmp15_);
#line 2124 "/home/jens/Source/shotwell/src/Photo.vala"
				photo = (Photo*) _tmp16_;
#line 2125 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp17_ = photo;
#line 2125 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp18_ = remove_mask;
#line 2125 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp19_ = additional_remove_alteration;
#line 2125 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_remove_flags (_tmp17_, _tmp18_, _tmp19_);
#line 2124 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (photo);
#line 16493 "Photo.c"
			}
#line 2124 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_photo_it);
#line 16497 "Photo.c"
		}
	}
#line 2128 "/home/jens/Source/shotwell/src/Photo.vala"
	database_table_commit_transaction (&_inner_error_);
#line 2128 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2128 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_inner_error_->domain == DATABASE_ERROR) {
#line 2128 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 2128 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 16510 "Photo.c"
		} else {
#line 2128 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2128 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2128 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 16518 "Photo.c"
		}
	}
}


guint64 photo_toggle_flags (Photo* self, guint64 mask, Alteration* additional_alteration) {
	guint64 result = 0ULL;
	guint64 flags = 0ULL;
	gboolean committed = FALSE;
	gboolean _tmp17_ = FALSE;
	GError * _inner_error_ = NULL;
#line 2131 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), 0ULL);
#line 2131 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail ((additional_alteration == NULL) || IS_ALTERATION (additional_alteration), 0ULL);
#line 2132 "/home/jens/Source/shotwell/src/Photo.vala"
	flags = (guint64) 0;
#line 2134 "/home/jens/Source/shotwell/src/Photo.vala"
	committed = FALSE;
#line 16538 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2135 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2135 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 16545 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			guint64 _tmp2_ = 0ULL;
			guint64 _tmp3_ = 0ULL;
			PhotoRow* _tmp4_ = NULL;
			guint64 _tmp5_ = 0ULL;
			guint64 _tmp6_ = 0ULL;
#line 2136 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2136 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->flags;
#line 2136 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = mask;
#line 2136 "/home/jens/Source/shotwell/src/Photo.vala"
			flags = _tmp2_ ^ _tmp3_;
#line 2137 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 2137 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = _tmp4_->flags;
#line 2137 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = flags;
#line 2137 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp5_ != _tmp6_) {
#line 16569 "Photo.c"
				PhotoTable* _tmp7_ = NULL;
				PhotoTable* _tmp8_ = NULL;
				PhotoID _tmp9_ = {0};
				guint64 _tmp10_ = 0ULL;
				gboolean _tmp11_ = FALSE;
				gboolean _tmp12_ = FALSE;
#line 2138 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = photo_table_get_instance ();
#line 2138 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = _tmp7_;
#line 2138 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_get_photo_id (self, &_tmp9_);
#line 2138 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = flags;
#line 2138 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = photo_table_replace_flags (_tmp8_, &_tmp9_, _tmp10_);
#line 2138 "/home/jens/Source/shotwell/src/Photo.vala"
				committed = _tmp11_;
#line 2138 "/home/jens/Source/shotwell/src/Photo.vala"
				_database_table_unref0 (_tmp8_);
#line 2139 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = committed;
#line 2139 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp12_) {
#line 16594 "Photo.c"
					PhotoRow* _tmp13_ = NULL;
					guint64 _tmp14_ = 0ULL;
#line 2140 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp13_ = self->row;
#line 2140 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp14_ = flags;
#line 2140 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp13_->flags = _tmp14_;
#line 16603 "Photo.c"
				}
			}
		}
		__finally334:
		{
			PhotoRow* _tmp15_ = NULL;
#line 2135 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp15_ = self->row;
#line 2135 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 16614 "Photo.c"
		}
#line 2135 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 16618 "Photo.c"
			guint64 _tmp16_ = 0ULL;
#line 2135 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2135 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2135 "/home/jens/Source/shotwell/src/Photo.vala"
			return _tmp16_;
#line 16626 "Photo.c"
		}
	}
#line 2144 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = committed;
#line 2144 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp17_) {
#line 16633 "Photo.c"
		Alteration* _tmp18_ = NULL;
#line 2145 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp18_ = additional_alteration;
#line 2145 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_notify_flags_altered (self, _tmp18_);
#line 16639 "Photo.c"
	}
#line 2147 "/home/jens/Source/shotwell/src/Photo.vala"
	result = flags;
#line 2147 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 16645 "Photo.c"
}


gboolean photo_is_master_metadata_dirty (Photo* self) {
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
#line 2150 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 16654 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
		gboolean _tmp5_ = FALSE;
#line 2151 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2151 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 16662 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			gboolean _tmp2_ = FALSE;
#line 2152 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2152 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->metadata_dirty;
#line 2152 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp2_;
#line 16672 "Photo.c"
			{
				PhotoRow* _tmp3_ = NULL;
#line 2151 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 2151 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 16679 "Photo.c"
			}
#line 2152 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 16683 "Photo.c"
		}
		__finally335:
		{
			PhotoRow* _tmp4_ = NULL;
#line 2151 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 2151 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 16692 "Photo.c"
		}
#line 2151 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2151 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2151 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp5_;
#line 16700 "Photo.c"
	}
}


void photo_set_master_metadata_dirty (Photo* self, gboolean dirty, GError** error) {
	gboolean committed = FALSE;
	gboolean _tmp11_ = FALSE;
	GError * _inner_error_ = NULL;
#line 2156 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 2157 "/home/jens/Source/shotwell/src/Photo.vala"
	committed = FALSE;
#line 16713 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2158 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2158 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 16720 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			gboolean _tmp2_ = FALSE;
			gboolean _tmp3_ = FALSE;
#line 2159 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2159 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->metadata_dirty;
#line 2159 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = dirty;
#line 2159 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp2_ != _tmp3_) {
#line 16733 "Photo.c"
				PhotoTable* _tmp4_ = NULL;
				PhotoTable* _tmp5_ = NULL;
				PhotoID _tmp6_ = {0};
				gboolean _tmp7_ = FALSE;
				PhotoRow* _tmp8_ = NULL;
				gboolean _tmp9_ = FALSE;
#line 2160 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = photo_table_get_instance ();
#line 2160 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = _tmp4_;
#line 2160 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_get_photo_id (self, &_tmp6_);
#line 2160 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = dirty;
#line 2160 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_table_set_metadata_dirty (_tmp5_, &_tmp6_, _tmp7_, &_inner_error_);
#line 2160 "/home/jens/Source/shotwell/src/Photo.vala"
				_database_table_unref0 (_tmp5_);
#line 2160 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 16754 "Photo.c"
					goto __finally336;
				}
#line 2161 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = self->row;
#line 2161 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = dirty;
#line 2161 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_->metadata_dirty = _tmp9_;
#line 2162 "/home/jens/Source/shotwell/src/Photo.vala"
				committed = TRUE;
#line 16765 "Photo.c"
			}
		}
		__finally336:
		{
			PhotoRow* _tmp10_ = NULL;
#line 2158 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = self->row;
#line 2158 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 16775 "Photo.c"
		}
#line 2158 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2158 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_inner_error_->domain == DATABASE_ERROR) {
#line 2158 "/home/jens/Source/shotwell/src/Photo.vala"
				g_propagate_error (error, _inner_error_);
#line 2158 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 16785 "Photo.c"
			} else {
#line 2158 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2158 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 2158 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 16793 "Photo.c"
			}
		}
	}
#line 2166 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = committed;
#line 2166 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp11_) {
#line 16801 "Photo.c"
		Alteration* _tmp12_ = NULL;
		Alteration* _tmp13_ = NULL;
#line 2167 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = alteration_new ("metadata", "master-dirty");
#line 2167 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp13_ = _tmp12_;
#line 2167 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp13_);
#line 2167 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp13_);
#line 16812 "Photo.c"
	}
}


static Rating photo_real_get_rating (MediaSource* base) {
	Photo * self;
	Rating result = 0;
	GError * _inner_error_ = NULL;
#line 2170 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 16823 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2171 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2171 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 16830 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			Rating _tmp2_ = 0;
#line 2172 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2172 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->rating;
#line 2172 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp2_;
#line 16840 "Photo.c"
			{
				PhotoRow* _tmp3_ = NULL;
#line 2171 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 2171 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 16847 "Photo.c"
			}
#line 2172 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 16851 "Photo.c"
		}
		__finally337:
		{
			PhotoRow* _tmp4_ = NULL;
#line 2171 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 2171 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 16860 "Photo.c"
		}
#line 2171 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2171 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2171 "/home/jens/Source/shotwell/src/Photo.vala"
		return 0;
#line 16868 "Photo.c"
	}
}


static void photo_real_set_rating (MediaSource* base, Rating rating) {
	Photo * self;
	gboolean committed = FALSE;
	gboolean _tmp16_ = FALSE;
	GError * _inner_error_ = NULL;
#line 2176 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 2177 "/home/jens/Source/shotwell/src/Photo.vala"
	committed = FALSE;
#line 16882 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2179 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2179 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 16889 "Photo.c"
		{
			gboolean _tmp1_ = FALSE;
			Rating _tmp2_ = 0;
			PhotoRow* _tmp3_ = NULL;
			Rating _tmp4_ = 0;
#line 2180 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = rating;
#line 2180 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = self->row;
#line 2180 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = _tmp3_->rating;
#line 2180 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp2_ != _tmp4_) {
#line 16903 "Photo.c"
				Rating _tmp5_ = 0;
				gboolean _tmp6_ = FALSE;
#line 2180 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = rating;
#line 2180 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = rating_is_valid (_tmp5_);
#line 2180 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = _tmp6_;
#line 16912 "Photo.c"
			} else {
#line 2180 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = FALSE;
#line 16916 "Photo.c"
			}
#line 2180 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp1_) {
#line 16920 "Photo.c"
				PhotoTable* _tmp7_ = NULL;
				PhotoTable* _tmp8_ = NULL;
				PhotoID _tmp9_ = {0};
				Rating _tmp10_ = 0;
				gboolean _tmp11_ = FALSE;
				gboolean _tmp12_ = FALSE;
#line 2181 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = photo_table_get_instance ();
#line 2181 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = _tmp7_;
#line 2181 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_get_photo_id (self, &_tmp9_);
#line 2181 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = rating;
#line 2181 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = photo_table_set_rating (_tmp8_, &_tmp9_, _tmp10_);
#line 2181 "/home/jens/Source/shotwell/src/Photo.vala"
				committed = _tmp11_;
#line 2181 "/home/jens/Source/shotwell/src/Photo.vala"
				_database_table_unref0 (_tmp8_);
#line 2182 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = committed;
#line 2182 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp12_) {
#line 16945 "Photo.c"
					PhotoRow* _tmp13_ = NULL;
					Rating _tmp14_ = 0;
#line 2183 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp13_ = self->row;
#line 2183 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp14_ = rating;
#line 2183 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp13_->rating = _tmp14_;
#line 16954 "Photo.c"
				}
			}
		}
		__finally338:
		{
			PhotoRow* _tmp15_ = NULL;
#line 2179 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp15_ = self->row;
#line 2179 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 16965 "Photo.c"
		}
#line 2179 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2179 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2179 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2179 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 16975 "Photo.c"
		}
	}
#line 2187 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_ = committed;
#line 2187 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp16_) {
#line 16982 "Photo.c"
		Alteration* _tmp17_ = NULL;
		Alteration* _tmp18_ = NULL;
#line 2188 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp17_ = alteration_new ("metadata", "rating");
#line 2188 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp18_ = _tmp17_;
#line 2188 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp18_);
#line 2188 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp18_);
#line 16993 "Photo.c"
	}
}


static void photo_real_increase_rating (MediaSource* base) {
	Photo * self;
	GError * _inner_error_ = NULL;
#line 2191 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 17003 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2192 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2192 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 17010 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			Rating _tmp2_ = 0;
			Rating _tmp3_ = 0;
#line 2193 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2193 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->rating;
#line 2193 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = rating_increase (_tmp2_);
#line 2193 "/home/jens/Source/shotwell/src/Photo.vala"
			media_source_set_rating (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), _tmp3_);
#line 17023 "Photo.c"
		}
		__finally339:
		{
			PhotoRow* _tmp4_ = NULL;
#line 2192 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 2192 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 17032 "Photo.c"
		}
#line 2192 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2192 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2192 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2192 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 17042 "Photo.c"
		}
	}
}


static void photo_real_decrease_rating (MediaSource* base) {
	Photo * self;
	GError * _inner_error_ = NULL;
#line 2197 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 17053 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2198 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2198 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 17060 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			Rating _tmp2_ = 0;
			Rating _tmp3_ = 0;
#line 2199 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2199 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->rating;
#line 2199 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = rating_decrease (_tmp2_);
#line 2199 "/home/jens/Source/shotwell/src/Photo.vala"
			media_source_set_rating (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), _tmp3_);
#line 17073 "Photo.c"
		}
		__finally340:
		{
			PhotoRow* _tmp4_ = NULL;
#line 2198 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 2198 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 17082 "Photo.c"
		}
#line 2198 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2198 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2198 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2198 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 17092 "Photo.c"
		}
	}
}


static void photo_real_commit_backlinks (DataSource* base, SourceCollection* sources, const gchar* backlinks) {
	Photo * self;
	GError * _inner_error_ = NULL;
#line 2203 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 2203 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((sources == NULL) || IS_SOURCE_COLLECTION (sources));
#line 17105 "Photo.c"
	{
		PhotoTable* _tmp0_ = NULL;
		PhotoTable* _tmp1_ = NULL;
		PhotoID _tmp2_ = {0};
		const gchar* _tmp3_ = NULL;
#line 2208 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = photo_table_get_instance ();
#line 2208 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = _tmp0_;
#line 2208 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_get_photo_id (self, &_tmp2_);
#line 2208 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = backlinks;
#line 2208 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_table_update_backlinks (_tmp1_, &_tmp2_, _tmp3_, &_inner_error_);
#line 2208 "/home/jens/Source/shotwell/src/Photo.vala"
		_database_table_unref0 (_tmp1_);
#line 2208 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2208 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_inner_error_->domain == DATABASE_ERROR) {
#line 17127 "Photo.c"
				goto __catch341_database_error;
			}
#line 2208 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2208 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2208 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 17136 "Photo.c"
		}
		{
			PhotoRow* _tmp4_ = NULL;
#line 2209 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 2209 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_lock (&self->priv->__lock_row);
#line 17144 "Photo.c"
			{
				PhotoRow* _tmp5_ = NULL;
				const gchar* _tmp6_ = NULL;
				gchar* _tmp7_ = NULL;
#line 2210 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = self->row;
#line 2210 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = backlinks;
#line 2210 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = g_strdup (_tmp6_);
#line 2210 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (_tmp5_->backlinks);
#line 2210 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_->backlinks = _tmp7_;
#line 17159 "Photo.c"
			}
			__finally342:
			{
				PhotoRow* _tmp8_ = NULL;
#line 2209 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = self->row;
#line 2209 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 17168 "Photo.c"
			}
#line 2209 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2209 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_inner_error_->domain == DATABASE_ERROR) {
#line 17174 "Photo.c"
					goto __catch341_database_error;
				}
#line 2209 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2209 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 2209 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 17183 "Photo.c"
			}
		}
	}
	goto __finally341;
	__catch341_database_error:
	{
		GError* err = NULL;
		gchar* _tmp9_ = NULL;
		gchar* _tmp10_ = NULL;
		GError* _tmp11_ = NULL;
		const gchar* _tmp12_ = NULL;
#line 2207 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 2207 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 2213 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp9_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 2213 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp10_ = _tmp9_;
#line 2213 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = err;
#line 2213 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = _tmp11_->message;
#line 2213 "/home/jens/Source/shotwell/src/Photo.vala"
		g_warning ("Photo.vala:2213: Unable to update link state for %s: %s", _tmp10_, _tmp12_);
#line 2213 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp10_);
#line 2207 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 17213 "Photo.c"
	}
	__finally341:
#line 2207 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2207 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2207 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2207 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 17224 "Photo.c"
	}
}


static gboolean photo_real_set_event_id (MediaSource* base, EventID* event_id) {
	Photo * self;
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
#line 2221 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 2221 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (event_id != NULL, FALSE);
#line 17237 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
		gboolean _tmp13_ = FALSE;
#line 2222 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2222 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 17245 "Photo.c"
		{
			gboolean committed = FALSE;
			PhotoTable* _tmp1_ = NULL;
			PhotoTable* _tmp2_ = NULL;
			PhotoRow* _tmp3_ = NULL;
			PhotoID _tmp4_ = {0};
			EventID _tmp5_ = {0};
			gboolean _tmp6_ = FALSE;
			gboolean _tmp7_ = FALSE;
			gboolean _tmp8_ = FALSE;
#line 2223 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = photo_table_get_instance ();
#line 2223 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_;
#line 2223 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = self->row;
#line 2223 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = _tmp3_->photo_id;
#line 2223 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = *event_id;
#line 2223 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = photo_table_set_event (_tmp2_, &_tmp4_, &_tmp5_);
#line 2223 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = _tmp6_;
#line 2223 "/home/jens/Source/shotwell/src/Photo.vala"
			_database_table_unref0 (_tmp2_);
#line 2223 "/home/jens/Source/shotwell/src/Photo.vala"
			committed = _tmp7_;
#line 2225 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = committed;
#line 2225 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp8_) {
#line 17278 "Photo.c"
				PhotoRow* _tmp9_ = NULL;
				EventID _tmp10_ = {0};
#line 2226 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = self->row;
#line 2226 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = *event_id;
#line 2226 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_->event_id = _tmp10_;
#line 17287 "Photo.c"
			}
#line 2228 "/home/jens/Source/shotwell/src/Photo.vala"
			result = committed;
#line 17291 "Photo.c"
			{
				PhotoRow* _tmp11_ = NULL;
#line 2222 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = self->row;
#line 2222 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 17298 "Photo.c"
			}
#line 2228 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 17302 "Photo.c"
		}
		__finally343:
		{
			PhotoRow* _tmp12_ = NULL;
#line 2222 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = self->row;
#line 2222 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 17311 "Photo.c"
		}
#line 2222 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2222 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2222 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp13_;
#line 17319 "Photo.c"
	}
}


static gchar* photo_real_to_string (DataObject* base) {
	Photo * self;
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	PhotoID _tmp10_ = {0};
	gint64 _tmp11_ = 0LL;
	gchar* _tmp12_ = NULL;
	gchar* _tmp13_ = NULL;
	PhotoFileReader* _tmp14_ = NULL;
	PhotoFileReader* _tmp15_ = NULL;
	gchar* _tmp16_ = NULL;
	gchar* _tmp17_ = NULL;
	gchar* _tmp18_ = NULL;
	gchar* _tmp19_ = NULL;
#line 2232 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 2234 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = photo_is_master_baseline (self);
#line 2234 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp1_) {
#line 17345 "Photo.c"
		GFile* _tmp2_ = NULL;
		GFile* _tmp3_ = NULL;
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
#line 2234 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = photo_get_actual_file (self);
#line 2234 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = _tmp2_;
#line 2234 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = g_file_get_path (_tmp3_);
#line 2234 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = _tmp4_;
#line 2234 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = g_strconcat (" (", _tmp5_, NULL);
#line 2234 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = _tmp6_;
#line 2234 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = g_strconcat (_tmp7_, ")", NULL);
#line 2234 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp0_);
#line 2234 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = _tmp8_;
#line 2234 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp7_);
#line 2234 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp5_);
#line 2234 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp3_);
#line 17377 "Photo.c"
	} else {
		gchar* _tmp9_ = NULL;
#line 2234 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp9_ = g_strdup ("");
#line 2234 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp0_);
#line 2234 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = _tmp9_;
#line 17386 "Photo.c"
	}
#line 2233 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_get_photo_id (self, &_tmp10_);
#line 2233 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = _tmp10_.id;
#line 2233 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = g_strdup_printf ("%" G_GINT64_FORMAT, _tmp11_);
#line 2233 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = _tmp12_;
#line 2233 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = photo_get_master_reader (self);
#line 2233 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = _tmp14_;
#line 2233 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_ = photo_file_adapter_get_filepath (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 2233 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = _tmp16_;
#line 2233 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp18_ = g_strdup_printf ("[%s] %s%s", _tmp13_, _tmp17_, _tmp0_);
#line 2233 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp19_ = _tmp18_;
#line 2233 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp17_);
#line 2233 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (_tmp15_);
#line 2233 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp13_);
#line 2233 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp19_;
#line 2233 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp0_);
#line 2233 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 17420 "Photo.c"
}


static gboolean photo_real_equals (DataSource* base, DataSource* source) {
	Photo * self;
	gboolean result = FALSE;
	Photo* photo = NULL;
	DataSource* _tmp0_ = NULL;
	Photo* _tmp1_ = NULL;
	Photo* _tmp2_ = NULL;
	DataSource* _tmp14_ = NULL;
	gboolean _tmp15_ = FALSE;
#line 2237 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 2237 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail ((source == NULL) || IS_DATA_SOURCE (source), FALSE);
#line 2239 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = source;
#line 2239 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, TYPE_PHOTO) ? ((Photo*) _tmp0_) : NULL);
#line 2239 "/home/jens/Source/shotwell/src/Photo.vala"
	photo = _tmp1_;
#line 2240 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo;
#line 2240 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp2_ != NULL) {
#line 17447 "Photo.c"
		PhotoID photo_id = {0};
		PhotoID _tmp3_ = {0};
		PhotoID other_photo_id = {0};
		Photo* _tmp4_ = NULL;
		PhotoID _tmp5_ = {0};
		gboolean _tmp6_ = FALSE;
		Photo* _tmp7_ = NULL;
#line 2241 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_get_photo_id (self, &_tmp3_);
#line 2241 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_id = _tmp3_;
#line 2242 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = photo;
#line 2242 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_get_photo_id (_tmp4_, &_tmp5_);
#line 2242 "/home/jens/Source/shotwell/src/Photo.vala"
		other_photo_id = _tmp5_;
#line 2244 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = photo;
#line 2244 "/home/jens/Source/shotwell/src/Photo.vala"
		if (self != _tmp7_) {
#line 17469 "Photo.c"
			PhotoID _tmp8_ = {0};
			gint64 _tmp9_ = 0LL;
#line 2244 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = photo_id;
#line 2244 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = _tmp8_.id;
#line 2244 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = _tmp9_ != PHOTO_ID_INVALID;
#line 17478 "Photo.c"
		} else {
#line 2244 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = FALSE;
#line 17482 "Photo.c"
		}
#line 2244 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp6_) {
#line 17486 "Photo.c"
			PhotoID _tmp10_ = {0};
			gint64 _tmp11_ = 0LL;
			PhotoID _tmp12_ = {0};
			gint64 _tmp13_ = 0LL;
#line 2245 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = photo_id;
#line 2245 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = _tmp10_.id;
#line 2245 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = other_photo_id;
#line 2245 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = _tmp12_.id;
#line 2245 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_assert (_tmp11_ != _tmp13_, "photo_id.id != other_photo_id.id");
#line 17501 "Photo.c"
		}
	}
#line 2249 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = source;
#line 2249 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = DATA_SOURCE_CLASS (photo_parent_class)->equals (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_SOURCE, PhotoSource), TYPE_DATA_SOURCE, DataSource), _tmp14_);
#line 2249 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp15_;
#line 2249 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (photo);
#line 2249 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 17514 "Photo.c"
}


static void photo_file_exif_updated (Photo* self) {
	GFile* file = NULL;
	GFile* _tmp0_ = NULL;
	GFileInfo* info = NULL;
	GTimeVal timestamp = {0};
	GFileInfo* _tmp7_ = NULL;
	GTimeVal _tmp8_ = {0};
	PhotoFileInterrogator* interrogator = NULL;
	PhotoFileInterrogator* _tmp9_ = NULL;
	DetectedPhotoInformation* detected = NULL;
	DetectedPhotoInformation* _tmp14_ = NULL;
	gboolean _tmp15_ = FALSE;
	DetectedPhotoInformation* _tmp16_ = NULL;
	gboolean success = FALSE;
	gboolean _tmp37_ = FALSE;
	GError * _inner_error_ = NULL;
#line 2253 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 2254 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = media_source_get_file (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 2254 "/home/jens/Source/shotwell/src/Photo.vala"
	file = _tmp0_;
#line 2256 "/home/jens/Source/shotwell/src/Photo.vala"
	info = NULL;
#line 17542 "Photo.c"
	{
		GFileInfo* _tmp1_ = NULL;
		GFileInfo* _tmp2_ = NULL;
		GFileInfo* _tmp3_ = NULL;
#line 2258 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = g_file_query_info (file, DIRECTORY_MONITOR_SUPPLIED_ATTRIBUTES, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &_inner_error_);
#line 2258 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = _tmp2_;
#line 2258 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 17553 "Photo.c"
			goto __catch344_g_error;
		}
#line 2258 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = _tmp1_;
#line 2258 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = NULL;
#line 2258 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 2258 "/home/jens/Source/shotwell/src/Photo.vala"
		info = _tmp3_;
#line 2257 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp1_);
#line 17566 "Photo.c"
	}
	goto __finally344;
	__catch344_g_error:
	{
		GError* err = NULL;
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		const gchar* _tmp6_ = NULL;
#line 2257 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 2257 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 2261 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 2261 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = _tmp4_;
#line 2261 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = err->message;
#line 2261 "/home/jens/Source/shotwell/src/Photo.vala"
		g_error ("Photo.vala:2261: Unable to read file information for %s: %s", _tmp5_, _tmp6_);
#line 2261 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp5_);
#line 2257 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 17591 "Photo.c"
	}
	__finally344:
#line 2257 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2257 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 2257 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 2257 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2257 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2257 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 17606 "Photo.c"
	}
#line 2264 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = info;
#line 2264 "/home/jens/Source/shotwell/src/Photo.vala"
	g_file_info_get_modification_time (_tmp7_, &_tmp8_);
#line 2264 "/home/jens/Source/shotwell/src/Photo.vala"
	timestamp = _tmp8_;
#line 2267 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = photo_file_interrogator_new (file, PHOTO_FILE_SNIFFER_OPTIONS_GET_ALL);
#line 2267 "/home/jens/Source/shotwell/src/Photo.vala"
	interrogator = _tmp9_;
#line 17618 "Photo.c"
	{
#line 2269 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_file_interrogator_interrogate (interrogator, &_inner_error_);
#line 2269 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 17624 "Photo.c"
			goto __catch345_g_error;
		}
	}
	goto __finally345;
	__catch345_g_error:
	{
		GError* err = NULL;
		gchar* _tmp10_ = NULL;
		gchar* _tmp11_ = NULL;
		GError* _tmp12_ = NULL;
		const gchar* _tmp13_ = NULL;
#line 2268 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 2268 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 2271 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp10_ = g_file_get_path (file);
#line 2271 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = _tmp10_;
#line 2271 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = err;
#line 2271 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp13_ = _tmp12_->message;
#line 2271 "/home/jens/Source/shotwell/src/Photo.vala"
		g_warning ("Photo.vala:2271: Unable to interrogate photo file %s: %s", _tmp11_, _tmp13_);
#line 2271 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp11_);
#line 2268 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 17654 "Photo.c"
	}
	__finally345:
#line 2268 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2268 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_interrogator_unref0 (interrogator);
#line 2268 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 2268 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 2268 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2268 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2268 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 17671 "Photo.c"
	}
#line 2274 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = photo_file_interrogator_get_detected_photo_information (interrogator);
#line 2274 "/home/jens/Source/shotwell/src/Photo.vala"
	detected = _tmp14_;
#line 2275 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_ = detected;
#line 2275 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp16_ == NULL) {
#line 2275 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp15_ = TRUE;
#line 17683 "Photo.c"
	} else {
		gboolean _tmp17_ = FALSE;
#line 2275 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp17_ = photo_file_interrogator_get_is_photo_corrupted (interrogator);
#line 2275 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp15_ = _tmp17_;
#line 17690 "Photo.c"
	}
#line 2275 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp15_) {
#line 17694 "Photo.c"
		gchar* _tmp18_ = NULL;
		gchar* _tmp19_ = NULL;
#line 2276 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp18_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 2276 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp19_ = _tmp18_;
#line 2276 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("Photo.vala:2276: file_exif_updated: %s no longer an image", _tmp19_);
#line 2276 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp19_);
#line 2278 "/home/jens/Source/shotwell/src/Photo.vala"
		_detected_photo_information_unref0 (detected);
#line 2278 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_interrogator_unref0 (interrogator);
#line 2278 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 2278 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 2278 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 17715 "Photo.c"
	}
	{
		PhotoRow* _tmp20_ = NULL;
#line 2282 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = self->row;
#line 2282 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 17723 "Photo.c"
		{
			PhotoTable* _tmp21_ = NULL;
			PhotoTable* _tmp22_ = NULL;
			PhotoID _tmp23_ = {0};
			GFileInfo* _tmp24_ = NULL;
			gint64 _tmp25_ = 0LL;
			GTimeVal _tmp26_ = {0};
			glong _tmp27_ = 0L;
			DetectedPhotoInformation* _tmp28_ = NULL;
			const gchar* _tmp29_ = NULL;
			DetectedPhotoInformation* _tmp30_ = NULL;
			const gchar* _tmp31_ = NULL;
			DetectedPhotoInformation* _tmp32_ = NULL;
			const gchar* _tmp33_ = NULL;
			PhotoRow* _tmp34_ = NULL;
			gboolean _tmp35_ = FALSE;
#line 2283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp21_ = photo_table_get_instance ();
#line 2283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp22_ = _tmp21_;
#line 2283 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_get_photo_id (self, &_tmp23_);
#line 2283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp24_ = info;
#line 2283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp25_ = g_file_info_get_size (_tmp24_);
#line 2283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp26_ = timestamp;
#line 2283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp27_ = _tmp26_.tv_sec;
#line 2283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp28_ = detected;
#line 2283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp29_ = _tmp28_->md5;
#line 2283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp30_ = detected;
#line 2283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp31_ = _tmp30_->exif_md5;
#line 2283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp32_ = detected;
#line 2283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp33_ = _tmp32_->thumbnail_md5;
#line 2283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp34_ = self->row;
#line 2283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp35_ = photo_table_master_exif_updated (_tmp22_, &_tmp23_, _tmp25_, _tmp27_, _tmp29_, _tmp31_, _tmp33_, _tmp34_);
#line 2283 "/home/jens/Source/shotwell/src/Photo.vala"
			success = _tmp35_;
#line 2283 "/home/jens/Source/shotwell/src/Photo.vala"
			_database_table_unref0 (_tmp22_);
#line 17774 "Photo.c"
		}
		__finally346:
		{
			PhotoRow* _tmp36_ = NULL;
#line 2282 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp36_ = self->row;
#line 2282 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 17783 "Photo.c"
		}
#line 2282 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2282 "/home/jens/Source/shotwell/src/Photo.vala"
			_detected_photo_information_unref0 (detected);
#line 2282 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_interrogator_unref0 (interrogator);
#line 2282 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (info);
#line 2282 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (file);
#line 2282 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2282 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2282 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 17801 "Photo.c"
		}
	}
#line 2287 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp37_ = success;
#line 2287 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp37_) {
#line 17808 "Photo.c"
		Alteration* _tmp38_ = NULL;
		Alteration* _tmp39_ = NULL;
#line 2288 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp38_ = alteration_new_from_list ("metadata:exif,metadata:md5");
#line 2288 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp39_ = _tmp38_;
#line 2288 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp39_);
#line 2288 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp39_);
#line 17819 "Photo.c"
	}
#line 2253 "/home/jens/Source/shotwell/src/Photo.vala"
	_detected_photo_information_unref0 (detected);
#line 2253 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_interrogator_unref0 (interrogator);
#line 2253 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (info);
#line 2253 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (file);
#line 17829 "Photo.c"
}


static guint64 photo_real_get_filesize (MediaSource* base) {
	Photo * self;
	guint64 result = 0ULL;
	GError * _inner_error_ = NULL;
#line 2293 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 17839 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
		guint64 _tmp5_ = 0ULL;
#line 2294 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2294 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 17847 "Photo.c"
		{
			BackingPhotoRow* _tmp1_ = NULL;
			gint64 _tmp2_ = 0LL;
#line 2295 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->backing_photo_row;
#line 2295 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->filesize;
#line 2295 "/home/jens/Source/shotwell/src/Photo.vala"
			result = (guint64) _tmp2_;
#line 17857 "Photo.c"
			{
				PhotoRow* _tmp3_ = NULL;
#line 2294 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 2294 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 17864 "Photo.c"
			}
#line 2295 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 17868 "Photo.c"
		}
		__finally347:
		{
			PhotoRow* _tmp4_ = NULL;
#line 2294 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 2294 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 17877 "Photo.c"
		}
#line 2294 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2294 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2294 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp5_;
#line 17885 "Photo.c"
	}
}


static guint64 photo_real_get_master_filesize (MediaSource* base) {
	Photo * self;
	guint64 result = 0ULL;
	GError * _inner_error_ = NULL;
#line 2299 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 17896 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
		guint64 _tmp6_ = 0ULL;
#line 2300 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2300 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 17904 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			BackingPhotoRow* _tmp2_ = NULL;
			gint64 _tmp3_ = 0LL;
#line 2301 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2301 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->master;
#line 2301 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = _tmp2_->filesize;
#line 2301 "/home/jens/Source/shotwell/src/Photo.vala"
			result = (guint64) _tmp3_;
#line 17917 "Photo.c"
			{
				PhotoRow* _tmp4_ = NULL;
#line 2300 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = self->row;
#line 2300 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 17924 "Photo.c"
			}
#line 2301 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 17928 "Photo.c"
		}
		__finally348:
		{
			PhotoRow* _tmp5_ = NULL;
#line 2300 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->row;
#line 2300 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 17937 "Photo.c"
		}
#line 2300 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2300 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2300 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp6_;
#line 17945 "Photo.c"
	}
}


guint64 photo_get_editable_filesize (Photo* self) {
	guint64 result = 0ULL;
	GError * _inner_error_ = NULL;
#line 2305 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), 0ULL);
#line 17955 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
		guint64 _tmp5_ = 0ULL;
#line 2306 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2306 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 17963 "Photo.c"
		{
			BackingPhotoRow* _tmp1_ = NULL;
			gint64 _tmp2_ = 0LL;
#line 2307 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->editable;
#line 2307 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->filesize;
#line 2307 "/home/jens/Source/shotwell/src/Photo.vala"
			result = (guint64) _tmp2_;
#line 17973 "Photo.c"
			{
				PhotoRow* _tmp3_ = NULL;
#line 2306 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 2306 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 17980 "Photo.c"
			}
#line 2307 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 17984 "Photo.c"
		}
		__finally349:
		{
			PhotoRow* _tmp4_ = NULL;
#line 2306 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 2306 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 17993 "Photo.c"
		}
#line 2306 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2306 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2306 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp5_;
#line 18001 "Photo.c"
	}
}


static time_t photo_real_get_exposure_time (Dateable* base) {
	Photo * self;
	time_t result = 0;
	time_t _tmp0_ = 0;
#line 2311 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 2312 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = self->priv->cached_exposure_time;
#line 2312 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 2312 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 18018 "Photo.c"
}


static gchar* photo_real_get_basename (MediaSource* base) {
	Photo * self;
	gchar* result = NULL;
	GError * _inner_error_ = NULL;
#line 2315 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 18028 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2316 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2316 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 18035 "Photo.c"
		{
			const gchar* _tmp1_ = NULL;
			gchar* _tmp2_ = NULL;
#line 2317 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->file_title;
#line 2317 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = g_strdup (_tmp1_);
#line 2317 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp2_;
#line 18045 "Photo.c"
			{
				PhotoRow* _tmp3_ = NULL;
#line 2316 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 2316 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 18052 "Photo.c"
			}
#line 2317 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 18056 "Photo.c"
		}
		__finally350:
		{
			PhotoRow* _tmp4_ = NULL;
#line 2316 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 2316 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 18065 "Photo.c"
		}
#line 2316 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2316 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2316 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 18073 "Photo.c"
	}
}


static gchar* photo_real_get_title (MediaSource* base) {
	Photo * self;
	gchar* result = NULL;
	GError * _inner_error_ = NULL;
#line 2321 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 18084 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2322 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2322 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 18091 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			const gchar* _tmp2_ = NULL;
			gchar* _tmp3_ = NULL;
#line 2323 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2323 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->title;
#line 2323 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = g_strdup (_tmp2_);
#line 2323 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp3_;
#line 18104 "Photo.c"
			{
				PhotoRow* _tmp4_ = NULL;
#line 2322 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = self->row;
#line 2322 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 18111 "Photo.c"
			}
#line 2323 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 18115 "Photo.c"
		}
		__finally351:
		{
			PhotoRow* _tmp5_ = NULL;
#line 2322 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->row;
#line 2322 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 18124 "Photo.c"
		}
#line 2322 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2322 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2322 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 18132 "Photo.c"
	}
}


static gchar* photo_real_get_comment (MediaSource* base) {
	Photo * self;
	gchar* result = NULL;
	GError * _inner_error_ = NULL;
#line 2327 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 18143 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2328 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2328 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 18150 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			const gchar* _tmp2_ = NULL;
			gchar* _tmp3_ = NULL;
#line 2329 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2329 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->comment;
#line 2329 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = g_strdup (_tmp2_);
#line 2329 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp3_;
#line 18163 "Photo.c"
			{
				PhotoRow* _tmp4_ = NULL;
#line 2328 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = self->row;
#line 2328 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 18170 "Photo.c"
			}
#line 2329 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 18174 "Photo.c"
		}
		__finally352:
		{
			PhotoRow* _tmp5_ = NULL;
#line 2328 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->row;
#line 2328 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 18183 "Photo.c"
		}
#line 2328 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2328 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2328 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 18191 "Photo.c"
	}
}


static void photo_real_set_title (MediaSource* base, const gchar* title) {
	Photo * self;
	gchar* new_title = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gboolean committed = FALSE;
	gboolean _tmp18_ = FALSE;
	GError * _inner_error_ = NULL;
#line 2333 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 2334 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = title;
#line 2334 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = media_source_prep_title (_tmp0_);
#line 2334 "/home/jens/Source/shotwell/src/Photo.vala"
	new_title = _tmp1_;
#line 2336 "/home/jens/Source/shotwell/src/Photo.vala"
	committed = FALSE;
#line 18214 "Photo.c"
	{
		PhotoRow* _tmp2_ = NULL;
#line 2337 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = self->row;
#line 2337 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 18221 "Photo.c"
		{
			const gchar* _tmp3_ = NULL;
			PhotoRow* _tmp4_ = NULL;
			const gchar* _tmp5_ = NULL;
			PhotoTable* _tmp7_ = NULL;
			PhotoTable* _tmp8_ = NULL;
			PhotoRow* _tmp9_ = NULL;
			PhotoID _tmp10_ = {0};
			const gchar* _tmp11_ = NULL;
			gboolean _tmp12_ = FALSE;
			gboolean _tmp13_ = FALSE;
#line 2338 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = new_title;
#line 2338 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 2338 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = _tmp4_->title;
#line 2338 "/home/jens/Source/shotwell/src/Photo.vala"
			if (g_strcmp0 (_tmp3_, _tmp5_) == 0) {
#line 18241 "Photo.c"
				{
					PhotoRow* _tmp6_ = NULL;
#line 2337 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp6_ = self->row;
#line 2337 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_row);
#line 18248 "Photo.c"
				}
#line 2339 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (new_title);
#line 2339 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 18254 "Photo.c"
			}
#line 2341 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = photo_table_get_instance ();
#line 2341 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = _tmp7_;
#line 2341 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = self->row;
#line 2341 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = _tmp9_->photo_id;
#line 2341 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = new_title;
#line 2341 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = photo_table_set_title (_tmp8_, &_tmp10_, _tmp11_);
#line 2341 "/home/jens/Source/shotwell/src/Photo.vala"
			committed = _tmp12_;
#line 2341 "/home/jens/Source/shotwell/src/Photo.vala"
			_database_table_unref0 (_tmp8_);
#line 2342 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = committed;
#line 2342 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp13_) {
#line 18276 "Photo.c"
				PhotoRow* _tmp14_ = NULL;
				const gchar* _tmp15_ = NULL;
				gchar* _tmp16_ = NULL;
#line 2343 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = self->row;
#line 2343 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = new_title;
#line 2343 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = g_strdup (_tmp15_);
#line 2343 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (_tmp14_->title);
#line 2343 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_->title = _tmp16_;
#line 18290 "Photo.c"
			}
		}
		__finally353:
		{
			PhotoRow* _tmp17_ = NULL;
#line 2337 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp17_ = self->row;
#line 2337 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 18300 "Photo.c"
		}
#line 2337 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2337 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (new_title);
#line 2337 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2337 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2337 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 18312 "Photo.c"
		}
	}
#line 2346 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp18_ = committed;
#line 2346 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp18_) {
#line 18319 "Photo.c"
		Alteration* _tmp19_ = NULL;
		Alteration* _tmp20_ = NULL;
#line 2347 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp19_ = alteration_new ("metadata", "name");
#line 2347 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = _tmp19_;
#line 2347 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp20_);
#line 2347 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp20_);
#line 18330 "Photo.c"
	}
#line 2333 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (new_title);
#line 18334 "Photo.c"
}


static gboolean photo_real_set_comment (MediaSource* base, const gchar* comment) {
	Photo * self;
	gboolean result = FALSE;
	gchar* new_comment = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gboolean committed = FALSE;
	gboolean _tmp19_ = FALSE;
	GError * _inner_error_ = NULL;
#line 2350 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 2351 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = comment;
#line 2351 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = media_source_prep_comment (_tmp0_);
#line 2351 "/home/jens/Source/shotwell/src/Photo.vala"
	new_comment = _tmp1_;
#line 2353 "/home/jens/Source/shotwell/src/Photo.vala"
	committed = FALSE;
#line 18357 "Photo.c"
	{
		PhotoRow* _tmp2_ = NULL;
#line 2354 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = self->row;
#line 2354 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 18364 "Photo.c"
		{
			const gchar* _tmp3_ = NULL;
			PhotoRow* _tmp4_ = NULL;
			const gchar* _tmp5_ = NULL;
			PhotoTable* _tmp7_ = NULL;
			PhotoTable* _tmp8_ = NULL;
			PhotoRow* _tmp9_ = NULL;
			PhotoID _tmp10_ = {0};
			const gchar* _tmp11_ = NULL;
			gboolean _tmp12_ = FALSE;
			gboolean _tmp13_ = FALSE;
#line 2355 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = new_comment;
#line 2355 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 2355 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = _tmp4_->comment;
#line 2355 "/home/jens/Source/shotwell/src/Photo.vala"
			if (g_strcmp0 (_tmp3_, _tmp5_) == 0) {
#line 2356 "/home/jens/Source/shotwell/src/Photo.vala"
				result = TRUE;
#line 18386 "Photo.c"
				{
					PhotoRow* _tmp6_ = NULL;
#line 2354 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp6_ = self->row;
#line 2354 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_row);
#line 18393 "Photo.c"
				}
#line 2356 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (new_comment);
#line 2356 "/home/jens/Source/shotwell/src/Photo.vala"
				return result;
#line 18399 "Photo.c"
			}
#line 2358 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = photo_table_get_instance ();
#line 2358 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = _tmp7_;
#line 2358 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = self->row;
#line 2358 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = _tmp9_->photo_id;
#line 2358 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = new_comment;
#line 2358 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = photo_table_set_comment (_tmp8_, &_tmp10_, _tmp11_);
#line 2358 "/home/jens/Source/shotwell/src/Photo.vala"
			committed = _tmp12_;
#line 2358 "/home/jens/Source/shotwell/src/Photo.vala"
			_database_table_unref0 (_tmp8_);
#line 2359 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = committed;
#line 2359 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp13_) {
#line 18421 "Photo.c"
				PhotoRow* _tmp14_ = NULL;
				const gchar* _tmp15_ = NULL;
				gchar* _tmp16_ = NULL;
#line 2360 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = self->row;
#line 2360 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = new_comment;
#line 2360 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = g_strdup (_tmp15_);
#line 2360 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (_tmp14_->comment);
#line 2360 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_->comment = _tmp16_;
#line 18435 "Photo.c"
			}
		}
		__finally354:
		{
			PhotoRow* _tmp17_ = NULL;
#line 2354 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp17_ = self->row;
#line 2354 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 18445 "Photo.c"
		}
#line 2354 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 18449 "Photo.c"
			gboolean _tmp18_ = FALSE;
#line 2354 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (new_comment);
#line 2354 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2354 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2354 "/home/jens/Source/shotwell/src/Photo.vala"
			return _tmp18_;
#line 18459 "Photo.c"
		}
	}
#line 2363 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp19_ = committed;
#line 2363 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp19_) {
#line 18466 "Photo.c"
		Alteration* _tmp20_ = NULL;
		Alteration* _tmp21_ = NULL;
#line 2364 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = alteration_new ("metadata", "comment");
#line 2364 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = _tmp20_;
#line 2364 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp21_);
#line 2364 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp21_);
#line 18477 "Photo.c"
	}
#line 2366 "/home/jens/Source/shotwell/src/Photo.vala"
	result = committed;
#line 2366 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (new_comment);
#line 2366 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 18485 "Photo.c"
}


static gpointer _g_error_copy0 (gpointer self) {
#line 2376 "/home/jens/Source/shotwell/src/Photo.vala"
	return self ? g_error_copy (self) : NULL;
#line 18492 "Photo.c"
}


void photo_set_import_id (Photo* self, ImportID* import_id) {
	GError* dberr = NULL;
	GError* _tmp13_ = NULL;
	GError * _inner_error_ = NULL;
#line 2369 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 2369 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (import_id != NULL);
#line 2370 "/home/jens/Source/shotwell/src/Photo.vala"
	dberr = NULL;
#line 18506 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2371 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2371 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 18513 "Photo.c"
		{
			{
				PhotoTable* _tmp1_ = NULL;
				PhotoTable* _tmp2_ = NULL;
				PhotoRow* _tmp3_ = NULL;
				PhotoID _tmp4_ = {0};
				ImportID _tmp5_ = {0};
				PhotoRow* _tmp7_ = NULL;
				ImportID _tmp8_ = {0};
#line 2373 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = photo_table_get_instance ();
#line 2373 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp2_ = _tmp1_;
#line 2373 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 2373 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = _tmp3_->photo_id;
#line 2373 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = *import_id;
#line 2373 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_table_set_import_id (_tmp2_, &_tmp4_, &_tmp5_, &_inner_error_);
#line 2373 "/home/jens/Source/shotwell/src/Photo.vala"
				_database_table_unref0 (_tmp2_);
#line 2373 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2373 "/home/jens/Source/shotwell/src/Photo.vala"
					if (_inner_error_->domain == DATABASE_ERROR) {
#line 18541 "Photo.c"
						goto __catch356_database_error;
					}
					{
						PhotoRow* _tmp6_ = NULL;
#line 2371 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp6_ = self->row;
#line 2371 "/home/jens/Source/shotwell/src/Photo.vala"
						g_rec_mutex_unlock (&self->priv->__lock_row);
#line 18550 "Photo.c"
					}
#line 2373 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_error_free0 (dberr);
#line 2373 "/home/jens/Source/shotwell/src/Photo.vala"
					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2373 "/home/jens/Source/shotwell/src/Photo.vala"
					g_clear_error (&_inner_error_);
#line 2373 "/home/jens/Source/shotwell/src/Photo.vala"
					return;
#line 18560 "Photo.c"
				}
#line 2374 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = self->row;
#line 2374 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = *import_id;
#line 2374 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_->import_id = _tmp8_;
#line 18568 "Photo.c"
			}
			goto __finally356;
			__catch356_database_error:
			{
				GError* err = NULL;
				GError* _tmp9_ = NULL;
				GError* _tmp10_ = NULL;
#line 2372 "/home/jens/Source/shotwell/src/Photo.vala"
				err = _inner_error_;
#line 2372 "/home/jens/Source/shotwell/src/Photo.vala"
				_inner_error_ = NULL;
#line 2376 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = err;
#line 2376 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = _g_error_copy0 (_tmp9_);
#line 2376 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_error_free0 (dberr);
#line 2376 "/home/jens/Source/shotwell/src/Photo.vala"
				dberr = _tmp10_;
#line 2372 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_error_free0 (err);
#line 18590 "Photo.c"
			}
			__finally356:
#line 2372 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 18595 "Photo.c"
				{
					PhotoRow* _tmp11_ = NULL;
#line 2371 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp11_ = self->row;
#line 2371 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_row);
#line 18602 "Photo.c"
				}
#line 2372 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_error_free0 (dberr);
#line 2372 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2372 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 2372 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 18612 "Photo.c"
			}
		}
		__finally355:
		{
			PhotoRow* _tmp12_ = NULL;
#line 2371 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = self->row;
#line 2371 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 18622 "Photo.c"
		}
#line 2371 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2371 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_error_free0 (dberr);
#line 2371 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2371 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2371 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 18634 "Photo.c"
		}
	}
#line 2380 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = dberr;
#line 2380 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp13_ == NULL) {
#line 18641 "Photo.c"
		Alteration* _tmp14_ = NULL;
		Alteration* _tmp15_ = NULL;
#line 2381 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp14_ = alteration_new ("metadata", "import-id");
#line 2381 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp15_ = _tmp14_;
#line 2381 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp15_);
#line 2381 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp15_);
#line 18652 "Photo.c"
	} else {
		gchar* _tmp16_ = NULL;
		gchar* _tmp17_ = NULL;
		GError* _tmp18_ = NULL;
		const gchar* _tmp19_ = NULL;
#line 2383 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 2383 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp17_ = _tmp16_;
#line 2383 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp18_ = dberr;
#line 2383 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp19_ = _tmp18_->message;
#line 2383 "/home/jens/Source/shotwell/src/Photo.vala"
		g_warning ("Photo.vala:2383: Unable to write import ID for %s: %s", _tmp17_, _tmp19_);
#line 2383 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp17_);
#line 18670 "Photo.c"
	}
#line 2369 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_error_free0 (dberr);
#line 18674 "Photo.c"
}


void photo_set_title_persistent (Photo* self, const gchar* title, GError** error) {
	PhotoFileReader* source = NULL;
	PhotoFileReader* _tmp0_ = NULL;
	PhotoFileReader* _tmp1_ = NULL;
	PhotoFileFormat _tmp2_ = 0;
	gboolean _tmp3_ = FALSE;
	PhotoMetadata* metadata = NULL;
	PhotoFileReader* _tmp8_ = NULL;
	PhotoMetadata* _tmp9_ = NULL;
	PhotoMetadata* _tmp10_ = NULL;
	const gchar* _tmp11_ = NULL;
	PhotoFileMetadataWriter* writer = NULL;
	PhotoFileReader* _tmp12_ = NULL;
	PhotoFileMetadataWriter* _tmp13_ = NULL;
	PhotoFileReader* _tmp14_ = NULL;
	GFile* _tmp15_ = NULL;
	GFile* _tmp16_ = NULL;
	const gchar* _tmp22_ = NULL;
	GError * _inner_error_ = NULL;
#line 2386 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 2387 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_source_reader (self);
#line 2387 "/home/jens/Source/shotwell/src/Photo.vala"
	source = _tmp0_;
#line 2390 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = source;
#line 2390 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_file_adapter_get_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 2390 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = photo_file_format_can_write_metadata (_tmp2_);
#line 2390 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp3_) {
#line 18711 "Photo.c"
		PhotoFileReader* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
#line 2391 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = source;
#line 2391 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = photo_file_adapter_get_filepath (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 2391 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = _tmp5_;
#line 2391 "/home/jens/Source/shotwell/src/Photo.vala"
		g_warning ("Photo.vala:2391: No photo file writer available for %s", _tmp6_);
#line 2391 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp6_);
#line 2393 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = title;
#line 2393 "/home/jens/Source/shotwell/src/Photo.vala"
		media_source_set_title (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), _tmp7_);
#line 2395 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (source);
#line 2395 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 18734 "Photo.c"
	}
#line 2398 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = source;
#line 2398 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = photo_file_reader_read_metadata (_tmp8_, &_inner_error_);
#line 2398 "/home/jens/Source/shotwell/src/Photo.vala"
	metadata = _tmp9_;
#line 2398 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2398 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 2398 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (source);
#line 2398 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 18750 "Photo.c"
	}
#line 2399 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = metadata;
#line 2399 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = title;
#line 2399 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_metadata_set_title (_tmp10_, _tmp11_, PHOTO_METADATA_SET_OPTION_ALL_DOMAINS);
#line 2401 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = source;
#line 2401 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = photo_file_reader_create_metadata_writer (_tmp12_, &_inner_error_);
#line 2401 "/home/jens/Source/shotwell/src/Photo.vala"
	writer = _tmp13_;
#line 2401 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2401 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 2401 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (metadata);
#line 2401 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (source);
#line 2401 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 18774 "Photo.c"
	}
#line 2402 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = source;
#line 2402 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 2402 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_ = _tmp15_;
#line 2402 "/home/jens/Source/shotwell/src/Photo.vala"
	library_monitor_blacklist_file (_tmp16_, "Photo.set_persistent_title");
#line 2402 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp16_);
#line 18786 "Photo.c"
	{
		PhotoFileMetadataWriter* _tmp17_ = NULL;
		PhotoMetadata* _tmp18_ = NULL;
#line 2404 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp17_ = writer;
#line 2404 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp18_ = metadata;
#line 2404 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_file_metadata_writer_write_metadata (_tmp17_, _tmp18_, &_inner_error_);
#line 2404 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 18798 "Photo.c"
			goto __finally357;
		}
	}
	__finally357:
	{
		PhotoFileReader* _tmp19_ = NULL;
		GFile* _tmp20_ = NULL;
		GFile* _tmp21_ = NULL;
#line 2406 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp19_ = source;
#line 2406 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 2406 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = _tmp20_;
#line 2406 "/home/jens/Source/shotwell/src/Photo.vala"
		library_monitor_unblacklist_file (_tmp21_);
#line 2406 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp21_);
#line 18817 "Photo.c"
	}
#line 2403 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2403 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 2403 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (writer);
#line 2403 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (metadata);
#line 2403 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (source);
#line 2403 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 18831 "Photo.c"
	}
#line 2409 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_ = title;
#line 2409 "/home/jens/Source/shotwell/src/Photo.vala"
	media_source_set_title (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), _tmp22_);
#line 2411 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_file_exif_updated (self);
#line 2386 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (writer);
#line 2386 "/home/jens/Source/shotwell/src/Photo.vala"
	_media_metadata_unref0 (metadata);
#line 2386 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (source);
#line 18845 "Photo.c"
}


void photo_set_comment_persistent (Photo* self, const gchar* comment, GError** error) {
	PhotoFileReader* source = NULL;
	PhotoFileReader* _tmp0_ = NULL;
	PhotoFileReader* _tmp1_ = NULL;
	PhotoFileFormat _tmp2_ = 0;
	gboolean _tmp3_ = FALSE;
	PhotoMetadata* metadata = NULL;
	PhotoFileReader* _tmp8_ = NULL;
	PhotoMetadata* _tmp9_ = NULL;
	PhotoMetadata* _tmp10_ = NULL;
	const gchar* _tmp11_ = NULL;
	PhotoFileMetadataWriter* writer = NULL;
	PhotoFileReader* _tmp12_ = NULL;
	PhotoFileMetadataWriter* _tmp13_ = NULL;
	PhotoFileReader* _tmp14_ = NULL;
	GFile* _tmp15_ = NULL;
	GFile* _tmp16_ = NULL;
	const gchar* _tmp22_ = NULL;
	GError * _inner_error_ = NULL;
#line 2414 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 2415 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_source_reader (self);
#line 2415 "/home/jens/Source/shotwell/src/Photo.vala"
	source = _tmp0_;
#line 2418 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = source;
#line 2418 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_file_adapter_get_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 2418 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = photo_file_format_can_write_metadata (_tmp2_);
#line 2418 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp3_) {
#line 18882 "Photo.c"
		PhotoFileReader* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
#line 2419 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = source;
#line 2419 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = photo_file_adapter_get_filepath (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 2419 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = _tmp5_;
#line 2419 "/home/jens/Source/shotwell/src/Photo.vala"
		g_warning ("Photo.vala:2419: No photo file writer available for %s", _tmp6_);
#line 2419 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp6_);
#line 2421 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = comment;
#line 2421 "/home/jens/Source/shotwell/src/Photo.vala"
		media_source_set_comment (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), _tmp7_);
#line 2423 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (source);
#line 2423 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 18905 "Photo.c"
	}
#line 2426 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = source;
#line 2426 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = photo_file_reader_read_metadata (_tmp8_, &_inner_error_);
#line 2426 "/home/jens/Source/shotwell/src/Photo.vala"
	metadata = _tmp9_;
#line 2426 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2426 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 2426 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (source);
#line 2426 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 18921 "Photo.c"
	}
#line 2427 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = metadata;
#line 2427 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = comment;
#line 2427 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_metadata_set_comment (_tmp10_, _tmp11_, PHOTO_METADATA_SET_OPTION_ALL_DOMAINS);
#line 2429 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = source;
#line 2429 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = photo_file_reader_create_metadata_writer (_tmp12_, &_inner_error_);
#line 2429 "/home/jens/Source/shotwell/src/Photo.vala"
	writer = _tmp13_;
#line 2429 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2429 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 2429 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (metadata);
#line 2429 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (source);
#line 2429 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 18945 "Photo.c"
	}
#line 2430 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = source;
#line 2430 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 2430 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_ = _tmp15_;
#line 2430 "/home/jens/Source/shotwell/src/Photo.vala"
	library_monitor_blacklist_file (_tmp16_, "Photo.set_persistent_comment");
#line 2430 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp16_);
#line 18957 "Photo.c"
	{
		PhotoFileMetadataWriter* _tmp17_ = NULL;
		PhotoMetadata* _tmp18_ = NULL;
#line 2432 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp17_ = writer;
#line 2432 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp18_ = metadata;
#line 2432 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_file_metadata_writer_write_metadata (_tmp17_, _tmp18_, &_inner_error_);
#line 2432 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 18969 "Photo.c"
			goto __finally358;
		}
	}
	__finally358:
	{
		PhotoFileReader* _tmp19_ = NULL;
		GFile* _tmp20_ = NULL;
		GFile* _tmp21_ = NULL;
#line 2434 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp19_ = source;
#line 2434 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 2434 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = _tmp20_;
#line 2434 "/home/jens/Source/shotwell/src/Photo.vala"
		library_monitor_unblacklist_file (_tmp21_);
#line 2434 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp21_);
#line 18988 "Photo.c"
	}
#line 2431 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2431 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 2431 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (writer);
#line 2431 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (metadata);
#line 2431 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (source);
#line 2431 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 19002 "Photo.c"
	}
#line 2437 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_ = comment;
#line 2437 "/home/jens/Source/shotwell/src/Photo.vala"
	media_source_set_comment (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), _tmp22_);
#line 2439 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_file_exif_updated (self);
#line 2414 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (writer);
#line 2414 "/home/jens/Source/shotwell/src/Photo.vala"
	_media_metadata_unref0 (metadata);
#line 2414 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (source);
#line 19016 "Photo.c"
}


static void photo_real_set_exposure_time (Dateable* base, time_t time) {
	Photo * self;
	gboolean committed = FALSE;
	gboolean _tmp12_ = FALSE;
	GError * _inner_error_ = NULL;
#line 2442 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 19027 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2444 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2444 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 19034 "Photo.c"
		{
			PhotoTable* _tmp1_ = NULL;
			PhotoTable* _tmp2_ = NULL;
			PhotoRow* _tmp3_ = NULL;
			PhotoID _tmp4_ = {0};
			time_t _tmp5_ = 0;
			gboolean _tmp6_ = FALSE;
			gboolean _tmp7_ = FALSE;
#line 2445 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = photo_table_get_instance ();
#line 2445 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_;
#line 2445 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = self->row;
#line 2445 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = _tmp3_->photo_id;
#line 2445 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = time;
#line 2445 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = photo_table_set_exposure_time (_tmp2_, &_tmp4_, _tmp5_);
#line 2445 "/home/jens/Source/shotwell/src/Photo.vala"
			committed = _tmp6_;
#line 2445 "/home/jens/Source/shotwell/src/Photo.vala"
			_database_table_unref0 (_tmp2_);
#line 2446 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = committed;
#line 2446 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp7_) {
#line 19063 "Photo.c"
				PhotoRow* _tmp8_ = NULL;
				time_t _tmp9_ = 0;
				time_t _tmp10_ = 0;
#line 2447 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = self->row;
#line 2447 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = time;
#line 2447 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_->exposure_time = _tmp9_;
#line 2448 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = time;
#line 2448 "/home/jens/Source/shotwell/src/Photo.vala"
				self->priv->cached_exposure_time = _tmp10_;
#line 19077 "Photo.c"
			}
		}
		__finally359:
		{
			PhotoRow* _tmp11_ = NULL;
#line 2444 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = self->row;
#line 2444 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 19087 "Photo.c"
		}
#line 2444 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2444 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2444 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2444 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 19097 "Photo.c"
		}
	}
#line 2452 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = committed;
#line 2452 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp12_) {
#line 19104 "Photo.c"
		Alteration* _tmp13_ = NULL;
		Alteration* _tmp14_ = NULL;
#line 2453 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp13_ = alteration_new ("metadata", "exposure-time");
#line 2453 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp14_ = _tmp13_;
#line 2453 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp14_);
#line 2453 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp14_);
#line 19115 "Photo.c"
	}
}


void photo_set_exposure_time_persistent (Photo* self, time_t time, GError** error) {
	PhotoFileReader* source = NULL;
	PhotoFileReader* _tmp0_ = NULL;
	PhotoFileReader* _tmp1_ = NULL;
	PhotoFileFormat _tmp2_ = 0;
	gboolean _tmp3_ = FALSE;
	PhotoMetadata* metadata = NULL;
	PhotoFileReader* _tmp8_ = NULL;
	PhotoMetadata* _tmp9_ = NULL;
	PhotoMetadata* _tmp10_ = NULL;
	time_t _tmp11_ = 0;
	MetadataDateTime* _tmp12_ = NULL;
	MetadataDateTime* _tmp13_ = NULL;
	PhotoFileMetadataWriter* writer = NULL;
	PhotoFileReader* _tmp14_ = NULL;
	PhotoFileMetadataWriter* _tmp15_ = NULL;
	PhotoFileReader* _tmp16_ = NULL;
	GFile* _tmp17_ = NULL;
	GFile* _tmp18_ = NULL;
	time_t _tmp24_ = 0;
	GError * _inner_error_ = NULL;
#line 2456 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 2457 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_source_reader (self);
#line 2457 "/home/jens/Source/shotwell/src/Photo.vala"
	source = _tmp0_;
#line 2460 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = source;
#line 2460 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_file_adapter_get_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 2460 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = photo_file_format_can_write_metadata (_tmp2_);
#line 2460 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp3_) {
#line 19155 "Photo.c"
		PhotoFileReader* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
		time_t _tmp7_ = 0;
#line 2461 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = source;
#line 2461 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = photo_file_adapter_get_filepath (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 2461 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = _tmp5_;
#line 2461 "/home/jens/Source/shotwell/src/Photo.vala"
		g_warning ("Photo.vala:2461: No photo file writer available for %s", _tmp6_);
#line 2461 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp6_);
#line 2463 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = time;
#line 2463 "/home/jens/Source/shotwell/src/Photo.vala"
		dateable_set_exposure_time (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATEABLE, Dateable), _tmp7_);
#line 2465 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (source);
#line 2465 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 19178 "Photo.c"
	}
#line 2468 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = source;
#line 2468 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = photo_file_reader_read_metadata (_tmp8_, &_inner_error_);
#line 2468 "/home/jens/Source/shotwell/src/Photo.vala"
	metadata = _tmp9_;
#line 2468 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2468 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 2468 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (source);
#line 2468 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 19194 "Photo.c"
	}
#line 2469 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = metadata;
#line 2469 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = time;
#line 2469 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = metadata_date_time_new (_tmp11_);
#line 2469 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = _tmp12_;
#line 2469 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_metadata_set_exposure_date_time (_tmp10_, _tmp13_, PHOTO_METADATA_SET_OPTION_ALL_DOMAINS);
#line 2469 "/home/jens/Source/shotwell/src/Photo.vala"
	_metadata_date_time_unref0 (_tmp13_);
#line 2471 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = source;
#line 2471 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = photo_file_reader_create_metadata_writer (_tmp14_, &_inner_error_);
#line 2471 "/home/jens/Source/shotwell/src/Photo.vala"
	writer = _tmp15_;
#line 2471 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2471 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 2471 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (metadata);
#line 2471 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (source);
#line 2471 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 19224 "Photo.c"
	}
#line 2472 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_ = source;
#line 2472 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 2472 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp18_ = _tmp17_;
#line 2472 "/home/jens/Source/shotwell/src/Photo.vala"
	library_monitor_blacklist_file (_tmp18_, "Photo.set_exposure_time_persistent");
#line 2472 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp18_);
#line 19236 "Photo.c"
	{
		PhotoFileMetadataWriter* _tmp19_ = NULL;
		PhotoMetadata* _tmp20_ = NULL;
#line 2474 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp19_ = writer;
#line 2474 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = metadata;
#line 2474 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_file_metadata_writer_write_metadata (_tmp19_, _tmp20_, &_inner_error_);
#line 2474 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 19248 "Photo.c"
			goto __finally360;
		}
	}
	__finally360:
	{
		PhotoFileReader* _tmp21_ = NULL;
		GFile* _tmp22_ = NULL;
		GFile* _tmp23_ = NULL;
#line 2476 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = source;
#line 2476 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp22_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 2476 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp23_ = _tmp22_;
#line 2476 "/home/jens/Source/shotwell/src/Photo.vala"
		library_monitor_unblacklist_file (_tmp23_);
#line 2476 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp23_);
#line 19267 "Photo.c"
	}
#line 2473 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2473 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 2473 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (writer);
#line 2473 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (metadata);
#line 2473 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (source);
#line 2473 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 19281 "Photo.c"
	}
#line 2479 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp24_ = time;
#line 2479 "/home/jens/Source/shotwell/src/Photo.vala"
	dateable_set_exposure_time (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATEABLE, Dateable), _tmp24_);
#line 2481 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_file_exif_updated (self);
#line 2456 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (writer);
#line 2456 "/home/jens/Source/shotwell/src/Photo.vala"
	_media_metadata_unref0 (metadata);
#line 2456 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (source);
#line 19295 "Photo.c"
}


/**
     * @brief Returns the width and height of the Photo after various
     * arbitrary stages of the pipeline have been applied in
     * the same order they're applied in get_pixbuf_with_options.
     * With no argument passed, it works exactly like the
     * previous incarnation did.
     *
     * @param disallowed_steps Which pipeline steps should NOT
     *      be taken into account when computing image dimensions
     *      (matching the convention set by get_pixbuf_with_options()).
     *      Pipeline steps that do not affect the image geometry are
     *      ignored.
     */
static void photo_real_get_dimensions (MediaSource* base, PhotoException disallowed_steps, Dimensions* result) {
	Photo * self;
	Dimensions returned_dims = {0};
	Dimensions _tmp0_ = {0};
	PhotoException _tmp1_ = 0;
	gboolean _tmp2_ = FALSE;
	PhotoException _tmp10_ = 0;
	gboolean _tmp11_ = FALSE;
	PhotoException _tmp22_ = 0;
	gboolean _tmp23_ = FALSE;
#line 2497 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 2499 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_get_raw_dimensions (self, &_tmp0_);
#line 2499 "/home/jens/Source/shotwell/src/Photo.vala"
	returned_dims = _tmp0_;
#line 2502 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = disallowed_steps;
#line 2502 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_exception_allows (_tmp1_, PHOTO_EXCEPTION_ORIENTATION);
#line 2502 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp2_) {
#line 19334 "Photo.c"
		Orientation ori_tmp = 0;
		Orientation _tmp3_ = 0;
		Orientation _tmp4_ = 0;
#line 2503 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = photo_get_orientation (self);
#line 2503 "/home/jens/Source/shotwell/src/Photo.vala"
		ori_tmp = _tmp3_;
#line 2506 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = ori_tmp;
#line 2506 "/home/jens/Source/shotwell/src/Photo.vala"
		switch (_tmp4_) {
#line 2506 "/home/jens/Source/shotwell/src/Photo.vala"
			case ORIENTATION_LEFT_TOP:
#line 2506 "/home/jens/Source/shotwell/src/Photo.vala"
			case ORIENTATION_RIGHT_TOP:
#line 2506 "/home/jens/Source/shotwell/src/Photo.vala"
			case ORIENTATION_LEFT_BOTTOM:
#line 2506 "/home/jens/Source/shotwell/src/Photo.vala"
			case ORIENTATION_RIGHT_BOTTOM:
#line 19354 "Photo.c"
			{
				gint width_tmp = 0;
				Dimensions _tmp5_ = {0};
				gint _tmp6_ = 0;
				Dimensions _tmp7_ = {0};
				gint _tmp8_ = 0;
				gint _tmp9_ = 0;
#line 2512 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = returned_dims;
#line 2512 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = _tmp5_.width;
#line 2512 "/home/jens/Source/shotwell/src/Photo.vala"
				width_tmp = _tmp6_;
#line 2514 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = returned_dims;
#line 2514 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = _tmp7_.height;
#line 2514 "/home/jens/Source/shotwell/src/Photo.vala"
				returned_dims.width = _tmp8_;
#line 2515 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = width_tmp;
#line 2515 "/home/jens/Source/shotwell/src/Photo.vala"
				returned_dims.height = _tmp9_;
#line 2516 "/home/jens/Source/shotwell/src/Photo.vala"
				break;
#line 19380 "Photo.c"
			}
			default:
			{
#line 2520 "/home/jens/Source/shotwell/src/Photo.vala"
				break;
#line 19386 "Photo.c"
			}
		}
	}
#line 2525 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = disallowed_steps;
#line 2525 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = photo_exception_allows (_tmp10_, PHOTO_EXCEPTION_STRAIGHTEN);
#line 2525 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp11_) {
#line 19396 "Photo.c"
		gdouble x_size = 0.0;
		gdouble y_size = 0.0;
		gdouble angle = 0.0;
		gdouble _tmp12_ = 0.0;
		Dimensions _tmp13_ = {0};
		gint _tmp14_ = 0;
		Dimensions _tmp15_ = {0};
		gint _tmp16_ = 0;
		gdouble _tmp17_ = 0.0;
		gdouble _tmp18_ = 0.0;
		gdouble _tmp19_ = 0.0;
		gdouble _tmp20_ = 0.0;
		gdouble _tmp21_ = 0.0;
#line 2527 "/home/jens/Source/shotwell/src/Photo.vala"
		angle = 0.0;
#line 2529 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_get_straighten (self, &_tmp12_);
#line 2529 "/home/jens/Source/shotwell/src/Photo.vala"
		angle = _tmp12_;
#line 2531 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp13_ = returned_dims;
#line 2531 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp14_ = _tmp13_.width;
#line 2531 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp15_ = returned_dims;
#line 2531 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = _tmp15_.height;
#line 2531 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp17_ = angle;
#line 2531 "/home/jens/Source/shotwell/src/Photo.vala"
		compute_arb_rotated_size ((gdouble) _tmp14_, (gdouble) _tmp16_, _tmp17_, &_tmp18_, &_tmp19_);
#line 2531 "/home/jens/Source/shotwell/src/Photo.vala"
		x_size = _tmp18_;
#line 2531 "/home/jens/Source/shotwell/src/Photo.vala"
		y_size = _tmp19_;
#line 2533 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = x_size;
#line 2533 "/home/jens/Source/shotwell/src/Photo.vala"
		returned_dims.width = (gint) _tmp20_;
#line 2534 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = y_size;
#line 2534 "/home/jens/Source/shotwell/src/Photo.vala"
		returned_dims.height = (gint) _tmp21_;
#line 19440 "Photo.c"
	}
#line 2538 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_ = disallowed_steps;
#line 2538 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp23_ = photo_exception_allows (_tmp22_, PHOTO_EXCEPTION_CROP);
#line 2538 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp23_) {
#line 19448 "Photo.c"
		Box crop = {0};
		PhotoException _tmp24_ = 0;
		Box _tmp25_ = {0};
		gboolean _tmp26_ = FALSE;
#line 2540 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp24_ = disallowed_steps;
#line 2540 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp26_ = photo_get_crop (self, &_tmp25_, _tmp24_);
#line 2540 "/home/jens/Source/shotwell/src/Photo.vala"
		crop = _tmp25_;
#line 2540 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp26_) {
#line 19461 "Photo.c"
			Dimensions _tmp27_ = {0};
#line 2541 "/home/jens/Source/shotwell/src/Photo.vala"
			box_get_dimensions (&crop, &_tmp27_);
#line 2541 "/home/jens/Source/shotwell/src/Photo.vala"
			returned_dims = _tmp27_;
#line 19467 "Photo.c"
		}
	}
#line 2544 "/home/jens/Source/shotwell/src/Photo.vala"
	*result = returned_dims;
#line 2544 "/home/jens/Source/shotwell/src/Photo.vala"
	return;
#line 19474 "Photo.c"
}


static void photo_locked_create_adjustments_from_data (Photo* self) {
	PixelTransformationBundle* _tmp0_ = NULL;
	KeyValueMap* map = NULL;
	KeyValueMap* _tmp1_ = NULL;
	KeyValueMap* _tmp2_ = NULL;
	PixelTransformationBundle* _tmp6_ = NULL;
	PixelTransformer* _tmp7_ = NULL;
#line 2548 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 2549 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = pixel_transformation_bundle_new ();
#line 2549 "/home/jens/Source/shotwell/src/Photo.vala"
	_pixel_transformation_bundle_unref0 (self->priv->adjustments);
#line 2549 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->adjustments = _tmp0_;
#line 2551 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = photo_get_transformation (self, "adjustments");
#line 2551 "/home/jens/Source/shotwell/src/Photo.vala"
	map = _tmp1_;
#line 2552 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = map;
#line 2552 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp2_ == NULL) {
#line 19501 "Photo.c"
		PixelTransformationBundle* _tmp3_ = NULL;
#line 2553 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = self->priv->adjustments;
#line 2553 "/home/jens/Source/shotwell/src/Photo.vala"
		pixel_transformation_bundle_set_to_identity (_tmp3_);
#line 19507 "Photo.c"
	} else {
		PixelTransformationBundle* _tmp4_ = NULL;
		KeyValueMap* _tmp5_ = NULL;
#line 2555 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = self->priv->adjustments;
#line 2555 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = map;
#line 2555 "/home/jens/Source/shotwell/src/Photo.vala"
		pixel_transformation_bundle_load (_tmp4_, _tmp5_);
#line 19517 "Photo.c"
	}
#line 2557 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = self->priv->adjustments;
#line 2557 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = pixel_transformation_bundle_generate_transformer (_tmp6_);
#line 2557 "/home/jens/Source/shotwell/src/Photo.vala"
	_pixel_transformer_unref0 (self->priv->transformer);
#line 2557 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->transformer = _tmp7_;
#line 2548 "/home/jens/Source/shotwell/src/Photo.vala"
	_key_value_map_unref0 (map);
#line 19529 "Photo.c"
}


PixelTransformationBundle* photo_get_color_adjustments (Photo* self) {
	PixelTransformationBundle* result = NULL;
	GError * _inner_error_ = NULL;
#line 2561 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 19538 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2562 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2562 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 19545 "Photo.c"
		{
			PixelTransformationBundle* _tmp1_ = NULL;
			PixelTransformationBundle* _tmp2_ = NULL;
			PixelTransformationBundle* _tmp3_ = NULL;
#line 2563 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->adjustments;
#line 2563 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp1_ == NULL) {
#line 2564 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_locked_create_adjustments_from_data (self);
#line 19556 "Photo.c"
			}
#line 2566 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = self->priv->adjustments;
#line 2566 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = pixel_transformation_bundle_copy (_tmp2_);
#line 2566 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp3_;
#line 19564 "Photo.c"
			{
				PhotoRow* _tmp4_ = NULL;
#line 2562 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = self->row;
#line 2562 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 19571 "Photo.c"
			}
#line 2566 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 19575 "Photo.c"
		}
		__finally361:
		{
			PhotoRow* _tmp5_ = NULL;
#line 2562 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->row;
#line 2562 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 19584 "Photo.c"
		}
#line 2562 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2562 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2562 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 19592 "Photo.c"
	}
}


PixelTransformer* photo_get_pixel_transformer (Photo* self) {
	PixelTransformer* result = NULL;
	GError * _inner_error_ = NULL;
#line 2570 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 19602 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2571 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2571 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 19609 "Photo.c"
		{
			PixelTransformer* _tmp1_ = NULL;
			PixelTransformer* _tmp2_ = NULL;
			PixelTransformer* _tmp3_ = NULL;
#line 2572 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->transformer;
#line 2572 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp1_ == NULL) {
#line 2573 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_locked_create_adjustments_from_data (self);
#line 19620 "Photo.c"
			}
#line 2575 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = self->priv->transformer;
#line 2575 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = pixel_transformer_copy (_tmp2_);
#line 2575 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp3_;
#line 19628 "Photo.c"
			{
				PhotoRow* _tmp4_ = NULL;
#line 2571 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = self->row;
#line 2571 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 19635 "Photo.c"
			}
#line 2575 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 19639 "Photo.c"
		}
		__finally362:
		{
			PhotoRow* _tmp5_ = NULL;
#line 2571 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->row;
#line 2571 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 19648 "Photo.c"
		}
#line 2571 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2571 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2571 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 19656 "Photo.c"
	}
}


gboolean photo_has_color_adjustments (Photo* self) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
#line 2579 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 2580 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_has_transformation (self, "adjustments");
#line 2580 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 2580 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 19672 "Photo.c"
}


PixelTransformation* photo_get_color_adjustment (Photo* self, PixelTransformationType type) {
	PixelTransformation* result = NULL;
	PixelTransformationBundle* _tmp0_ = NULL;
	PixelTransformationBundle* _tmp1_ = NULL;
	PixelTransformationType _tmp2_ = 0;
	PixelTransformation* _tmp3_ = NULL;
	PixelTransformation* _tmp4_ = NULL;
#line 2583 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 2584 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_color_adjustments (self);
#line 2584 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 2584 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = type;
#line 2584 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = pixel_transformation_bundle_get_transformation (_tmp1_, _tmp2_);
#line 2584 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = _tmp3_;
#line 2584 "/home/jens/Source/shotwell/src/Photo.vala"
	_pixel_transformation_bundle_unref0 (_tmp1_);
#line 2584 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp4_;
#line 2584 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 19701 "Photo.c"
}


void photo_set_color_adjustments (Photo* self, PixelTransformationBundle* new_adjustments) {
	PixelTransformationBundle* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	KeyValueMap* map = NULL;
	PixelTransformationBundle* _tmp8_ = NULL;
	KeyValueMap* _tmp9_ = NULL;
	gboolean committed = FALSE;
	gboolean _tmp39_ = FALSE;
	GError * _inner_error_ = NULL;
#line 2587 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 2587 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PIXEL_TRANSFORMATION_BUNDLE (new_adjustments));
#line 2590 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = new_adjustments;
#line 2590 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = pixel_transformation_bundle_is_identity (_tmp0_);
#line 2590 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_) {
#line 19724 "Photo.c"
		gboolean _result_ = FALSE;
		gboolean _tmp5_ = FALSE;
		{
			PhotoRow* _tmp2_ = NULL;
#line 2592 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = self->row;
#line 2592 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_lock (&self->priv->__lock_row);
#line 19733 "Photo.c"
			{
				gboolean _tmp3_ = FALSE;
#line 2593 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = photo_remove_transformation (self, "adjustments");
#line 2593 "/home/jens/Source/shotwell/src/Photo.vala"
				_result_ = _tmp3_;
#line 2594 "/home/jens/Source/shotwell/src/Photo.vala"
				_pixel_transformation_bundle_unref0 (self->priv->adjustments);
#line 2594 "/home/jens/Source/shotwell/src/Photo.vala"
				self->priv->adjustments = NULL;
#line 2595 "/home/jens/Source/shotwell/src/Photo.vala"
				_pixel_transformer_unref0 (self->priv->transformer);
#line 2595 "/home/jens/Source/shotwell/src/Photo.vala"
				self->priv->transformer = NULL;
#line 19748 "Photo.c"
			}
			__finally363:
			{
				PhotoRow* _tmp4_ = NULL;
#line 2592 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = self->row;
#line 2592 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 19757 "Photo.c"
			}
#line 2592 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2592 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2592 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 2592 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 19767 "Photo.c"
			}
		}
#line 2598 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = _result_;
#line 2598 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp5_) {
#line 19774 "Photo.c"
			Alteration* _tmp6_ = NULL;
			Alteration* _tmp7_ = NULL;
#line 2599 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = alteration_new ("image", "color-adjustments");
#line 2599 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = _tmp6_;
#line 2599 "/home/jens/Source/shotwell/src/Photo.vala"
			data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp7_);
#line 2599 "/home/jens/Source/shotwell/src/Photo.vala"
			_alteration_unref0 (_tmp7_);
#line 19785 "Photo.c"
		}
#line 2601 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 19789 "Photo.c"
	}
#line 2605 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = new_adjustments;
#line 2605 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = pixel_transformation_bundle_save (_tmp8_, "adjustments");
#line 2605 "/home/jens/Source/shotwell/src/Photo.vala"
	map = _tmp9_;
#line 19797 "Photo.c"
	{
		PhotoRow* _tmp10_ = NULL;
#line 2608 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp10_ = self->row;
#line 2608 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 19804 "Photo.c"
		{
			gboolean _tmp11_ = FALSE;
			PixelTransformer* _tmp12_ = NULL;
			KeyValueMap* _tmp36_ = NULL;
			gboolean _tmp37_ = FALSE;
#line 2609 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = self->priv->transformer;
#line 2609 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp12_ == NULL) {
#line 2609 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = TRUE;
#line 19816 "Photo.c"
			} else {
				PixelTransformationBundle* _tmp13_ = NULL;
#line 2609 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = self->priv->adjustments;
#line 2609 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = _tmp13_ == NULL;
#line 19823 "Photo.c"
			}
#line 2609 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp11_) {
#line 19827 "Photo.c"
				PixelTransformationBundle* _tmp14_ = NULL;
				PixelTransformationBundle* _tmp15_ = NULL;
				PixelTransformationBundle* _tmp16_ = NULL;
				PixelTransformer* _tmp17_ = NULL;
#line 2611 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = new_adjustments;
#line 2611 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = pixel_transformation_bundle_copy (_tmp14_);
#line 2611 "/home/jens/Source/shotwell/src/Photo.vala"
				_pixel_transformation_bundle_unref0 (self->priv->adjustments);
#line 2611 "/home/jens/Source/shotwell/src/Photo.vala"
				self->priv->adjustments = _tmp15_;
#line 2612 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = new_adjustments;
#line 2612 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp17_ = pixel_transformation_bundle_generate_transformer (_tmp16_);
#line 2612 "/home/jens/Source/shotwell/src/Photo.vala"
				_pixel_transformer_unref0 (self->priv->transformer);
#line 2612 "/home/jens/Source/shotwell/src/Photo.vala"
				self->priv->transformer = _tmp17_;
#line 19848 "Photo.c"
			} else {
				PixelTransformationBundle* _tmp34_ = NULL;
				PixelTransformationBundle* _tmp35_ = NULL;
				{
					GeeIterator* _transformation_it = NULL;
					PixelTransformationBundle* _tmp18_ = NULL;
					GeeIterable* _tmp19_ = NULL;
					GeeIterable* _tmp20_ = NULL;
					GeeIterator* _tmp21_ = NULL;
					GeeIterator* _tmp22_ = NULL;
#line 2615 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp18_ = new_adjustments;
#line 2615 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp19_ = pixel_transformation_bundle_get_transformations (_tmp18_);
#line 2615 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp20_ = _tmp19_;
#line 2615 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp21_ = gee_iterable_iterator (_tmp20_);
#line 2615 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp22_ = _tmp21_;
#line 2615 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_tmp20_);
#line 2615 "/home/jens/Source/shotwell/src/Photo.vala"
					_transformation_it = _tmp22_;
#line 2615 "/home/jens/Source/shotwell/src/Photo.vala"
					while (TRUE) {
#line 19875 "Photo.c"
						GeeIterator* _tmp23_ = NULL;
						gboolean _tmp24_ = FALSE;
						PixelTransformation* transformation = NULL;
						GeeIterator* _tmp25_ = NULL;
						gpointer _tmp26_ = NULL;
						PixelTransformer* _tmp27_ = NULL;
						PixelTransformationBundle* _tmp28_ = NULL;
						PixelTransformation* _tmp29_ = NULL;
						PixelTransformationType _tmp30_ = 0;
						PixelTransformation* _tmp31_ = NULL;
						PixelTransformation* _tmp32_ = NULL;
						PixelTransformation* _tmp33_ = NULL;
#line 2615 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp23_ = _transformation_it;
#line 2615 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp24_ = gee_iterator_next (_tmp23_);
#line 2615 "/home/jens/Source/shotwell/src/Photo.vala"
						if (!_tmp24_) {
#line 2615 "/home/jens/Source/shotwell/src/Photo.vala"
							break;
#line 19896 "Photo.c"
						}
#line 2615 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp25_ = _transformation_it;
#line 2615 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp26_ = gee_iterator_get (_tmp25_);
#line 2615 "/home/jens/Source/shotwell/src/Photo.vala"
						transformation = (PixelTransformation*) _tmp26_;
#line 2616 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp27_ = self->priv->transformer;
#line 2616 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp28_ = self->priv->adjustments;
#line 2616 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp29_ = transformation;
#line 2616 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp30_ = pixel_transformation_get_transformation_type (_tmp29_);
#line 2616 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp31_ = pixel_transformation_bundle_get_transformation (_tmp28_, _tmp30_);
#line 2616 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp32_ = _tmp31_;
#line 2616 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp33_ = transformation;
#line 2616 "/home/jens/Source/shotwell/src/Photo.vala"
						pixel_transformer_replace_transformation (_tmp27_, _tmp32_, _tmp33_);
#line 2616 "/home/jens/Source/shotwell/src/Photo.vala"
						_pixel_transformation_unref0 (_tmp32_);
#line 2615 "/home/jens/Source/shotwell/src/Photo.vala"
						_pixel_transformation_unref0 (transformation);
#line 19924 "Photo.c"
					}
#line 2615 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_transformation_it);
#line 19928 "Photo.c"
				}
#line 2621 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp34_ = new_adjustments;
#line 2621 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp35_ = pixel_transformation_bundle_copy (_tmp34_);
#line 2621 "/home/jens/Source/shotwell/src/Photo.vala"
				_pixel_transformation_bundle_unref0 (self->priv->adjustments);
#line 2621 "/home/jens/Source/shotwell/src/Photo.vala"
				self->priv->adjustments = _tmp35_;
#line 19938 "Photo.c"
			}
#line 2624 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp36_ = map;
#line 2624 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp37_ = photo_set_transformation (self, _tmp36_);
#line 2624 "/home/jens/Source/shotwell/src/Photo.vala"
			committed = _tmp37_;
#line 19946 "Photo.c"
		}
		__finally364:
		{
			PhotoRow* _tmp38_ = NULL;
#line 2608 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp38_ = self->row;
#line 2608 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 19955 "Photo.c"
		}
#line 2608 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2608 "/home/jens/Source/shotwell/src/Photo.vala"
			_key_value_map_unref0 (map);
#line 2608 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2608 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2608 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 19967 "Photo.c"
		}
	}
#line 2627 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp39_ = committed;
#line 2627 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp39_) {
#line 19974 "Photo.c"
		Alteration* _tmp40_ = NULL;
		Alteration* _tmp41_ = NULL;
#line 2628 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp40_ = alteration_new ("image", "color-adjustments");
#line 2628 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp41_ = _tmp40_;
#line 2628 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp41_);
#line 2628 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp41_);
#line 19985 "Photo.c"
	}
#line 2587 "/home/jens/Source/shotwell/src/Photo.vala"
	_key_value_map_unref0 (map);
#line 19989 "Photo.c"
}


static PhotoMetadata* photo_real_get_metadata (PhotoSource* base) {
	Photo * self;
	PhotoMetadata* result = NULL;
	GError * _inner_error_ = NULL;
#line 2632 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 19999 "Photo.c"
	{
		PhotoMetadata* _tmp0_ = NULL;
		PhotoFileReader* _tmp1_ = NULL;
		PhotoFileReader* _tmp2_ = NULL;
		PhotoMetadata* _tmp3_ = NULL;
		PhotoMetadata* _tmp4_ = NULL;
		PhotoMetadata* _tmp5_ = NULL;
#line 2634 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = photo_get_source_reader (self);
#line 2634 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = _tmp1_;
#line 2634 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = photo_file_reader_read_metadata (_tmp2_, &_inner_error_);
#line 2634 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = _tmp3_;
#line 2634 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (_tmp2_);
#line 2634 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = _tmp4_;
#line 2634 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 20021 "Photo.c"
			goto __catch365_g_error;
		}
#line 2634 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = _tmp0_;
#line 2634 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = NULL;
#line 2634 "/home/jens/Source/shotwell/src/Photo.vala"
		result = _tmp5_;
#line 2634 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (_tmp0_);
#line 2634 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 20034 "Photo.c"
	}
	goto __finally365;
	__catch365_g_error:
	{
		GError* err = NULL;
		GError* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
#line 2633 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 2633 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 2636 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = err;
#line 2636 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = _tmp6_->message;
#line 2636 "/home/jens/Source/shotwell/src/Photo.vala"
		g_warning ("Photo.vala:2636: Unable to load metadata: %s", _tmp7_);
#line 2638 "/home/jens/Source/shotwell/src/Photo.vala"
		result = NULL;
#line 2638 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 2638 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 20058 "Photo.c"
	}
	__finally365:
#line 2633 "/home/jens/Source/shotwell/src/Photo.vala"
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2633 "/home/jens/Source/shotwell/src/Photo.vala"
	g_clear_error (&_inner_error_);
#line 2633 "/home/jens/Source/shotwell/src/Photo.vala"
	return NULL;
#line 20067 "Photo.c"
}


PhotoMetadata* photo_get_master_metadata (Photo* self, GError** error) {
	PhotoMetadata* result = NULL;
	PhotoMetadata* _tmp0_ = NULL;
	PhotoFileReader* _tmp1_ = NULL;
	PhotoFileReader* _tmp2_ = NULL;
	PhotoMetadata* _tmp3_ = NULL;
	PhotoMetadata* _tmp4_ = NULL;
	PhotoMetadata* _tmp5_ = NULL;
	GError * _inner_error_ = NULL;
#line 2642 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 2643 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = photo_get_master_reader (self);
#line 2643 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = _tmp1_;
#line 2643 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = photo_file_reader_read_metadata (_tmp2_, &_inner_error_);
#line 2643 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = _tmp3_;
#line 2643 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (_tmp2_);
#line 2643 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = _tmp4_;
#line 2643 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2643 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 2643 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 20100 "Photo.c"
	}
#line 2643 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = _tmp0_;
#line 2643 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = NULL;
#line 2643 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp5_;
#line 2643 "/home/jens/Source/shotwell/src/Photo.vala"
	_media_metadata_unref0 (_tmp0_);
#line 2643 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 20112 "Photo.c"
}


PhotoMetadata* photo_get_editable_metadata (Photo* self, GError** error) {
	PhotoMetadata* result = NULL;
	PhotoFileReader* reader = NULL;
	PhotoFileReader* _tmp0_ = NULL;
	PhotoMetadata* _tmp1_ = NULL;
	PhotoFileReader* _tmp2_ = NULL;
	GError * _inner_error_ = NULL;
#line 2646 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 2647 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_editable_reader (self);
#line 2647 "/home/jens/Source/shotwell/src/Photo.vala"
	reader = _tmp0_;
#line 2649 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = reader;
#line 2649 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp2_ != NULL) {
#line 20133 "Photo.c"
		PhotoFileReader* _tmp3_ = NULL;
		PhotoMetadata* _tmp4_ = NULL;
#line 2649 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = reader;
#line 2649 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = photo_file_reader_read_metadata (_tmp3_, &_inner_error_);
#line 2649 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (_tmp1_);
#line 2649 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = _tmp4_;
#line 2649 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2649 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 2649 "/home/jens/Source/shotwell/src/Photo.vala"
			_media_metadata_unref0 (_tmp1_);
#line 2649 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_adapter_unref0 (reader);
#line 2649 "/home/jens/Source/shotwell/src/Photo.vala"
			return NULL;
#line 20154 "Photo.c"
		}
	} else {
#line 2649 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (_tmp1_);
#line 2649 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = NULL;
#line 20161 "Photo.c"
	}
#line 2649 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp1_;
#line 2649 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (reader);
#line 2649 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 20169 "Photo.c"
}


gboolean photo_persist_master_metadata (Photo* self, PhotoMetadata* metadata, PhotoReimportMasterState** state, GError** error) {
	PhotoReimportMasterState* _vala_state = NULL;
	gboolean result = FALSE;
	PhotoFileReader* master_reader = NULL;
	PhotoFileReader* _tmp0_ = NULL;
	PhotoFileReader* _tmp1_ = NULL;
	PhotoFileFormat _tmp2_ = 0;
	gboolean _tmp3_ = FALSE;
	PhotoFileMetadataWriter* _tmp4_ = NULL;
	PhotoFileReader* _tmp5_ = NULL;
	PhotoFileMetadataWriter* _tmp6_ = NULL;
	PhotoFileMetadataWriter* _tmp8_ = NULL;
	PhotoFileMetadataWriter* _tmp9_ = NULL;
	PhotoMetadata* _tmp10_ = NULL;
	gboolean _tmp12_ = FALSE;
	PhotoReimportMasterState* _tmp13_ = NULL;
	gboolean _tmp14_ = FALSE;
	PhotoReimportMasterState* _tmp16_ = NULL;
	GError * _inner_error_ = NULL;
#line 2655 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 2655 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO_METADATA (metadata), FALSE);
#line 2657 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_reimport_master_state_unref0 (_vala_state);
#line 2657 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_state = NULL;
#line 2659 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_master_reader (self);
#line 2659 "/home/jens/Source/shotwell/src/Photo.vala"
	master_reader = _tmp0_;
#line 2661 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = master_reader;
#line 2661 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_file_adapter_get_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 2661 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = photo_file_format_can_write_metadata (_tmp2_);
#line 2661 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp3_) {
#line 2662 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 2662 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (master_reader);
#line 2662 "/home/jens/Source/shotwell/src/Photo.vala"
		if (state) {
#line 2662 "/home/jens/Source/shotwell/src/Photo.vala"
			*state = _vala_state;
#line 20220 "Photo.c"
		} else {
#line 2662 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_reimport_master_state_unref0 (_vala_state);
#line 20224 "Photo.c"
		}
#line 2662 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 20228 "Photo.c"
	}
#line 2664 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = master_reader;
#line 2664 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = photo_file_reader_create_metadata_writer (_tmp5_, &_inner_error_);
#line 2664 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = _tmp6_;
#line 2664 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 20238 "Photo.c"
		gboolean _tmp7_ = FALSE;
#line 2664 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 2664 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (master_reader);
#line 2664 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp7_;
#line 20246 "Photo.c"
	}
#line 2664 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = _tmp4_;
#line 2664 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = NULL;
#line 2664 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = _tmp8_;
#line 2664 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = metadata;
#line 2664 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_file_metadata_writer_write_metadata (_tmp9_, _tmp10_, &_inner_error_);
#line 2664 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (_tmp9_);
#line 2664 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 20262 "Photo.c"
		gboolean _tmp11_ = FALSE;
#line 2664 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 2664 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (_tmp4_);
#line 2664 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (master_reader);
#line 2664 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp11_;
#line 20272 "Photo.c"
	}
#line 2666 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = photo_prepare_for_reimport_master (self, &_tmp13_, &_inner_error_);
#line 2666 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_reimport_master_state_unref0 (_vala_state);
#line 2666 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_state = _tmp13_;
#line 2666 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = _tmp14_;
#line 2666 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 20284 "Photo.c"
		gboolean _tmp15_ = FALSE;
#line 2666 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 2666 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (_tmp4_);
#line 2666 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (master_reader);
#line 2666 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp15_;
#line 20294 "Photo.c"
	}
#line 2666 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp12_) {
#line 2667 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 2667 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (_tmp4_);
#line 2667 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (master_reader);
#line 2667 "/home/jens/Source/shotwell/src/Photo.vala"
		if (state) {
#line 2667 "/home/jens/Source/shotwell/src/Photo.vala"
			*state = _vala_state;
#line 20308 "Photo.c"
		} else {
#line 2667 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_reimport_master_state_unref0 (_vala_state);
#line 20312 "Photo.c"
		}
#line 2667 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 20316 "Photo.c"
	}
#line 2669 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_ = _vala_state;
#line 2669 "/home/jens/Source/shotwell/src/Photo.vala"
	G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, PHOTO_TYPE_REIMPORT_MASTER_STATE_IMPL, PhotoReimportMasterStateImpl)->metadata_only = TRUE;
#line 2671 "/home/jens/Source/shotwell/src/Photo.vala"
	result = TRUE;
#line 2671 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (_tmp4_);
#line 2671 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (master_reader);
#line 2671 "/home/jens/Source/shotwell/src/Photo.vala"
	if (state) {
#line 2671 "/home/jens/Source/shotwell/src/Photo.vala"
		*state = _vala_state;
#line 20332 "Photo.c"
	} else {
#line 2671 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_reimport_master_state_unref0 (_vala_state);
#line 20336 "Photo.c"
	}
#line 2671 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 20340 "Photo.c"
}


void photo_finish_update_master_metadata (Photo* self, PhotoReimportMasterState* state, GError** error) {
	PhotoReimportMasterState* _tmp0_ = NULL;
	GError * _inner_error_ = NULL;
#line 2674 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 2674 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (PHOTO_IS_REIMPORT_MASTER_STATE (state));
#line 2675 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = state;
#line 2675 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_finish_reimport_master (self, _tmp0_, &_inner_error_);
#line 2675 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2675 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_inner_error_->domain == DATABASE_ERROR) {
#line 2675 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 2675 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 20363 "Photo.c"
		} else {
#line 2675 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2675 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2675 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 20371 "Photo.c"
		}
	}
}


gboolean photo_persist_editable_metadata (Photo* self, PhotoMetadata* metadata, PhotoReimportEditableState** state, GError** error) {
	PhotoReimportEditableState* _vala_state = NULL;
	gboolean result = FALSE;
	PhotoFileReader* editable_reader = NULL;
	PhotoFileReader* _tmp0_ = NULL;
	PhotoFileReader* _tmp1_ = NULL;
	PhotoFileReader* _tmp2_ = NULL;
	PhotoFileFormat _tmp3_ = 0;
	gboolean _tmp4_ = FALSE;
	PhotoFileMetadataWriter* _tmp5_ = NULL;
	PhotoFileReader* _tmp6_ = NULL;
	PhotoFileMetadataWriter* _tmp7_ = NULL;
	PhotoFileMetadataWriter* _tmp9_ = NULL;
	PhotoFileMetadataWriter* _tmp10_ = NULL;
	PhotoMetadata* _tmp11_ = NULL;
	gboolean _tmp13_ = FALSE;
	PhotoReimportEditableState* _tmp14_ = NULL;
	gboolean _tmp15_ = FALSE;
	PhotoReimportEditableState* _tmp17_ = NULL;
	GError * _inner_error_ = NULL;
#line 2678 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 2678 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO_METADATA (metadata), FALSE);
#line 2680 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_reimport_editable_state_unref0 (_vala_state);
#line 2680 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_state = NULL;
#line 2682 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_editable_reader (self);
#line 2682 "/home/jens/Source/shotwell/src/Photo.vala"
	editable_reader = _tmp0_;
#line 2683 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = editable_reader;
#line 2683 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_ == NULL) {
#line 2684 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 2684 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (editable_reader);
#line 2684 "/home/jens/Source/shotwell/src/Photo.vala"
		if (state) {
#line 2684 "/home/jens/Source/shotwell/src/Photo.vala"
			*state = _vala_state;
#line 20421 "Photo.c"
		} else {
#line 2684 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_reimport_editable_state_unref0 (_vala_state);
#line 20425 "Photo.c"
		}
#line 2684 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 20429 "Photo.c"
	}
#line 2686 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = editable_reader;
#line 2686 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = photo_file_adapter_get_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 2686 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = photo_file_format_can_write_metadata (_tmp3_);
#line 2686 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp4_) {
#line 2687 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 2687 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (editable_reader);
#line 2687 "/home/jens/Source/shotwell/src/Photo.vala"
		if (state) {
#line 2687 "/home/jens/Source/shotwell/src/Photo.vala"
			*state = _vala_state;
#line 20447 "Photo.c"
		} else {
#line 2687 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_reimport_editable_state_unref0 (_vala_state);
#line 20451 "Photo.c"
		}
#line 2687 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 20455 "Photo.c"
	}
#line 2689 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = editable_reader;
#line 2689 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = photo_file_reader_create_metadata_writer (_tmp6_, &_inner_error_);
#line 2689 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = _tmp7_;
#line 2689 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 20465 "Photo.c"
		gboolean _tmp8_ = FALSE;
#line 2689 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 2689 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (editable_reader);
#line 2689 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp8_;
#line 20473 "Photo.c"
	}
#line 2689 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = _tmp5_;
#line 2689 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = NULL;
#line 2689 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = _tmp9_;
#line 2689 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = metadata;
#line 2689 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_file_metadata_writer_write_metadata (_tmp10_, _tmp11_, &_inner_error_);
#line 2689 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (_tmp10_);
#line 2689 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 20489 "Photo.c"
		gboolean _tmp12_ = FALSE;
#line 2689 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 2689 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (_tmp5_);
#line 2689 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (editable_reader);
#line 2689 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp12_;
#line 20499 "Photo.c"
	}
#line 2691 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = photo_prepare_for_reimport_editable (self, &_tmp14_, &_inner_error_);
#line 2691 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_reimport_editable_state_unref0 (_vala_state);
#line 2691 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_state = _tmp14_;
#line 2691 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = _tmp15_;
#line 2691 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 20511 "Photo.c"
		gboolean _tmp16_ = FALSE;
#line 2691 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 2691 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (_tmp5_);
#line 2691 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (editable_reader);
#line 2691 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp16_;
#line 20521 "Photo.c"
	}
#line 2691 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp13_) {
#line 2692 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 2692 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (_tmp5_);
#line 2692 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (editable_reader);
#line 2692 "/home/jens/Source/shotwell/src/Photo.vala"
		if (state) {
#line 2692 "/home/jens/Source/shotwell/src/Photo.vala"
			*state = _vala_state;
#line 20535 "Photo.c"
		} else {
#line 2692 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_reimport_editable_state_unref0 (_vala_state);
#line 20539 "Photo.c"
		}
#line 2692 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 20543 "Photo.c"
	}
#line 2694 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = _vala_state;
#line 2694 "/home/jens/Source/shotwell/src/Photo.vala"
	G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, PHOTO_TYPE_REIMPORT_EDITABLE_STATE_IMPL, PhotoReimportEditableStateImpl)->metadata_only = TRUE;
#line 2696 "/home/jens/Source/shotwell/src/Photo.vala"
	result = TRUE;
#line 2696 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (_tmp5_);
#line 2696 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (editable_reader);
#line 2696 "/home/jens/Source/shotwell/src/Photo.vala"
	if (state) {
#line 2696 "/home/jens/Source/shotwell/src/Photo.vala"
		*state = _vala_state;
#line 20559 "Photo.c"
	} else {
#line 2696 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_reimport_editable_state_unref0 (_vala_state);
#line 20563 "Photo.c"
	}
#line 2696 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 20567 "Photo.c"
}


void photo_finish_update_editable_metadata (Photo* self, PhotoReimportEditableState* state, GError** error) {
	PhotoReimportEditableState* _tmp0_ = NULL;
	GError * _inner_error_ = NULL;
#line 2699 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 2699 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (PHOTO_IS_REIMPORT_EDITABLE_STATE (state));
#line 2700 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = state;
#line 2700 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_finish_reimport_editable (self, _tmp0_, &_inner_error_);
#line 2700 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2700 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_inner_error_->domain == DATABASE_ERROR) {
#line 2700 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 2700 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 20590 "Photo.c"
		} else {
#line 2700 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2700 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2700 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 20598 "Photo.c"
		}
	}
}


void photo_get_raw_dimensions (Photo* self, Dimensions* result) {
	GError * _inner_error_ = NULL;
#line 2705 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 20608 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2706 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2706 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 20615 "Photo.c"
		{
			BackingPhotoRow* _tmp1_ = NULL;
			Dimensions _tmp2_ = {0};
#line 2707 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->backing_photo_row;
#line 2707 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->dim;
#line 2707 "/home/jens/Source/shotwell/src/Photo.vala"
			*result = _tmp2_;
#line 20625 "Photo.c"
			{
				PhotoRow* _tmp3_ = NULL;
#line 2706 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 2706 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 20632 "Photo.c"
			}
#line 2707 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 20636 "Photo.c"
		}
		__finally366:
		{
			PhotoRow* _tmp4_ = NULL;
#line 2706 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 2706 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 20645 "Photo.c"
		}
#line 2706 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2706 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2706 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 20653 "Photo.c"
	}
}


gboolean photo_has_transformations (Photo* self) {
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
#line 2711 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 20663 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
		gboolean _tmp10_ = FALSE;
#line 2712 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2712 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 20671 "Photo.c"
		{
			gboolean _tmp1_ = FALSE;
			PhotoRow* _tmp2_ = NULL;
			Orientation _tmp3_ = 0;
			BackingPhotoRow* _tmp4_ = NULL;
			Orientation _tmp5_ = 0;
#line 2713 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = self->row;
#line 2713 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = _tmp2_->orientation;
#line 2713 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->backing_photo_row;
#line 2713 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = _tmp4_->original_orientation;
#line 2713 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp3_ != _tmp5_) {
#line 2714 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = TRUE;
#line 20690 "Photo.c"
			} else {
				PhotoRow* _tmp6_ = NULL;
				GeeHashMap* _tmp7_ = NULL;
#line 2715 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = self->row;
#line 2715 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = _tmp6_->transformations;
#line 2715 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = _tmp7_ != NULL;
#line 20700 "Photo.c"
			}
#line 2713 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp1_;
#line 20704 "Photo.c"
			{
				PhotoRow* _tmp8_ = NULL;
#line 2712 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = self->row;
#line 2712 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 20711 "Photo.c"
			}
#line 2713 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 20715 "Photo.c"
		}
		__finally367:
		{
			PhotoRow* _tmp9_ = NULL;
#line 2712 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = self->row;
#line 2712 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 20724 "Photo.c"
		}
#line 2712 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2712 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2712 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp10_;
#line 20732 "Photo.c"
	}
}


gboolean photo_only_metadata_changed (Photo* self) {
	gboolean result = FALSE;
	MetadataDateTime* date_time = NULL;
	PhotoMetadata* metadata = NULL;
	PhotoMetadata* _tmp0_ = NULL;
	PhotoMetadata* _tmp1_ = NULL;
	GError * _inner_error_ = NULL;
#line 2719 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 2720 "/home/jens/Source/shotwell/src/Photo.vala"
	date_time = NULL;
#line 2722 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_source_get_metadata (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_SOURCE, PhotoSource));
#line 2722 "/home/jens/Source/shotwell/src/Photo.vala"
	metadata = _tmp0_;
#line 2723 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = metadata;
#line 2723 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_ != NULL) {
#line 20756 "Photo.c"
		PhotoMetadata* _tmp2_ = NULL;
		MetadataDateTime* _tmp3_ = NULL;
#line 2724 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = metadata;
#line 2724 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = photo_metadata_get_exposure_date_time (_tmp2_);
#line 2724 "/home/jens/Source/shotwell/src/Photo.vala"
		_metadata_date_time_unref0 (date_time);
#line 2724 "/home/jens/Source/shotwell/src/Photo.vala"
		date_time = _tmp3_;
#line 20767 "Photo.c"
	}
	{
		PhotoRow* _tmp4_ = NULL;
		gboolean _tmp21_ = FALSE;
#line 2726 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = self->row;
#line 2726 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 20776 "Photo.c"
		{
			gboolean _tmp5_ = FALSE;
			PhotoRow* _tmp6_ = NULL;
			GeeHashMap* _tmp7_ = NULL;
#line 2727 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = self->row;
#line 2727 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = _tmp6_->transformations;
#line 2727 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp7_ == NULL) {
#line 20787 "Photo.c"
				gboolean _tmp8_ = FALSE;
				PhotoRow* _tmp9_ = NULL;
				Orientation _tmp10_ = 0;
				BackingPhotoRow* _tmp11_ = NULL;
				Orientation _tmp12_ = 0;
#line 2728 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = self->row;
#line 2728 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = _tmp9_->orientation;
#line 2728 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = self->backing_photo_row;
#line 2728 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = _tmp11_->original_orientation;
#line 2728 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp10_ != _tmp12_) {
#line 2728 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp8_ = TRUE;
#line 20805 "Photo.c"
				} else {
					gboolean _tmp13_ = FALSE;
					MetadataDateTime* _tmp14_ = NULL;
#line 2729 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp14_ = date_time;
#line 2729 "/home/jens/Source/shotwell/src/Photo.vala"
					if (_tmp14_ != NULL) {
#line 20813 "Photo.c"
						PhotoRow* _tmp15_ = NULL;
						time_t _tmp16_ = 0;
						MetadataDateTime* _tmp17_ = NULL;
						time_t _tmp18_ = 0;
#line 2729 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp15_ = self->row;
#line 2729 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp16_ = _tmp15_->exposure_time;
#line 2729 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp17_ = date_time;
#line 2729 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp18_ = metadata_date_time_get_timestamp (_tmp17_);
#line 2729 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp13_ = _tmp16_ != _tmp18_;
#line 20828 "Photo.c"
					} else {
#line 2729 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp13_ = FALSE;
#line 20832 "Photo.c"
					}
#line 2729 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp8_ = _tmp13_;
#line 20836 "Photo.c"
				}
#line 2728 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = _tmp8_;
#line 20840 "Photo.c"
			} else {
#line 2727 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = FALSE;
#line 20844 "Photo.c"
			}
#line 2727 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp5_;
#line 20848 "Photo.c"
			{
				PhotoRow* _tmp19_ = NULL;
#line 2726 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp19_ = self->row;
#line 2726 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 20855 "Photo.c"
			}
#line 2727 "/home/jens/Source/shotwell/src/Photo.vala"
			_media_metadata_unref0 (metadata);
#line 2727 "/home/jens/Source/shotwell/src/Photo.vala"
			_metadata_date_time_unref0 (date_time);
#line 2727 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 20863 "Photo.c"
		}
		__finally368:
		{
			PhotoRow* _tmp20_ = NULL;
#line 2726 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp20_ = self->row;
#line 2726 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 20872 "Photo.c"
		}
#line 2726 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (metadata);
#line 2726 "/home/jens/Source/shotwell/src/Photo.vala"
		_metadata_date_time_unref0 (date_time);
#line 2726 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2726 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2726 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp21_;
#line 20884 "Photo.c"
	}
#line 2719 "/home/jens/Source/shotwell/src/Photo.vala"
	_media_metadata_unref0 (metadata);
#line 2719 "/home/jens/Source/shotwell/src/Photo.vala"
	_metadata_date_time_unref0 (date_time);
#line 20890 "Photo.c"
}


gboolean photo_has_alterations (Photo* self) {
	gboolean result = FALSE;
	MetadataDateTime* date_time = NULL;
	gchar* title = NULL;
	gchar* comment = NULL;
	PhotoMetadata* metadata = NULL;
	PhotoMetadata* _tmp0_ = NULL;
	PhotoMetadata* _tmp1_ = NULL;
	MetadataDateTime* _tmp8_ = NULL;
	GError * _inner_error_ = NULL;
#line 2733 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 2734 "/home/jens/Source/shotwell/src/Photo.vala"
	date_time = NULL;
#line 2735 "/home/jens/Source/shotwell/src/Photo.vala"
	title = NULL;
#line 2736 "/home/jens/Source/shotwell/src/Photo.vala"
	comment = NULL;
#line 2738 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_source_get_metadata (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_SOURCE, PhotoSource));
#line 2738 "/home/jens/Source/shotwell/src/Photo.vala"
	metadata = _tmp0_;
#line 2739 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = metadata;
#line 2739 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_ != NULL) {
#line 20920 "Photo.c"
		PhotoMetadata* _tmp2_ = NULL;
		MetadataDateTime* _tmp3_ = NULL;
		PhotoMetadata* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		PhotoMetadata* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
#line 2740 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = metadata;
#line 2740 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = photo_metadata_get_exposure_date_time (_tmp2_);
#line 2740 "/home/jens/Source/shotwell/src/Photo.vala"
		_metadata_date_time_unref0 (date_time);
#line 2740 "/home/jens/Source/shotwell/src/Photo.vala"
		date_time = _tmp3_;
#line 2741 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = metadata;
#line 2741 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = media_metadata_get_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_MEDIA_METADATA, MediaMetadata));
#line 2741 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (title);
#line 2741 "/home/jens/Source/shotwell/src/Photo.vala"
		title = _tmp5_;
#line 2742 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = metadata;
#line 2742 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = media_metadata_get_comment (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_MEDIA_METADATA, MediaMetadata));
#line 2742 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (comment);
#line 2742 "/home/jens/Source/shotwell/src/Photo.vala"
		comment = _tmp7_;
#line 20951 "Photo.c"
	}
#line 2746 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = date_time;
#line 2746 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp8_ == NULL) {
#line 20957 "Photo.c"
		{
			PhotoRow* _tmp9_ = NULL;
#line 2748 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = self->row;
#line 2748 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_lock (&self->priv->__lock_row);
#line 20964 "Photo.c"
			{
				BackingPhotoRow* _tmp10_ = NULL;
				time_t _tmp11_ = 0;
				PhotoRow* _tmp12_ = NULL;
				time_t _tmp13_ = 0;
#line 2750 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = self->backing_photo_row;
#line 2750 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = _tmp10_->timestamp;
#line 2750 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = self->row;
#line 2750 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = _tmp12_->exposure_time;
#line 2750 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp11_ != _tmp13_) {
#line 2752 "/home/jens/Source/shotwell/src/Photo.vala"
					result = TRUE;
#line 20982 "Photo.c"
					{
						PhotoRow* _tmp14_ = NULL;
#line 2748 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp14_ = self->row;
#line 2748 "/home/jens/Source/shotwell/src/Photo.vala"
						g_rec_mutex_unlock (&self->priv->__lock_row);
#line 20989 "Photo.c"
					}
#line 2752 "/home/jens/Source/shotwell/src/Photo.vala"
					_media_metadata_unref0 (metadata);
#line 2752 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_free0 (comment);
#line 2752 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_free0 (title);
#line 2752 "/home/jens/Source/shotwell/src/Photo.vala"
					_metadata_date_time_unref0 (date_time);
#line 2752 "/home/jens/Source/shotwell/src/Photo.vala"
					return result;
#line 21001 "Photo.c"
				}
			}
			__finally369:
			{
				PhotoRow* _tmp15_ = NULL;
#line 2748 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = self->row;
#line 2748 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 21011 "Photo.c"
			}
#line 2748 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 21015 "Photo.c"
				gboolean _tmp16_ = FALSE;
#line 2748 "/home/jens/Source/shotwell/src/Photo.vala"
				_media_metadata_unref0 (metadata);
#line 2748 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (comment);
#line 2748 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (title);
#line 2748 "/home/jens/Source/shotwell/src/Photo.vala"
				_metadata_date_time_unref0 (date_time);
#line 2748 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2748 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 2748 "/home/jens/Source/shotwell/src/Photo.vala"
				return _tmp16_;
#line 21031 "Photo.c"
			}
		}
	}
	{
		PhotoRow* _tmp17_ = NULL;
		gboolean _tmp42_ = FALSE;
#line 2757 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp17_ = self->row;
#line 2757 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 21042 "Photo.c"
		{
			gboolean _tmp18_ = FALSE;
			gboolean _tmp19_ = FALSE;
			gboolean _tmp20_ = FALSE;
			gboolean _tmp21_ = FALSE;
			PhotoRow* _tmp22_ = NULL;
			GeeHashMap* _tmp23_ = NULL;
#line 2758 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp22_ = self->row;
#line 2758 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp23_ = _tmp22_->transformations;
#line 2758 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp23_ != NULL) {
#line 2758 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp21_ = TRUE;
#line 21058 "Photo.c"
			} else {
				PhotoRow* _tmp24_ = NULL;
				Orientation _tmp25_ = 0;
				BackingPhotoRow* _tmp26_ = NULL;
				Orientation _tmp27_ = 0;
#line 2759 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp24_ = self->row;
#line 2759 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp25_ = _tmp24_->orientation;
#line 2759 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp26_ = self->backing_photo_row;
#line 2759 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp27_ = _tmp26_->original_orientation;
#line 2759 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp21_ = _tmp25_ != _tmp27_;
#line 21074 "Photo.c"
			}
#line 2758 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp21_) {
#line 2758 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp20_ = TRUE;
#line 21080 "Photo.c"
			} else {
				gboolean _tmp28_ = FALSE;
				MetadataDateTime* _tmp29_ = NULL;
#line 2760 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp29_ = date_time;
#line 2760 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp29_ != NULL) {
#line 21088 "Photo.c"
					PhotoRow* _tmp30_ = NULL;
					time_t _tmp31_ = 0;
					MetadataDateTime* _tmp32_ = NULL;
					time_t _tmp33_ = 0;
#line 2760 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp30_ = self->row;
#line 2760 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp31_ = _tmp30_->exposure_time;
#line 2760 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp32_ = date_time;
#line 2760 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp33_ = metadata_date_time_get_timestamp (_tmp32_);
#line 2760 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp28_ = _tmp31_ != _tmp33_;
#line 21103 "Photo.c"
				} else {
#line 2760 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp28_ = FALSE;
#line 21107 "Photo.c"
				}
#line 2760 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp20_ = _tmp28_;
#line 21111 "Photo.c"
			}
#line 2758 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp20_) {
#line 2758 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp19_ = TRUE;
#line 21117 "Photo.c"
			} else {
				gchar* _tmp34_ = NULL;
				gchar* _tmp35_ = NULL;
				const gchar* _tmp36_ = NULL;
#line 2761 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp34_ = media_source_get_comment (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 2761 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp35_ = _tmp34_;
#line 2761 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp36_ = comment;
#line 2761 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp19_ = g_strcmp0 (_tmp35_, _tmp36_) != 0;
#line 2761 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (_tmp35_);
#line 21132 "Photo.c"
			}
#line 2758 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp19_) {
#line 2758 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp18_ = TRUE;
#line 21138 "Photo.c"
			} else {
				gchar* _tmp37_ = NULL;
				gchar* _tmp38_ = NULL;
				const gchar* _tmp39_ = NULL;
#line 2762 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp37_ = media_source_get_title (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 2762 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp38_ = _tmp37_;
#line 2762 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp39_ = title;
#line 2762 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp18_ = g_strcmp0 (_tmp38_, _tmp39_) != 0;
#line 2762 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (_tmp38_);
#line 21153 "Photo.c"
			}
#line 2758 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp18_;
#line 21157 "Photo.c"
			{
				PhotoRow* _tmp40_ = NULL;
#line 2757 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp40_ = self->row;
#line 2757 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 21164 "Photo.c"
			}
#line 2758 "/home/jens/Source/shotwell/src/Photo.vala"
			_media_metadata_unref0 (metadata);
#line 2758 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (comment);
#line 2758 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (title);
#line 2758 "/home/jens/Source/shotwell/src/Photo.vala"
			_metadata_date_time_unref0 (date_time);
#line 2758 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 21176 "Photo.c"
		}
		__finally370:
		{
			PhotoRow* _tmp41_ = NULL;
#line 2757 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp41_ = self->row;
#line 2757 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 21185 "Photo.c"
		}
#line 2757 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (metadata);
#line 2757 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (comment);
#line 2757 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (title);
#line 2757 "/home/jens/Source/shotwell/src/Photo.vala"
		_metadata_date_time_unref0 (date_time);
#line 2757 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2757 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2757 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp42_;
#line 21201 "Photo.c"
	}
#line 2733 "/home/jens/Source/shotwell/src/Photo.vala"
	_media_metadata_unref0 (metadata);
#line 2733 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (comment);
#line 2733 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (title);
#line 2733 "/home/jens/Source/shotwell/src/Photo.vala"
	_metadata_date_time_unref0 (date_time);
#line 21211 "Photo.c"
}


PhotoTransformationState* photo_save_transformation_state (Photo* self) {
	PhotoTransformationState* result = NULL;
	GError * _inner_error_ = NULL;
#line 2767 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 21220 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2768 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2768 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 21227 "Photo.c"
		{
			PixelTransformer* _tmp1_ = NULL;
			PixelTransformer* _tmp2_ = NULL;
			PixelTransformationBundle* _tmp5_ = NULL;
			PixelTransformationBundle* _tmp6_ = NULL;
			PhotoRow* _tmp9_ = NULL;
			Orientation _tmp10_ = 0;
			PhotoRow* _tmp11_ = NULL;
			GeeHashMap* _tmp12_ = NULL;
			PhotoPhotoTransformationStateImpl* _tmp13_ = NULL;
#line 2771 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = self->priv->transformer;
#line 2771 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp2_ != NULL) {
#line 21242 "Photo.c"
				PixelTransformer* _tmp3_ = NULL;
				PixelTransformer* _tmp4_ = NULL;
#line 2771 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->priv->transformer;
#line 2771 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = pixel_transformer_copy (_tmp3_);
#line 2771 "/home/jens/Source/shotwell/src/Photo.vala"
				_pixel_transformer_unref0 (_tmp1_);
#line 2771 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = _tmp4_;
#line 21253 "Photo.c"
			} else {
#line 2771 "/home/jens/Source/shotwell/src/Photo.vala"
				_pixel_transformer_unref0 (_tmp1_);
#line 2771 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = NULL;
#line 21259 "Photo.c"
			}
#line 2772 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = self->priv->adjustments;
#line 2772 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp6_ != NULL) {
#line 21265 "Photo.c"
				PixelTransformationBundle* _tmp7_ = NULL;
				PixelTransformationBundle* _tmp8_ = NULL;
#line 2772 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = self->priv->adjustments;
#line 2772 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = pixel_transformation_bundle_copy (_tmp7_);
#line 2772 "/home/jens/Source/shotwell/src/Photo.vala"
				_pixel_transformation_bundle_unref0 (_tmp5_);
#line 2772 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = _tmp8_;
#line 21276 "Photo.c"
			} else {
#line 2772 "/home/jens/Source/shotwell/src/Photo.vala"
				_pixel_transformation_bundle_unref0 (_tmp5_);
#line 2772 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = NULL;
#line 21282 "Photo.c"
			}
#line 2769 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = self->row;
#line 2769 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = _tmp9_->orientation;
#line 2769 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = self->row;
#line 2769 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = _tmp11_->transformations;
#line 2769 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = photo_photo_transformation_state_impl_new (self, _tmp10_, _tmp12_, _tmp1_, _tmp5_);
#line 2769 "/home/jens/Source/shotwell/src/Photo.vala"
			result = G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_PHOTO_TRANSFORMATION_STATE, PhotoTransformationState);
#line 2769 "/home/jens/Source/shotwell/src/Photo.vala"
			_pixel_transformation_bundle_unref0 (_tmp5_);
#line 2769 "/home/jens/Source/shotwell/src/Photo.vala"
			_pixel_transformer_unref0 (_tmp1_);
#line 21300 "Photo.c"
			{
				PhotoRow* _tmp14_ = NULL;
#line 2768 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = self->row;
#line 2768 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 21307 "Photo.c"
			}
#line 2769 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 21311 "Photo.c"
		}
		__finally371:
		{
			PhotoRow* _tmp15_ = NULL;
#line 2768 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp15_ = self->row;
#line 2768 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 21320 "Photo.c"
		}
#line 2768 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2768 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2768 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 21328 "Photo.c"
	}
}


static gpointer _pixel_transformer_ref0 (gpointer self) {
#line 2793 "/home/jens/Source/shotwell/src/Photo.vala"
	return self ? pixel_transformer_ref (self) : NULL;
#line 21336 "Photo.c"
}


static gpointer _pixel_transformation_bundle_ref0 (gpointer self) {
#line 2794 "/home/jens/Source/shotwell/src/Photo.vala"
	return self ? pixel_transformation_bundle_ref (self) : NULL;
#line 21343 "Photo.c"
}


gboolean photo_load_transformation_state (Photo* self, PhotoTransformationState* state) {
	gboolean result = FALSE;
	PhotoPhotoTransformationStateImpl* state_impl = NULL;
	PhotoTransformationState* _tmp0_ = NULL;
	PhotoPhotoTransformationStateImpl* _tmp1_ = NULL;
	PhotoPhotoTransformationStateImpl* _tmp2_ = NULL;
	Orientation saved_orientation = 0;
	PhotoPhotoTransformationStateImpl* _tmp3_ = NULL;
	Orientation _tmp4_ = 0;
	GeeHashMap* saved_transformations = NULL;
	PhotoPhotoTransformationStateImpl* _tmp5_ = NULL;
	GeeHashMap* _tmp6_ = NULL;
	PixelTransformer* saved_transformer = NULL;
	PhotoPhotoTransformationStateImpl* _tmp7_ = NULL;
	PixelTransformer* _tmp8_ = NULL;
	PixelTransformationBundle* saved_adjustments = NULL;
	PhotoPhotoTransformationStateImpl* _tmp9_ = NULL;
	PixelTransformationBundle* _tmp10_ = NULL;
	gboolean committed = FALSE;
	gboolean _tmp31_ = FALSE;
	GError * _inner_error_ = NULL;
#line 2776 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 2776 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO_TRANSFORMATION_STATE (state), FALSE);
#line 2777 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = state;
#line 2777 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, PHOTO_TYPE_PHOTO_TRANSFORMATION_STATE_IMPL) ? ((PhotoPhotoTransformationStateImpl*) _tmp0_) : NULL);
#line 2777 "/home/jens/Source/shotwell/src/Photo.vala"
	state_impl = _tmp1_;
#line 2778 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = state_impl;
#line 2778 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp2_ == NULL) {
#line 2779 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 2779 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (state_impl);
#line 2779 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 21388 "Photo.c"
	}
#line 2781 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = state_impl;
#line 2781 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = photo_photo_transformation_state_impl_get_orientation (_tmp3_);
#line 2781 "/home/jens/Source/shotwell/src/Photo.vala"
	saved_orientation = _tmp4_;
#line 2782 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = state_impl;
#line 2782 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = photo_photo_transformation_state_impl_get_transformations (_tmp5_);
#line 2782 "/home/jens/Source/shotwell/src/Photo.vala"
	saved_transformations = _tmp6_;
#line 2783 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = state_impl;
#line 2783 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = photo_photo_transformation_state_impl_get_transformer (_tmp7_);
#line 2783 "/home/jens/Source/shotwell/src/Photo.vala"
	saved_transformer = _tmp8_;
#line 2784 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = state_impl;
#line 2784 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = photo_photo_transformation_state_impl_get_color_adjustments (_tmp9_);
#line 2784 "/home/jens/Source/shotwell/src/Photo.vala"
	saved_adjustments = _tmp10_;
#line 21414 "Photo.c"
	{
		PhotoRow* _tmp11_ = NULL;
#line 2787 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = self->row;
#line 2787 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 21421 "Photo.c"
		{
			PhotoTable* _tmp12_ = NULL;
			PhotoTable* _tmp13_ = NULL;
			PhotoRow* _tmp14_ = NULL;
			PhotoID _tmp15_ = {0};
			Orientation _tmp16_ = 0;
			GeeHashMap* _tmp17_ = NULL;
			gboolean _tmp18_ = FALSE;
			gboolean _tmp19_ = FALSE;
#line 2788 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = photo_table_get_instance ();
#line 2788 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = _tmp12_;
#line 2788 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp14_ = self->row;
#line 2788 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp15_ = _tmp14_->photo_id;
#line 2788 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp16_ = saved_orientation;
#line 2788 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp17_ = saved_transformations;
#line 2788 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp18_ = photo_table_set_transformation_state (_tmp13_, &_tmp15_, _tmp16_, _tmp17_);
#line 2788 "/home/jens/Source/shotwell/src/Photo.vala"
			committed = _tmp18_;
#line 2788 "/home/jens/Source/shotwell/src/Photo.vala"
			_database_table_unref0 (_tmp13_);
#line 2790 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp19_ = committed;
#line 2790 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp19_) {
#line 21453 "Photo.c"
				PhotoRow* _tmp20_ = NULL;
				Orientation _tmp21_ = 0;
				PhotoRow* _tmp22_ = NULL;
				GeeHashMap* _tmp23_ = NULL;
				GeeHashMap* _tmp24_ = NULL;
				PixelTransformer* _tmp25_ = NULL;
				PixelTransformer* _tmp26_ = NULL;
				PixelTransformationBundle* _tmp27_ = NULL;
				PixelTransformationBundle* _tmp28_ = NULL;
#line 2791 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp20_ = self->row;
#line 2791 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp21_ = saved_orientation;
#line 2791 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp20_->orientation = _tmp21_;
#line 2792 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp22_ = self->row;
#line 2792 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp23_ = saved_transformations;
#line 2792 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp24_ = _g_object_ref0 (_tmp23_);
#line 2792 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (_tmp22_->transformations);
#line 2792 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp22_->transformations = _tmp24_;
#line 2793 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp25_ = saved_transformer;
#line 2793 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp26_ = _pixel_transformer_ref0 (_tmp25_);
#line 2793 "/home/jens/Source/shotwell/src/Photo.vala"
				_pixel_transformer_unref0 (self->priv->transformer);
#line 2793 "/home/jens/Source/shotwell/src/Photo.vala"
				self->priv->transformer = _tmp26_;
#line 2794 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp27_ = saved_adjustments;
#line 2794 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp28_ = _pixel_transformation_bundle_ref0 (_tmp27_);
#line 2794 "/home/jens/Source/shotwell/src/Photo.vala"
				_pixel_transformation_bundle_unref0 (self->priv->adjustments);
#line 2794 "/home/jens/Source/shotwell/src/Photo.vala"
				self->priv->adjustments = _tmp28_;
#line 21495 "Photo.c"
			}
		}
		__finally372:
		{
			PhotoRow* _tmp29_ = NULL;
#line 2787 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp29_ = self->row;
#line 2787 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 21505 "Photo.c"
		}
#line 2787 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 21509 "Photo.c"
			gboolean _tmp30_ = FALSE;
#line 2787 "/home/jens/Source/shotwell/src/Photo.vala"
			_pixel_transformation_bundle_unref0 (saved_adjustments);
#line 2787 "/home/jens/Source/shotwell/src/Photo.vala"
			_pixel_transformer_unref0 (saved_transformer);
#line 2787 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (saved_transformations);
#line 2787 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (state_impl);
#line 2787 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2787 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2787 "/home/jens/Source/shotwell/src/Photo.vala"
			return _tmp30_;
#line 21525 "Photo.c"
		}
	}
#line 2798 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp31_ = committed;
#line 2798 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp31_) {
#line 21532 "Photo.c"
		Alteration* _tmp32_ = NULL;
		Alteration* _tmp33_ = NULL;
#line 2799 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp32_ = alteration_new ("image", "transformation-state");
#line 2799 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp33_ = _tmp32_;
#line 2799 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp33_);
#line 2799 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp33_);
#line 21543 "Photo.c"
	}
#line 2801 "/home/jens/Source/shotwell/src/Photo.vala"
	result = committed;
#line 2801 "/home/jens/Source/shotwell/src/Photo.vala"
	_pixel_transformation_bundle_unref0 (saved_adjustments);
#line 2801 "/home/jens/Source/shotwell/src/Photo.vala"
	_pixel_transformer_unref0 (saved_transformer);
#line 2801 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (saved_transformations);
#line 2801 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (state_impl);
#line 2801 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 21557 "Photo.c"
}


void photo_remove_all_transformations (Photo* self) {
#line 2804 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 2805 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_internal_remove_all_transformations (self, TRUE);
#line 21566 "Photo.c"
}


static void photo_internal_remove_all_transformations (Photo* self, gboolean notify) {
	gboolean is_altered = FALSE;
	gboolean _tmp21_ = FALSE;
	gboolean _tmp22_ = FALSE;
	GError * _inner_error_ = NULL;
#line 2808 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 2809 "/home/jens/Source/shotwell/src/Photo.vala"
	is_altered = FALSE;
#line 21579 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2810 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2810 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 21586 "Photo.c"
		{
			PhotoTable* _tmp1_ = NULL;
			PhotoTable* _tmp2_ = NULL;
			PhotoRow* _tmp3_ = NULL;
			PhotoID _tmp4_ = {0};
			gboolean _tmp5_ = FALSE;
			PhotoRow* _tmp6_ = NULL;
			PhotoRow* _tmp7_ = NULL;
			Orientation _tmp8_ = 0;
			BackingPhotoRow* _tmp9_ = NULL;
			Orientation _tmp10_ = 0;
#line 2811 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = photo_table_get_instance ();
#line 2811 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_;
#line 2811 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = self->row;
#line 2811 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = _tmp3_->photo_id;
#line 2811 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = photo_table_remove_all_transformations (_tmp2_, &_tmp4_);
#line 2811 "/home/jens/Source/shotwell/src/Photo.vala"
			is_altered = _tmp5_;
#line 2811 "/home/jens/Source/shotwell/src/Photo.vala"
			_database_table_unref0 (_tmp2_);
#line 2812 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = self->row;
#line 2812 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tmp6_->transformations);
#line 2812 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_->transformations = NULL;
#line 2814 "/home/jens/Source/shotwell/src/Photo.vala"
			_pixel_transformer_unref0 (self->priv->transformer);
#line 2814 "/home/jens/Source/shotwell/src/Photo.vala"
			self->priv->transformer = NULL;
#line 2815 "/home/jens/Source/shotwell/src/Photo.vala"
			_pixel_transformation_bundle_unref0 (self->priv->adjustments);
#line 2815 "/home/jens/Source/shotwell/src/Photo.vala"
			self->priv->adjustments = NULL;
#line 2817 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = self->row;
#line 2817 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = _tmp7_->orientation;
#line 2817 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = self->backing_photo_row;
#line 2817 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = _tmp9_->original_orientation;
#line 2817 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp8_ != _tmp10_) {
#line 21636 "Photo.c"
				PhotoTable* _tmp11_ = NULL;
				PhotoTable* _tmp12_ = NULL;
				PhotoRow* _tmp13_ = NULL;
				PhotoID _tmp14_ = {0};
				BackingPhotoRow* _tmp15_ = NULL;
				Orientation _tmp16_ = 0;
				PhotoRow* _tmp17_ = NULL;
				BackingPhotoRow* _tmp18_ = NULL;
				Orientation _tmp19_ = 0;
#line 2818 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = photo_table_get_instance ();
#line 2818 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = _tmp11_;
#line 2818 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = self->row;
#line 2818 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = _tmp13_->photo_id;
#line 2818 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = self->backing_photo_row;
#line 2818 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = _tmp15_->original_orientation;
#line 2818 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_table_set_orientation (_tmp12_, &_tmp14_, _tmp16_);
#line 2818 "/home/jens/Source/shotwell/src/Photo.vala"
				_database_table_unref0 (_tmp12_);
#line 2820 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp17_ = self->row;
#line 2820 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp18_ = self->backing_photo_row;
#line 2820 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp19_ = _tmp18_->original_orientation;
#line 2820 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp17_->orientation = _tmp19_;
#line 2821 "/home/jens/Source/shotwell/src/Photo.vala"
				is_altered = TRUE;
#line 21672 "Photo.c"
			}
		}
		__finally373:
		{
			PhotoRow* _tmp20_ = NULL;
#line 2810 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp20_ = self->row;
#line 2810 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 21682 "Photo.c"
		}
#line 2810 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2810 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2810 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2810 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 21692 "Photo.c"
		}
	}
#line 2825 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_ = is_altered;
#line 2825 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp22_) {
#line 21699 "Photo.c"
		gboolean _tmp23_ = FALSE;
#line 2825 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp23_ = notify;
#line 2825 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = _tmp23_;
#line 21705 "Photo.c"
	} else {
#line 2825 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = FALSE;
#line 21709 "Photo.c"
	}
#line 2825 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp21_) {
#line 21713 "Photo.c"
		Alteration* _tmp24_ = NULL;
		Alteration* _tmp25_ = NULL;
#line 2826 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp24_ = alteration_new ("image", "revert");
#line 2826 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp25_ = _tmp24_;
#line 2826 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp25_);
#line 2826 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp25_);
#line 21724 "Photo.c"
	}
}


Orientation photo_get_original_orientation (Photo* self) {
	Orientation result = 0;
	GError * _inner_error_ = NULL;
#line 2829 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), 0);
#line 21734 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2830 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2830 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 21741 "Photo.c"
		{
			BackingPhotoRow* _tmp1_ = NULL;
			Orientation _tmp2_ = 0;
#line 2831 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->backing_photo_row;
#line 2831 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->original_orientation;
#line 2831 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp2_;
#line 21751 "Photo.c"
			{
				PhotoRow* _tmp3_ = NULL;
#line 2830 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 2830 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 21758 "Photo.c"
			}
#line 2831 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 21762 "Photo.c"
		}
		__finally374:
		{
			PhotoRow* _tmp4_ = NULL;
#line 2830 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 2830 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 21771 "Photo.c"
		}
#line 2830 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2830 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2830 "/home/jens/Source/shotwell/src/Photo.vala"
		return 0;
#line 21779 "Photo.c"
	}
}


Orientation photo_get_orientation (Photo* self) {
	Orientation result = 0;
	GError * _inner_error_ = NULL;
#line 2835 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), 0);
#line 21789 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2836 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2836 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 21796 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			Orientation _tmp2_ = 0;
#line 2837 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2837 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->orientation;
#line 2837 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp2_;
#line 21806 "Photo.c"
			{
				PhotoRow* _tmp3_ = NULL;
#line 2836 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 2836 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 21813 "Photo.c"
			}
#line 2837 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 21817 "Photo.c"
		}
		__finally375:
		{
			PhotoRow* _tmp4_ = NULL;
#line 2836 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 2836 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 21826 "Photo.c"
		}
#line 2836 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2836 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2836 "/home/jens/Source/shotwell/src/Photo.vala"
		return 0;
#line 21834 "Photo.c"
	}
}


gboolean photo_set_orientation (Photo* self, Orientation orientation) {
	gboolean result = FALSE;
	gboolean committed = FALSE;
	gboolean _tmp15_ = FALSE;
	GError * _inner_error_ = NULL;
#line 2841 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 2842 "/home/jens/Source/shotwell/src/Photo.vala"
	committed = FALSE;
#line 21848 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2843 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2843 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 21855 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			Orientation _tmp2_ = 0;
			Orientation _tmp3_ = 0;
#line 2844 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2844 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->orientation;
#line 2844 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = orientation;
#line 2844 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp2_ != _tmp3_) {
#line 21868 "Photo.c"
				PhotoTable* _tmp4_ = NULL;
				PhotoTable* _tmp5_ = NULL;
				PhotoRow* _tmp6_ = NULL;
				PhotoID _tmp7_ = {0};
				Orientation _tmp8_ = 0;
				gboolean _tmp9_ = FALSE;
				gboolean _tmp10_ = FALSE;
#line 2845 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = photo_table_get_instance ();
#line 2845 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = _tmp4_;
#line 2845 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = self->row;
#line 2845 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = _tmp6_->photo_id;
#line 2845 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = orientation;
#line 2845 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = photo_table_set_orientation (_tmp5_, &_tmp7_, _tmp8_);
#line 2845 "/home/jens/Source/shotwell/src/Photo.vala"
				committed = _tmp9_;
#line 2845 "/home/jens/Source/shotwell/src/Photo.vala"
				_database_table_unref0 (_tmp5_);
#line 2846 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = committed;
#line 2846 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp10_) {
#line 21896 "Photo.c"
					PhotoRow* _tmp11_ = NULL;
					Orientation _tmp12_ = 0;
#line 2847 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp11_ = self->row;
#line 2847 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp12_ = orientation;
#line 2847 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp11_->orientation = _tmp12_;
#line 21905 "Photo.c"
				}
			}
		}
		__finally376:
		{
			PhotoRow* _tmp13_ = NULL;
#line 2843 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = self->row;
#line 2843 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 21916 "Photo.c"
		}
#line 2843 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 21920 "Photo.c"
			gboolean _tmp14_ = FALSE;
#line 2843 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2843 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2843 "/home/jens/Source/shotwell/src/Photo.vala"
			return _tmp14_;
#line 21928 "Photo.c"
		}
	}
#line 2851 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = committed;
#line 2851 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp15_) {
#line 21935 "Photo.c"
		Alteration* _tmp16_ = NULL;
		Alteration* _tmp17_ = NULL;
#line 2852 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = alteration_new ("image", "orientation");
#line 2852 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp17_ = _tmp16_;
#line 2852 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp17_);
#line 2852 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp17_);
#line 21946 "Photo.c"
	}
#line 2854 "/home/jens/Source/shotwell/src/Photo.vala"
	result = committed;
#line 2854 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 21952 "Photo.c"
}


gboolean photo_check_can_rotate (Photo* self) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
#line 2857 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 2858 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = self->can_rotate_now;
#line 2858 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 2858 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 21967 "Photo.c"
}


static void photo_real_rotate (Photo* self, Rotation rotation) {
	GError * _inner_error_ = NULL;
	{
		PhotoRow* _tmp0_ = NULL;
#line 2862 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2862 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 21979 "Photo.c"
		{
			Orientation _tmp1_ = 0;
			Rotation _tmp2_ = 0;
			Orientation _tmp3_ = 0;
#line 2863 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = photo_get_orientation (self);
#line 2863 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = rotation;
#line 2863 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = orientation_perform (_tmp1_, _tmp2_);
#line 2863 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_set_orientation (self, _tmp3_);
#line 21992 "Photo.c"
		}
		__finally377:
		{
			PhotoRow* _tmp4_ = NULL;
#line 2862 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 2862 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 22001 "Photo.c"
		}
#line 2862 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2862 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2862 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2862 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 22011 "Photo.c"
		}
	}
}


void photo_rotate (Photo* self, Rotation rotation) {
#line 2861 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 2861 "/home/jens/Source/shotwell/src/Photo.vala"
	PHOTO_GET_CLASS (self)->rotate (self, rotation);
#line 22022 "Photo.c"
}


static gboolean photo_has_transformation (Photo* self, const gchar* name) {
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
#line 2867 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 2867 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (name != NULL, FALSE);
#line 22033 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
		gboolean _tmp10_ = FALSE;
#line 2868 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2868 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 22041 "Photo.c"
		{
			gboolean _tmp1_ = FALSE;
			PhotoRow* _tmp2_ = NULL;
			GeeHashMap* _tmp3_ = NULL;
#line 2869 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = self->row;
#line 2869 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = _tmp2_->transformations;
#line 2869 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp3_ != NULL) {
#line 22052 "Photo.c"
				PhotoRow* _tmp4_ = NULL;
				GeeHashMap* _tmp5_ = NULL;
				const gchar* _tmp6_ = NULL;
				gboolean _tmp7_ = FALSE;
#line 2869 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = self->row;
#line 2869 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = _tmp4_->transformations;
#line 2869 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = name;
#line 2869 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp6_);
#line 2869 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = _tmp7_;
#line 22067 "Photo.c"
			} else {
#line 2869 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = FALSE;
#line 22071 "Photo.c"
			}
#line 2869 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp1_;
#line 22075 "Photo.c"
			{
				PhotoRow* _tmp8_ = NULL;
#line 2868 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = self->row;
#line 2868 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 22082 "Photo.c"
			}
#line 2869 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 22086 "Photo.c"
		}
		__finally378:
		{
			PhotoRow* _tmp9_ = NULL;
#line 2868 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = self->row;
#line 2868 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 22095 "Photo.c"
		}
#line 2868 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2868 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2868 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp10_;
#line 22103 "Photo.c"
	}
}


static KeyValueMap* photo_get_transformation (Photo* self, const gchar* name) {
	KeyValueMap* result = NULL;
	KeyValueMap* map = NULL;
	GError * _inner_error_ = NULL;
#line 2876 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 2876 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (name != NULL, NULL);
#line 2877 "/home/jens/Source/shotwell/src/Photo.vala"
	map = NULL;
#line 22118 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2878 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2878 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 22125 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			GeeHashMap* _tmp2_ = NULL;
#line 2879 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2879 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->transformations;
#line 2879 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp2_ != NULL) {
#line 22135 "Photo.c"
				PhotoRow* _tmp3_ = NULL;
				GeeHashMap* _tmp4_ = NULL;
				const gchar* _tmp5_ = NULL;
				gpointer _tmp6_ = NULL;
				KeyValueMap* _tmp7_ = NULL;
#line 2880 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 2880 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = _tmp3_->transformations;
#line 2880 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = name;
#line 2880 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp5_);
#line 2880 "/home/jens/Source/shotwell/src/Photo.vala"
				_key_value_map_unref0 (map);
#line 2880 "/home/jens/Source/shotwell/src/Photo.vala"
				map = (KeyValueMap*) _tmp6_;
#line 2881 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = map;
#line 2881 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp7_ != NULL) {
#line 22157 "Photo.c"
					KeyValueMap* _tmp8_ = NULL;
					KeyValueMap* _tmp9_ = NULL;
#line 2882 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp8_ = map;
#line 2882 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp9_ = key_value_map_copy (_tmp8_);
#line 2882 "/home/jens/Source/shotwell/src/Photo.vala"
					_key_value_map_unref0 (map);
#line 2882 "/home/jens/Source/shotwell/src/Photo.vala"
					map = _tmp9_;
#line 22168 "Photo.c"
				}
			}
		}
		__finally379:
		{
			PhotoRow* _tmp10_ = NULL;
#line 2878 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = self->row;
#line 2878 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 22179 "Photo.c"
		}
#line 2878 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2878 "/home/jens/Source/shotwell/src/Photo.vala"
			_key_value_map_unref0 (map);
#line 2878 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2878 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2878 "/home/jens/Source/shotwell/src/Photo.vala"
			return NULL;
#line 22191 "Photo.c"
		}
	}
#line 2886 "/home/jens/Source/shotwell/src/Photo.vala"
	result = map;
#line 2886 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 22198 "Photo.c"
}


static gboolean photo_set_transformation (Photo* self, KeyValueMap* trans) {
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
#line 2889 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 2889 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_KEY_VALUE_MAP (trans), FALSE);
#line 22209 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
		gboolean _tmp20_ = FALSE;
#line 2890 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2890 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 22217 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			GeeHashMap* _tmp2_ = NULL;
			PhotoRow* _tmp5_ = NULL;
			GeeHashMap* _tmp6_ = NULL;
			KeyValueMap* _tmp7_ = NULL;
			gchar* _tmp8_ = NULL;
			gchar* _tmp9_ = NULL;
			KeyValueMap* _tmp10_ = NULL;
			PhotoTable* _tmp11_ = NULL;
			PhotoTable* _tmp12_ = NULL;
			PhotoRow* _tmp13_ = NULL;
			PhotoID _tmp14_ = {0};
			KeyValueMap* _tmp15_ = NULL;
			gboolean _tmp16_ = FALSE;
			gboolean _tmp17_ = FALSE;
#line 2891 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2891 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->transformations;
#line 2891 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp2_ == NULL) {
#line 22240 "Photo.c"
				PhotoRow* _tmp3_ = NULL;
				GeeHashMap* _tmp4_ = NULL;
#line 2892 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 2892 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, TYPE_KEY_VALUE_MAP, (GBoxedCopyFunc) key_value_map_ref, (GDestroyNotify) key_value_map_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
#line 2892 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (_tmp3_->transformations);
#line 2892 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_->transformations = _tmp4_;
#line 22251 "Photo.c"
			}
#line 2894 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->row;
#line 2894 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = _tmp5_->transformations;
#line 2894 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = trans;
#line 2894 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = key_value_map_get_group (_tmp7_);
#line 2894 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = _tmp8_;
#line 2894 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = trans;
#line 2894 "/home/jens/Source/shotwell/src/Photo.vala"
			gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp9_, _tmp10_);
#line 2894 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (_tmp9_);
#line 2896 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = photo_table_get_instance ();
#line 2896 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = _tmp11_;
#line 2896 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = self->row;
#line 2896 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp14_ = _tmp13_->photo_id;
#line 2896 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp15_ = trans;
#line 2896 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp16_ = photo_table_set_transformation (_tmp12_, &_tmp14_, _tmp15_);
#line 2896 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp17_ = _tmp16_;
#line 2896 "/home/jens/Source/shotwell/src/Photo.vala"
			_database_table_unref0 (_tmp12_);
#line 2896 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp17_;
#line 22287 "Photo.c"
			{
				PhotoRow* _tmp18_ = NULL;
#line 2890 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp18_ = self->row;
#line 2890 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 22294 "Photo.c"
			}
#line 2896 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 22298 "Photo.c"
		}
		__finally380:
		{
			PhotoRow* _tmp19_ = NULL;
#line 2890 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp19_ = self->row;
#line 2890 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 22307 "Photo.c"
		}
#line 2890 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2890 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 2890 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp20_;
#line 22315 "Photo.c"
	}
}


static gboolean photo_remove_transformation (Photo* self, const gchar* name) {
	gboolean result = FALSE;
	gboolean altered_cache = FALSE;
	gboolean altered_persistent = FALSE;
	gboolean _tmp20_ = FALSE;
	gboolean _tmp21_ = FALSE;
	GError * _inner_error_ = NULL;
#line 2900 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 2900 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (name != NULL, FALSE);
#line 22331 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 2902 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 2902 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 22338 "Photo.c"
		{
			PhotoRow* _tmp1_ = NULL;
			GeeHashMap* _tmp2_ = NULL;
			PhotoTable* _tmp12_ = NULL;
			PhotoTable* _tmp13_ = NULL;
			PhotoRow* _tmp14_ = NULL;
			PhotoID _tmp15_ = {0};
			const gchar* _tmp16_ = NULL;
			gboolean _tmp17_ = FALSE;
#line 2903 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->row;
#line 2903 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->transformations;
#line 2903 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp2_ != NULL) {
#line 22354 "Photo.c"
				PhotoRow* _tmp3_ = NULL;
				GeeHashMap* _tmp4_ = NULL;
				const gchar* _tmp5_ = NULL;
				gboolean _tmp6_ = FALSE;
				PhotoRow* _tmp7_ = NULL;
				GeeHashMap* _tmp8_ = NULL;
				gint _tmp9_ = 0;
				gint _tmp10_ = 0;
#line 2904 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->row;
#line 2904 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = _tmp3_->transformations;
#line 2904 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = name;
#line 2904 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp5_, NULL);
#line 2904 "/home/jens/Source/shotwell/src/Photo.vala"
				altered_cache = _tmp6_;
#line 2905 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = self->row;
#line 2905 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = _tmp7_->transformations;
#line 2905 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = gee_abstract_map_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
#line 2905 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = _tmp9_;
#line 2905 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp10_ == 0) {
#line 22383 "Photo.c"
					PhotoRow* _tmp11_ = NULL;
#line 2906 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp11_ = self->row;
#line 2906 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_tmp11_->transformations);
#line 2906 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp11_->transformations = NULL;
#line 22391 "Photo.c"
				}
			} else {
#line 2908 "/home/jens/Source/shotwell/src/Photo.vala"
				altered_cache = FALSE;
#line 22396 "Photo.c"
			}
#line 2911 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = photo_table_get_instance ();
#line 2911 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = _tmp12_;
#line 2911 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp14_ = self->row;
#line 2911 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp15_ = _tmp14_->photo_id;
#line 2911 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp16_ = name;
#line 2911 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp17_ = photo_table_remove_transformation (_tmp13_, &_tmp15_, _tmp16_);
#line 2911 "/home/jens/Source/shotwell/src/Photo.vala"
			altered_persistent = _tmp17_;
#line 2911 "/home/jens/Source/shotwell/src/Photo.vala"
			_database_table_unref0 (_tmp13_);
#line 22414 "Photo.c"
		}
		__finally381:
		{
			PhotoRow* _tmp18_ = NULL;
#line 2902 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp18_ = self->row;
#line 2902 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 22423 "Photo.c"
		}
#line 2902 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 22427 "Photo.c"
			gboolean _tmp19_ = FALSE;
#line 2902 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 2902 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 2902 "/home/jens/Source/shotwell/src/Photo.vala"
			return _tmp19_;
#line 22435 "Photo.c"
		}
	}
#line 2915 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp21_ = altered_cache;
#line 2915 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp21_) {
#line 2915 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = TRUE;
#line 22444 "Photo.c"
	} else {
#line 2915 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = altered_persistent;
#line 22448 "Photo.c"
	}
#line 2915 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp20_;
#line 2915 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 22454 "Photo.c"
}


gboolean photo_has_crop (Photo* self) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
#line 2918 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 2919 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_has_transformation (self, "crop");
#line 2919 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 2919 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 22469 "Photo.c"
}


gboolean photo_get_raw_crop (Photo* self, Box* crop) {
	Box _vala_crop = {0};
	gboolean result = FALSE;
	KeyValueMap* map = NULL;
	KeyValueMap* _tmp0_ = NULL;
	KeyValueMap* _tmp1_ = NULL;
	gint left = 0;
	KeyValueMap* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	gint top = 0;
	KeyValueMap* _tmp4_ = NULL;
	gint _tmp5_ = 0;
	gint right = 0;
	KeyValueMap* _tmp6_ = NULL;
	gint _tmp7_ = 0;
	gint bottom = 0;
	KeyValueMap* _tmp8_ = NULL;
	gint _tmp9_ = 0;
	gboolean _tmp10_ = FALSE;
	gboolean _tmp11_ = FALSE;
	gboolean _tmp12_ = FALSE;
	gint _tmp13_ = 0;
	gint _tmp17_ = 0;
	gint _tmp18_ = 0;
	gint _tmp19_ = 0;
	gint _tmp20_ = 0;
#line 2923 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 2924 "/home/jens/Source/shotwell/src/Photo.vala"
	box_init (&_vala_crop, 0, 0, 0, 0);
#line 2926 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_transformation (self, "crop");
#line 2926 "/home/jens/Source/shotwell/src/Photo.vala"
	map = _tmp0_;
#line 2927 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = map;
#line 2927 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_ == NULL) {
#line 2928 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 2928 "/home/jens/Source/shotwell/src/Photo.vala"
		_key_value_map_unref0 (map);
#line 2928 "/home/jens/Source/shotwell/src/Photo.vala"
		if (crop) {
#line 2928 "/home/jens/Source/shotwell/src/Photo.vala"
			*crop = _vala_crop;
#line 22519 "Photo.c"
		}
#line 2928 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 22523 "Photo.c"
	}
#line 2930 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = map;
#line 2930 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = key_value_map_get_int (_tmp2_, "left", -1);
#line 2930 "/home/jens/Source/shotwell/src/Photo.vala"
	left = _tmp3_;
#line 2931 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = map;
#line 2931 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = key_value_map_get_int (_tmp4_, "top", -1);
#line 2931 "/home/jens/Source/shotwell/src/Photo.vala"
	top = _tmp5_;
#line 2932 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = map;
#line 2932 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = key_value_map_get_int (_tmp6_, "right", -1);
#line 2932 "/home/jens/Source/shotwell/src/Photo.vala"
	right = _tmp7_;
#line 2933 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = map;
#line 2933 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = key_value_map_get_int (_tmp8_, "bottom", -1);
#line 2933 "/home/jens/Source/shotwell/src/Photo.vala"
	bottom = _tmp9_;
#line 2935 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = left;
#line 2935 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp13_ == -1) {
#line 2935 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = TRUE;
#line 22555 "Photo.c"
	} else {
		gint _tmp14_ = 0;
#line 2935 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp14_ = top;
#line 2935 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = _tmp14_ == -1;
#line 22562 "Photo.c"
	}
#line 2935 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp12_) {
#line 2935 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = TRUE;
#line 22568 "Photo.c"
	} else {
		gint _tmp15_ = 0;
#line 2935 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp15_ = right;
#line 2935 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = _tmp15_ == -1;
#line 22575 "Photo.c"
	}
#line 2935 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp11_) {
#line 2935 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp10_ = TRUE;
#line 22581 "Photo.c"
	} else {
		gint _tmp16_ = 0;
#line 2935 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = bottom;
#line 2935 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp10_ = _tmp16_ == -1;
#line 22588 "Photo.c"
	}
#line 2935 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp10_) {
#line 2936 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 2936 "/home/jens/Source/shotwell/src/Photo.vala"
		_key_value_map_unref0 (map);
#line 2936 "/home/jens/Source/shotwell/src/Photo.vala"
		if (crop) {
#line 2936 "/home/jens/Source/shotwell/src/Photo.vala"
			*crop = _vala_crop;
#line 22600 "Photo.c"
		}
#line 2936 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 22604 "Photo.c"
	}
#line 2938 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = left;
#line 2938 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp18_ = top;
#line 2938 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp19_ = right;
#line 2938 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp20_ = bottom;
#line 2938 "/home/jens/Source/shotwell/src/Photo.vala"
	box_init (&_vala_crop, _tmp17_, _tmp18_, _tmp19_, _tmp20_);
#line 2940 "/home/jens/Source/shotwell/src/Photo.vala"
	result = TRUE;
#line 2940 "/home/jens/Source/shotwell/src/Photo.vala"
	_key_value_map_unref0 (map);
#line 2940 "/home/jens/Source/shotwell/src/Photo.vala"
	if (crop) {
#line 2940 "/home/jens/Source/shotwell/src/Photo.vala"
		*crop = _vala_crop;
#line 22624 "Photo.c"
	}
#line 2940 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 22628 "Photo.c"
}


static void photo_set_raw_crop (Photo* self, Box* crop) {
	KeyValueMap* map = NULL;
	KeyValueMap* _tmp0_ = NULL;
	KeyValueMap* _tmp1_ = NULL;
	Box _tmp2_ = {0};
	gint _tmp3_ = 0;
	KeyValueMap* _tmp4_ = NULL;
	Box _tmp5_ = {0};
	gint _tmp6_ = 0;
	KeyValueMap* _tmp7_ = NULL;
	Box _tmp8_ = {0};
	gint _tmp9_ = 0;
	KeyValueMap* _tmp10_ = NULL;
	Box _tmp11_ = {0};
	gint _tmp12_ = 0;
	KeyValueMap* _tmp13_ = NULL;
	gboolean _tmp14_ = FALSE;
#line 2944 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 2944 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (crop != NULL);
#line 2945 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = key_value_map_new ("crop");
#line 2945 "/home/jens/Source/shotwell/src/Photo.vala"
	map = _tmp0_;
#line 2946 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = map;
#line 2946 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = *crop;
#line 2946 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp2_.left;
#line 2946 "/home/jens/Source/shotwell/src/Photo.vala"
	key_value_map_set_int (_tmp1_, "left", _tmp3_);
#line 2947 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = map;
#line 2947 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = *crop;
#line 2947 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = _tmp5_.top;
#line 2947 "/home/jens/Source/shotwell/src/Photo.vala"
	key_value_map_set_int (_tmp4_, "top", _tmp6_);
#line 2948 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = map;
#line 2948 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = *crop;
#line 2948 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = _tmp8_.right;
#line 2948 "/home/jens/Source/shotwell/src/Photo.vala"
	key_value_map_set_int (_tmp7_, "right", _tmp9_);
#line 2949 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = map;
#line 2949 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = *crop;
#line 2949 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = _tmp11_.bottom;
#line 2949 "/home/jens/Source/shotwell/src/Photo.vala"
	key_value_map_set_int (_tmp10_, "bottom", _tmp12_);
#line 2951 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = map;
#line 2951 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = photo_set_transformation (self, _tmp13_);
#line 2951 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp14_) {
#line 22695 "Photo.c"
		Alteration* _tmp15_ = NULL;
		Alteration* _tmp16_ = NULL;
#line 2952 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp15_ = alteration_new ("image", "crop");
#line 2952 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = _tmp15_;
#line 2952 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp16_);
#line 2952 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp16_);
#line 22706 "Photo.c"
	}
#line 2944 "/home/jens/Source/shotwell/src/Photo.vala"
	_key_value_map_unref0 (map);
#line 22710 "Photo.c"
}


static gboolean photo_get_raw_straighten (Photo* self, gdouble* angle) {
	gdouble _vala_angle = 0.0;
	gboolean result = FALSE;
	KeyValueMap* map = NULL;
	KeyValueMap* _tmp0_ = NULL;
	KeyValueMap* _tmp1_ = NULL;
	KeyValueMap* _tmp2_ = NULL;
	gdouble _tmp3_ = 0.0;
#line 2955 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 2956 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_transformation (self, "straighten");
#line 2956 "/home/jens/Source/shotwell/src/Photo.vala"
	map = _tmp0_;
#line 2957 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = map;
#line 2957 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_ == NULL) {
#line 2958 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_angle = 0.0;
#line 2960 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 2960 "/home/jens/Source/shotwell/src/Photo.vala"
		_key_value_map_unref0 (map);
#line 2960 "/home/jens/Source/shotwell/src/Photo.vala"
		if (angle) {
#line 2960 "/home/jens/Source/shotwell/src/Photo.vala"
			*angle = _vala_angle;
#line 22742 "Photo.c"
		}
#line 2960 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 22746 "Photo.c"
	}
#line 2963 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = map;
#line 2963 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = key_value_map_get_double (_tmp2_, "angle", 0.0);
#line 2963 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_angle = _tmp3_;
#line 2965 "/home/jens/Source/shotwell/src/Photo.vala"
	result = TRUE;
#line 2965 "/home/jens/Source/shotwell/src/Photo.vala"
	_key_value_map_unref0 (map);
#line 2965 "/home/jens/Source/shotwell/src/Photo.vala"
	if (angle) {
#line 2965 "/home/jens/Source/shotwell/src/Photo.vala"
		*angle = _vala_angle;
#line 22762 "Photo.c"
	}
#line 2965 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 22766 "Photo.c"
}


static void photo_set_raw_straighten (Photo* self, gdouble theta) {
	KeyValueMap* map = NULL;
	KeyValueMap* _tmp0_ = NULL;
	KeyValueMap* _tmp1_ = NULL;
	gdouble _tmp2_ = 0.0;
	KeyValueMap* _tmp3_ = NULL;
	gboolean _tmp4_ = FALSE;
#line 2968 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 2969 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = key_value_map_new ("straighten");
#line 2969 "/home/jens/Source/shotwell/src/Photo.vala"
	map = _tmp0_;
#line 2970 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = map;
#line 2970 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = theta;
#line 2970 "/home/jens/Source/shotwell/src/Photo.vala"
	key_value_map_set_double (_tmp1_, "angle", _tmp2_);
#line 2972 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = map;
#line 2972 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = photo_set_transformation (self, _tmp3_);
#line 2972 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp4_) {
#line 22795 "Photo.c"
		Alteration* _tmp5_ = NULL;
		Alteration* _tmp6_ = NULL;
#line 2973 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = alteration_new ("image", "straighten");
#line 2973 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = _tmp5_;
#line 2973 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp6_);
#line 2973 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp6_);
#line 22806 "Photo.c"
	}
#line 2968 "/home/jens/Source/shotwell/src/Photo.vala"
	_key_value_map_unref0 (map);
#line 22810 "Photo.c"
}


static EditingToolsRedeyeInstance* photo_get_raw_redeye_instances (Photo* self, int* result_length1) {
	EditingToolsRedeyeInstance* result = NULL;
	KeyValueMap* map = NULL;
	KeyValueMap* _tmp0_ = NULL;
	KeyValueMap* _tmp1_ = NULL;
	gint num_points = 0;
	KeyValueMap* _tmp4_ = NULL;
	gint _tmp5_ = 0;
	gint _tmp6_ = 0;
	EditingToolsRedeyeInstance* res = NULL;
	gint _tmp7_ = 0;
	EditingToolsRedeyeInstance* _tmp8_ = NULL;
	gint res_length1 = 0;
	gint _res_size_ = 0;
	GdkPoint default_point = {0};
	GdkPoint _tmp9_ = {0};
	EditingToolsRedeyeInstance* _tmp47_ = NULL;
	gint _tmp47__length1 = 0;
#line 2978 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 2979 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_transformation (self, "redeye");
#line 2979 "/home/jens/Source/shotwell/src/Photo.vala"
	map = _tmp0_;
#line 2980 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = map;
#line 2980 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_ == NULL) {
#line 22842 "Photo.c"
		EditingToolsRedeyeInstance* _tmp2_ = NULL;
		EditingToolsRedeyeInstance* _tmp3_ = NULL;
		gint _tmp3__length1 = 0;
#line 2981 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = g_new0 (EditingToolsRedeyeInstance, 0);
#line 2981 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = _tmp2_;
#line 2981 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3__length1 = 0;
#line 2981 "/home/jens/Source/shotwell/src/Photo.vala"
		if (result_length1) {
#line 2981 "/home/jens/Source/shotwell/src/Photo.vala"
			*result_length1 = _tmp3__length1;
#line 22856 "Photo.c"
		}
#line 2981 "/home/jens/Source/shotwell/src/Photo.vala"
		result = _tmp3_;
#line 2981 "/home/jens/Source/shotwell/src/Photo.vala"
		_key_value_map_unref0 (map);
#line 2981 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 22864 "Photo.c"
	}
#line 2983 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = map;
#line 2983 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = key_value_map_get_int (_tmp4_, "num_points", -1);
#line 2983 "/home/jens/Source/shotwell/src/Photo.vala"
	num_points = _tmp5_;
#line 2984 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = num_points;
#line 2984 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_assert (_tmp6_ > 0, "num_points > 0");
#line 2986 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = num_points;
#line 2986 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = g_new0 (EditingToolsRedeyeInstance, _tmp7_);
#line 2986 "/home/jens/Source/shotwell/src/Photo.vala"
	res = _tmp8_;
#line 2986 "/home/jens/Source/shotwell/src/Photo.vala"
	res_length1 = _tmp7_;
#line 2986 "/home/jens/Source/shotwell/src/Photo.vala"
	_res_size_ = res_length1;
#line 2988 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_.x = 0;
#line 2988 "/home/jens/Source/shotwell/src/Photo.vala"
	default_point = _tmp9_;
#line 2989 "/home/jens/Source/shotwell/src/Photo.vala"
	default_point.x = -1;
#line 2990 "/home/jens/Source/shotwell/src/Photo.vala"
	default_point.y = -1;
#line 22894 "Photo.c"
	{
		gint i = 0;
#line 2992 "/home/jens/Source/shotwell/src/Photo.vala"
		i = 0;
#line 22899 "Photo.c"
		{
			gboolean _tmp10_ = FALSE;
#line 2992 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = TRUE;
#line 2992 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 22906 "Photo.c"
				gint _tmp12_ = 0;
				gint _tmp13_ = 0;
				gchar* center_key = NULL;
				gint _tmp14_ = 0;
				gchar* _tmp15_ = NULL;
				gchar* radius_key = NULL;
				gint _tmp16_ = 0;
				gchar* _tmp17_ = NULL;
				EditingToolsRedeyeInstance* _tmp18_ = NULL;
				gint _tmp18__length1 = 0;
				gint _tmp19_ = 0;
				KeyValueMap* _tmp20_ = NULL;
				const gchar* _tmp21_ = NULL;
				GdkPoint _tmp22_ = {0};
				GdkPoint _tmp23_ = {0};
				EditingToolsRedeyeInstance* _tmp24_ = NULL;
				gint _tmp24__length1 = 0;
				gint _tmp25_ = 0;
				EditingToolsRedeyeInstance _tmp26_ = {0};
				GdkPoint _tmp27_ = {0};
				gint _tmp28_ = 0;
				GdkPoint _tmp29_ = {0};
				gint _tmp30_ = 0;
				EditingToolsRedeyeInstance* _tmp31_ = NULL;
				gint _tmp31__length1 = 0;
				gint _tmp32_ = 0;
				EditingToolsRedeyeInstance _tmp33_ = {0};
				GdkPoint _tmp34_ = {0};
				gint _tmp35_ = 0;
				GdkPoint _tmp36_ = {0};
				gint _tmp37_ = 0;
				EditingToolsRedeyeInstance* _tmp38_ = NULL;
				gint _tmp38__length1 = 0;
				gint _tmp39_ = 0;
				KeyValueMap* _tmp40_ = NULL;
				const gchar* _tmp41_ = NULL;
				gint _tmp42_ = 0;
				EditingToolsRedeyeInstance* _tmp43_ = NULL;
				gint _tmp43__length1 = 0;
				gint _tmp44_ = 0;
				EditingToolsRedeyeInstance _tmp45_ = {0};
				gint _tmp46_ = 0;
#line 2992 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp10_) {
#line 22951 "Photo.c"
					gint _tmp11_ = 0;
#line 2992 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp11_ = i;
#line 2992 "/home/jens/Source/shotwell/src/Photo.vala"
					i = _tmp11_ + 1;
#line 22957 "Photo.c"
				}
#line 2992 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = FALSE;
#line 2992 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = i;
#line 2992 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = num_points;
#line 2992 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!(_tmp12_ < _tmp13_)) {
#line 2992 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 22969 "Photo.c"
				}
#line 2993 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = i;
#line 2993 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = g_strdup_printf ("center%d", _tmp14_);
#line 2993 "/home/jens/Source/shotwell/src/Photo.vala"
				center_key = _tmp15_;
#line 2994 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = i;
#line 2994 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp17_ = g_strdup_printf ("radius%d", _tmp16_);
#line 2994 "/home/jens/Source/shotwell/src/Photo.vala"
				radius_key = _tmp17_;
#line 2996 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp18_ = res;
#line 2996 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp18__length1 = res_length1;
#line 2996 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp19_ = i;
#line 2996 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp20_ = map;
#line 2996 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp21_ = center_key;
#line 2996 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp22_ = default_point;
#line 2996 "/home/jens/Source/shotwell/src/Photo.vala"
				key_value_map_get_point (_tmp20_, _tmp21_, &_tmp22_, &_tmp23_);
#line 2996 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp18_[_tmp19_].center = _tmp23_;
#line 2997 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp24_ = res;
#line 2997 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp24__length1 = res_length1;
#line 2997 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp25_ = i;
#line 2997 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp26_ = _tmp24_[_tmp25_];
#line 2997 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp27_ = _tmp26_.center;
#line 2997 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp28_ = _tmp27_.x;
#line 2997 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp29_ = default_point;
#line 2997 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp30_ = _tmp29_.x;
#line 2997 "/home/jens/Source/shotwell/src/Photo.vala"
				_vala_assert (_tmp28_ != _tmp30_, "res[i].center.x != default_point.x");
#line 2998 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp31_ = res;
#line 2998 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp31__length1 = res_length1;
#line 2998 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp32_ = i;
#line 2998 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp33_ = _tmp31_[_tmp32_];
#line 2998 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp34_ = _tmp33_.center;
#line 2998 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp35_ = _tmp34_.y;
#line 2998 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp36_ = default_point;
#line 2998 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp37_ = _tmp36_.y;
#line 2998 "/home/jens/Source/shotwell/src/Photo.vala"
				_vala_assert (_tmp35_ != _tmp37_, "res[i].center.y != default_point.y");
#line 3000 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp38_ = res;
#line 3000 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp38__length1 = res_length1;
#line 3000 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp39_ = i;
#line 3000 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp40_ = map;
#line 3000 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp41_ = radius_key;
#line 3000 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp42_ = key_value_map_get_int (_tmp40_, _tmp41_, -1);
#line 3000 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp38_[_tmp39_].radius = _tmp42_;
#line 3001 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp43_ = res;
#line 3001 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp43__length1 = res_length1;
#line 3001 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp44_ = i;
#line 3001 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp45_ = _tmp43_[_tmp44_];
#line 3001 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp46_ = _tmp45_.radius;
#line 3001 "/home/jens/Source/shotwell/src/Photo.vala"
				_vala_assert (_tmp46_ != -1, "res[i].radius != -1");
#line 2992 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (radius_key);
#line 2992 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (center_key);
#line 23065 "Photo.c"
			}
		}
	}
#line 3004 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp47_ = res;
#line 3004 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp47__length1 = res_length1;
#line 3004 "/home/jens/Source/shotwell/src/Photo.vala"
	if (result_length1) {
#line 3004 "/home/jens/Source/shotwell/src/Photo.vala"
		*result_length1 = _tmp47__length1;
#line 23077 "Photo.c"
	}
#line 3004 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp47_;
#line 3004 "/home/jens/Source/shotwell/src/Photo.vala"
	_key_value_map_unref0 (map);
#line 3004 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 23085 "Photo.c"
}


gboolean photo_has_redeye_transformations (Photo* self) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
#line 3007 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 3008 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_has_transformation (self, "redeye");
#line 3008 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 3008 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 23100 "Photo.c"
}


void photo_add_redeye_instance (Photo* self, EditingToolsRedeyeInstance* redeye) {
	KeyValueMap* map = NULL;
	KeyValueMap* _tmp0_ = NULL;
	KeyValueMap* _tmp1_ = NULL;
	gint num_points = 0;
	KeyValueMap* _tmp4_ = NULL;
	gint _tmp5_ = 0;
	gint _tmp6_ = 0;
	gint _tmp7_ = 0;
	gchar* radius_key = NULL;
	gint _tmp8_ = 0;
	gchar* _tmp9_ = NULL;
	gchar* center_key = NULL;
	gint _tmp10_ = 0;
	gchar* _tmp11_ = NULL;
	KeyValueMap* _tmp12_ = NULL;
	const gchar* _tmp13_ = NULL;
	EditingToolsRedeyeInstance _tmp14_ = {0};
	gint _tmp15_ = 0;
	KeyValueMap* _tmp16_ = NULL;
	const gchar* _tmp17_ = NULL;
	EditingToolsRedeyeInstance _tmp18_ = {0};
	GdkPoint _tmp19_ = {0};
	KeyValueMap* _tmp20_ = NULL;
	gint _tmp21_ = 0;
	KeyValueMap* _tmp22_ = NULL;
	gboolean _tmp23_ = FALSE;
#line 3012 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 3012 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (redeye != NULL);
#line 3013 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_transformation (self, "redeye");
#line 3013 "/home/jens/Source/shotwell/src/Photo.vala"
	map = _tmp0_;
#line 3014 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = map;
#line 3014 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_ == NULL) {
#line 23143 "Photo.c"
		KeyValueMap* _tmp2_ = NULL;
		KeyValueMap* _tmp3_ = NULL;
#line 3015 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = key_value_map_new ("redeye");
#line 3015 "/home/jens/Source/shotwell/src/Photo.vala"
		_key_value_map_unref0 (map);
#line 3015 "/home/jens/Source/shotwell/src/Photo.vala"
		map = _tmp2_;
#line 3016 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = map;
#line 3016 "/home/jens/Source/shotwell/src/Photo.vala"
		key_value_map_set_int (_tmp3_, "num_points", 0);
#line 23156 "Photo.c"
	}
#line 3019 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = map;
#line 3019 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = key_value_map_get_int (_tmp4_, "num_points", -1);
#line 3019 "/home/jens/Source/shotwell/src/Photo.vala"
	num_points = _tmp5_;
#line 3020 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = num_points;
#line 3020 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_assert (_tmp6_ >= 0, "num_points >= 0");
#line 3022 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = num_points;
#line 3022 "/home/jens/Source/shotwell/src/Photo.vala"
	num_points = _tmp7_ + 1;
#line 3024 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = num_points;
#line 3024 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = g_strdup_printf ("radius%d", _tmp8_ - 1);
#line 3024 "/home/jens/Source/shotwell/src/Photo.vala"
	radius_key = _tmp9_;
#line 3025 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = num_points;
#line 3025 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = g_strdup_printf ("center%d", _tmp10_ - 1);
#line 3025 "/home/jens/Source/shotwell/src/Photo.vala"
	center_key = _tmp11_;
#line 3027 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = map;
#line 3027 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = radius_key;
#line 3027 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = *redeye;
#line 3027 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = _tmp14_.radius;
#line 3027 "/home/jens/Source/shotwell/src/Photo.vala"
	key_value_map_set_int (_tmp12_, _tmp13_, _tmp15_);
#line 3028 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_ = map;
#line 3028 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = center_key;
#line 3028 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp18_ = *redeye;
#line 3028 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp19_ = _tmp18_.center;
#line 3028 "/home/jens/Source/shotwell/src/Photo.vala"
	key_value_map_set_point (_tmp16_, _tmp17_, &_tmp19_);
#line 3030 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp20_ = map;
#line 3030 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp21_ = num_points;
#line 3030 "/home/jens/Source/shotwell/src/Photo.vala"
	key_value_map_set_int (_tmp20_, "num_points", _tmp21_);
#line 3032 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_ = map;
#line 3032 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp23_ = photo_set_transformation (self, _tmp22_);
#line 3032 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp23_) {
#line 23216 "Photo.c"
		Alteration* _tmp24_ = NULL;
		Alteration* _tmp25_ = NULL;
#line 3033 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp24_ = alteration_new ("image", "redeye");
#line 3033 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp25_ = _tmp24_;
#line 3033 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp25_);
#line 3033 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp25_);
#line 23227 "Photo.c"
	}
#line 3012 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (center_key);
#line 3012 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (radius_key);
#line 3012 "/home/jens/Source/shotwell/src/Photo.vala"
	_key_value_map_unref0 (map);
#line 23235 "Photo.c"
}


static gboolean photo_calculate_pixbuf_dimensions (Photo* self, Scaling* scaling, PhotoException exceptions, Dimensions* scaled_image, Dimensions* scaled_to_viewport) {
	Dimensions _vala_scaled_image = {0};
	Dimensions _vala_scaled_to_viewport = {0};
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
#line 3047 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 3047 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (scaling != NULL, FALSE);
#line 23248 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
		gboolean _tmp8_ = FALSE;
#line 3049 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 3049 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 23256 "Photo.c"
		{
			Scaling _tmp1_ = {0};
			PhotoException _tmp2_ = 0;
			Dimensions _tmp3_ = {0};
			Dimensions _tmp4_ = {0};
			gboolean _tmp5_ = FALSE;
#line 3051 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = *scaling;
#line 3051 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = exceptions;
#line 3051 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = photo_locked_calculate_pixbuf_dimensions (self, &_tmp1_, _tmp2_, &_tmp3_, &_tmp4_);
#line 3051 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_scaled_image = _tmp3_;
#line 3051 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_scaled_to_viewport = _tmp4_;
#line 3051 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp5_;
#line 23275 "Photo.c"
			{
				PhotoRow* _tmp6_ = NULL;
#line 3049 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = self->row;
#line 3049 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 23282 "Photo.c"
			}
#line 3051 "/home/jens/Source/shotwell/src/Photo.vala"
			if (scaled_image) {
#line 3051 "/home/jens/Source/shotwell/src/Photo.vala"
				*scaled_image = _vala_scaled_image;
#line 23288 "Photo.c"
			}
#line 3051 "/home/jens/Source/shotwell/src/Photo.vala"
			if (scaled_to_viewport) {
#line 3051 "/home/jens/Source/shotwell/src/Photo.vala"
				*scaled_to_viewport = _vala_scaled_to_viewport;
#line 23294 "Photo.c"
			}
#line 3051 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 23298 "Photo.c"
		}
		__finally382:
		{
			PhotoRow* _tmp7_ = NULL;
#line 3049 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = self->row;
#line 3049 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 23307 "Photo.c"
		}
#line 3049 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 3049 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 3049 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp8_;
#line 23315 "Photo.c"
	}
#line 3047 "/home/jens/Source/shotwell/src/Photo.vala"
	if (scaled_image) {
#line 3047 "/home/jens/Source/shotwell/src/Photo.vala"
		*scaled_image = _vala_scaled_image;
#line 23321 "Photo.c"
	}
#line 3047 "/home/jens/Source/shotwell/src/Photo.vala"
	if (scaled_to_viewport) {
#line 3047 "/home/jens/Source/shotwell/src/Photo.vala"
		*scaled_to_viewport = _vala_scaled_to_viewport;
#line 23327 "Photo.c"
	}
}


static gboolean photo_locked_calculate_pixbuf_dimensions (Photo* self, Scaling* scaling, PhotoException exceptions, Dimensions* scaled_image, Dimensions* scaled_to_viewport) {
	Dimensions _vala_scaled_image = {0};
	Dimensions _vala_scaled_to_viewport = {0};
	gboolean result = FALSE;
	Dimensions raw = {0};
	Dimensions _tmp0_ = {0};
	gboolean _tmp1_ = FALSE;
	Orientation orientation = 0;
	Orientation _tmp4_ = 0;
	PhotoException _tmp5_ = 0;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp38_ = FALSE;
	gboolean _tmp53_ = FALSE;
	Dimensions _tmp54_ = {0};
	gint _tmp55_ = 0;
	Dimensions _tmp56_ = {0};
	gint _tmp57_ = 0;
	gboolean _tmp63_ = FALSE;
	gboolean _tmp64_ = FALSE;
#line 3057 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 3057 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (scaling != NULL, FALSE);
#line 3059 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_get_raw_dimensions (self, &_tmp0_);
#line 3059 "/home/jens/Source/shotwell/src/Photo.vala"
	raw = _tmp0_;
#line 3061 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = scaling_is_unscaled (scaling);
#line 3061 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_) {
#line 23363 "Photo.c"
		Dimensions _tmp2_ = {0};
		Dimensions _tmp3_ = {0};
#line 3062 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = raw;
#line 3062 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_scaled_image = _tmp2_;
#line 3063 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = raw;
#line 3063 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_scaled_to_viewport = _tmp3_;
#line 3065 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 3065 "/home/jens/Source/shotwell/src/Photo.vala"
		if (scaled_image) {
#line 3065 "/home/jens/Source/shotwell/src/Photo.vala"
			*scaled_image = _vala_scaled_image;
#line 23380 "Photo.c"
		}
#line 3065 "/home/jens/Source/shotwell/src/Photo.vala"
		if (scaled_to_viewport) {
#line 3065 "/home/jens/Source/shotwell/src/Photo.vala"
			*scaled_to_viewport = _vala_scaled_to_viewport;
#line 23386 "Photo.c"
		}
#line 3065 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 23390 "Photo.c"
	}
#line 3068 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = photo_get_orientation (self);
#line 3068 "/home/jens/Source/shotwell/src/Photo.vala"
	orientation = _tmp4_;
#line 3073 "/home/jens/Source/shotwell/src/Photo.vala"
	dimensions_init (&_vala_scaled_image, 0, 0);
#line 3074 "/home/jens/Source/shotwell/src/Photo.vala"
	dimensions_init (&_vala_scaled_to_viewport, 0, 0);
#line 3076 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = exceptions;
#line 3076 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = photo_exception_allows (_tmp5_, PHOTO_EXCEPTION_CROP);
#line 3076 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp6_) {
#line 23406 "Photo.c"
		Box crop = {0};
		Box _tmp7_ = {0};
		gboolean _tmp8_ = FALSE;
#line 3078 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = photo_get_raw_crop (self, &_tmp7_);
#line 3078 "/home/jens/Source/shotwell/src/Photo.vala"
		crop = _tmp7_;
#line 3078 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp8_) {
#line 23416 "Photo.c"
			Dimensions rotated_raw = {0};
			Dimensions _tmp9_ = {0};
			PhotoException _tmp10_ = 0;
			gboolean _tmp11_ = FALSE;
			Box scaled_crop = {0};
			Dimensions _tmp19_ = {0};
			Dimensions _tmp20_ = {0};
			Box _tmp21_ = {0};
			Dimensions _tmp22_ = {0};
			gboolean _tmp23_ = FALSE;
			gint _tmp24_ = 0;
			gint _tmp25_ = 0;
			Dimensions _tmp30_ = {0};
			Dimensions _tmp31_ = {0};
			Dimensions _tmp32_ = {0};
			PhotoException _tmp33_ = 0;
			gboolean _tmp34_ = FALSE;
#line 3081 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = raw;
#line 3081 "/home/jens/Source/shotwell/src/Photo.vala"
			rotated_raw = _tmp9_;
#line 3082 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = exceptions;
#line 3082 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = photo_exception_allows (_tmp10_, PHOTO_EXCEPTION_ORIENTATION);
#line 3082 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp11_) {
#line 23444 "Photo.c"
				Orientation _tmp12_ = 0;
				Dimensions _tmp13_ = {0};
				Box _tmp14_ = {0};
				Box _tmp15_ = {0};
				Orientation _tmp16_ = 0;
				Dimensions _tmp17_ = {0};
				Dimensions _tmp18_ = {0};
#line 3083 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = orientation;
#line 3083 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = raw;
#line 3083 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = crop;
#line 3083 "/home/jens/Source/shotwell/src/Photo.vala"
				orientation_rotate_box (_tmp12_, &_tmp13_, &_tmp14_, &_tmp15_);
#line 3083 "/home/jens/Source/shotwell/src/Photo.vala"
				crop = _tmp15_;
#line 3084 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = orientation;
#line 3084 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp17_ = raw;
#line 3084 "/home/jens/Source/shotwell/src/Photo.vala"
				orientation_rotate_dimensions (_tmp16_, &_tmp17_, &_tmp18_);
#line 3084 "/home/jens/Source/shotwell/src/Photo.vala"
				rotated_raw = _tmp18_;
#line 23470 "Photo.c"
			}
#line 3088 "/home/jens/Source/shotwell/src/Photo.vala"
			box_get_dimensions (&crop, &_tmp19_);
#line 3088 "/home/jens/Source/shotwell/src/Photo.vala"
			scaling_get_scaled_dimensions (scaling, &_tmp19_, &_tmp20_);
#line 3088 "/home/jens/Source/shotwell/src/Photo.vala"
			box_get_scaled (&crop, &_tmp20_, &_tmp21_);
#line 3088 "/home/jens/Source/shotwell/src/Photo.vala"
			scaled_crop = _tmp21_;
#line 3091 "/home/jens/Source/shotwell/src/Photo.vala"
			box_get_dimensions (&scaled_crop, &_tmp22_);
#line 3091 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_scaled_to_viewport = _tmp22_;
#line 3094 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp24_ = box_get_width (&crop);
#line 3094 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp25_ = box_get_width (&scaled_crop);
#line 3094 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp24_ <= _tmp25_) {
#line 23490 "Photo.c"
				gint _tmp26_ = 0;
				gint _tmp27_ = 0;
#line 3095 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp26_ = box_get_height (&crop);
#line 3095 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp27_ = box_get_height (&scaled_crop);
#line 3095 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp23_ = _tmp26_ <= _tmp27_;
#line 23499 "Photo.c"
			} else {
#line 3094 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp23_ = FALSE;
#line 23503 "Photo.c"
			}
#line 3094 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp23_) {
#line 23507 "Photo.c"
				Dimensions _tmp28_ = {0};
				Dimensions _tmp29_ = {0};
#line 3096 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp28_ = raw;
#line 3096 "/home/jens/Source/shotwell/src/Photo.vala"
				_vala_scaled_image = _tmp28_;
#line 3097 "/home/jens/Source/shotwell/src/Photo.vala"
				box_get_dimensions (&crop, &_tmp29_);
#line 3097 "/home/jens/Source/shotwell/src/Photo.vala"
				_vala_scaled_to_viewport = _tmp29_;
#line 3099 "/home/jens/Source/shotwell/src/Photo.vala"
				result = FALSE;
#line 3099 "/home/jens/Source/shotwell/src/Photo.vala"
				if (scaled_image) {
#line 3099 "/home/jens/Source/shotwell/src/Photo.vala"
					*scaled_image = _vala_scaled_image;
#line 23524 "Photo.c"
				}
#line 3099 "/home/jens/Source/shotwell/src/Photo.vala"
				if (scaled_to_viewport) {
#line 3099 "/home/jens/Source/shotwell/src/Photo.vala"
					*scaled_to_viewport = _vala_scaled_to_viewport;
#line 23530 "Photo.c"
				}
#line 3099 "/home/jens/Source/shotwell/src/Photo.vala"
				return result;
#line 23534 "Photo.c"
			}
#line 3104 "/home/jens/Source/shotwell/src/Photo.vala"
			box_get_dimensions (&crop, &_tmp30_);
#line 3104 "/home/jens/Source/shotwell/src/Photo.vala"
			box_get_dimensions (&scaled_crop, &_tmp31_);
#line 3104 "/home/jens/Source/shotwell/src/Photo.vala"
			dimensions_get_scaled_similar (&rotated_raw, &_tmp30_, &_tmp31_, &_tmp32_);
#line 3104 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_scaled_image = _tmp32_;
#line 3108 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp33_ = exceptions;
#line 3108 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp34_ = photo_exception_allows (_tmp33_, PHOTO_EXCEPTION_ORIENTATION);
#line 3108 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp34_) {
#line 23550 "Photo.c"
				Orientation _tmp35_ = 0;
				Dimensions _tmp36_ = {0};
				Dimensions _tmp37_ = {0};
#line 3109 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp35_ = orientation;
#line 3109 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp36_ = _vala_scaled_image;
#line 3109 "/home/jens/Source/shotwell/src/Photo.vala"
				orientation_derotate_dimensions (_tmp35_, &_tmp36_, &_tmp37_);
#line 3109 "/home/jens/Source/shotwell/src/Photo.vala"
				_vala_scaled_image = _tmp37_;
#line 23562 "Photo.c"
			}
		}
	}
#line 3114 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp38_ = dimensions_has_area (&_vala_scaled_image);
#line 3114 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp38_) {
#line 23570 "Photo.c"
		Dimensions rotated_raw = {0};
		Dimensions _tmp39_ = {0};
		PhotoException _tmp40_ = 0;
		gboolean _tmp41_ = FALSE;
		Dimensions _tmp45_ = {0};
		Dimensions _tmp46_ = {0};
		Dimensions _tmp47_ = {0};
		PhotoException _tmp48_ = 0;
		gboolean _tmp49_ = FALSE;
#line 3116 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp39_ = raw;
#line 3116 "/home/jens/Source/shotwell/src/Photo.vala"
		rotated_raw = _tmp39_;
#line 3117 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp40_ = exceptions;
#line 3117 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp41_ = photo_exception_allows (_tmp40_, PHOTO_EXCEPTION_ORIENTATION);
#line 3117 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp41_) {
#line 23590 "Photo.c"
			Orientation _tmp42_ = 0;
			Dimensions _tmp43_ = {0};
			Dimensions _tmp44_ = {0};
#line 3118 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp42_ = orientation;
#line 3118 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp43_ = raw;
#line 3118 "/home/jens/Source/shotwell/src/Photo.vala"
			orientation_rotate_dimensions (_tmp42_, &_tmp43_, &_tmp44_);
#line 3118 "/home/jens/Source/shotwell/src/Photo.vala"
			rotated_raw = _tmp44_;
#line 23602 "Photo.c"
		}
#line 3120 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp45_ = rotated_raw;
#line 3120 "/home/jens/Source/shotwell/src/Photo.vala"
		scaling_get_scaled_dimensions (scaling, &_tmp45_, &_tmp46_);
#line 3120 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_scaled_image = _tmp46_;
#line 3121 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp47_ = _vala_scaled_image;
#line 3121 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_scaled_to_viewport = _tmp47_;
#line 3124 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp48_ = exceptions;
#line 3124 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp49_ = photo_exception_allows (_tmp48_, PHOTO_EXCEPTION_ORIENTATION);
#line 3124 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp49_) {
#line 23620 "Photo.c"
			Orientation _tmp50_ = 0;
			Dimensions _tmp51_ = {0};
			Dimensions _tmp52_ = {0};
#line 3125 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp50_ = orientation;
#line 3125 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp51_ = _vala_scaled_image;
#line 3125 "/home/jens/Source/shotwell/src/Photo.vala"
			orientation_derotate_dimensions (_tmp50_, &_tmp51_, &_tmp52_);
#line 3125 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_scaled_image = _tmp52_;
#line 23632 "Photo.c"
		}
	}
#line 3129 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp54_ = _vala_scaled_image;
#line 3129 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp55_ = _tmp54_.width;
#line 3129 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp56_ = raw;
#line 3129 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp57_ = _tmp56_.width;
#line 3129 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp55_ >= _tmp57_) {
#line 23645 "Photo.c"
		Dimensions _tmp58_ = {0};
		gint _tmp59_ = 0;
		Dimensions _tmp60_ = {0};
		gint _tmp61_ = 0;
#line 3129 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp58_ = _vala_scaled_image;
#line 3129 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp59_ = _tmp58_.height;
#line 3129 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp60_ = raw;
#line 3129 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp61_ = _tmp60_.height;
#line 3129 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp53_ = _tmp59_ >= _tmp61_;
#line 23660 "Photo.c"
	} else {
#line 3129 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp53_ = FALSE;
#line 23664 "Photo.c"
	}
#line 3129 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp53_) {
#line 23668 "Photo.c"
		Dimensions _tmp62_ = {0};
#line 3130 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp62_ = raw;
#line 3130 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_scaled_image = _tmp62_;
#line 3132 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 3132 "/home/jens/Source/shotwell/src/Photo.vala"
		if (scaled_image) {
#line 3132 "/home/jens/Source/shotwell/src/Photo.vala"
			*scaled_image = _vala_scaled_image;
#line 23680 "Photo.c"
		}
#line 3132 "/home/jens/Source/shotwell/src/Photo.vala"
		if (scaled_to_viewport) {
#line 3132 "/home/jens/Source/shotwell/src/Photo.vala"
			*scaled_to_viewport = _vala_scaled_to_viewport;
#line 23686 "Photo.c"
		}
#line 3132 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 23690 "Photo.c"
	}
#line 3135 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp63_ = dimensions_has_area (&_vala_scaled_image);
#line 3135 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_assert (_tmp63_, "scaled_image.has_area()");
#line 3136 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp64_ = dimensions_has_area (&_vala_scaled_to_viewport);
#line 3136 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_assert (_tmp64_, "scaled_to_viewport.has_area()");
#line 3138 "/home/jens/Source/shotwell/src/Photo.vala"
	result = TRUE;
#line 3138 "/home/jens/Source/shotwell/src/Photo.vala"
	if (scaled_image) {
#line 3138 "/home/jens/Source/shotwell/src/Photo.vala"
		*scaled_image = _vala_scaled_image;
#line 23706 "Photo.c"
	}
#line 3138 "/home/jens/Source/shotwell/src/Photo.vala"
	if (scaled_to_viewport) {
#line 3138 "/home/jens/Source/shotwell/src/Photo.vala"
		*scaled_to_viewport = _vala_scaled_to_viewport;
#line 23712 "Photo.c"
	}
#line 3138 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 23716 "Photo.c"
}


static GdkPixbuf* photo_load_raw_pixbuf (Photo* self, Scaling* scaling, PhotoException exceptions, BackingFetchMode fetch_mode, GError** error) {
	GdkPixbuf* result = NULL;
	PhotoFileReader* loader = NULL;
	BackingFetchMode _tmp0_ = 0;
	PhotoFileReader* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	Dimensions scaled_image = {0};
	Dimensions scaled_to_viewport = {0};
	gboolean is_scaled = FALSE;
	Scaling _tmp7_ = {0};
	PhotoException _tmp8_ = 0;
	Dimensions _tmp9_ = {0};
	Dimensions _tmp10_ = {0};
	gboolean _tmp11_ = FALSE;
	gboolean _tmp12_ = FALSE;
	GdkPixbuf* pixbuf = NULL;
	PhotoFileReader* _tmp17_ = NULL;
	Dimensions _tmp18_ = {0};
	Dimensions _tmp19_ = {0};
	GdkPixbuf* _tmp20_ = NULL;
	GdkPixbuf* _tmp21_ = NULL;
	Dimensions _tmp22_ = {0};
	gboolean _tmp23_ = FALSE;
	GError * _inner_error_ = NULL;
#line 3144 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 3144 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (scaling != NULL, NULL);
#line 3147 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = fetch_mode;
#line 3147 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = photo_get_backing_reader (self, _tmp0_);
#line 3147 "/home/jens/Source/shotwell/src/Photo.vala"
	loader = _tmp1_;
#line 3150 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = scaling_is_unscaled (scaling);
#line 3150 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp2_) {
#line 23758 "Photo.c"
		GdkPixbuf* _tmp3_ = NULL;
		PhotoFileReader* _tmp4_ = NULL;
		GdkPixbuf* _tmp5_ = NULL;
		GdkPixbuf* _tmp6_ = NULL;
#line 3155 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = loader;
#line 3155 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = photo_file_reader_unscaled_read (_tmp4_, &_inner_error_);
#line 3155 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = _tmp5_;
#line 3155 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3155 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 3155 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_adapter_unref0 (loader);
#line 3155 "/home/jens/Source/shotwell/src/Photo.vala"
			return NULL;
#line 23777 "Photo.c"
		}
#line 3155 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = _tmp3_;
#line 3155 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = NULL;
#line 3155 "/home/jens/Source/shotwell/src/Photo.vala"
		result = _tmp6_;
#line 3155 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp3_);
#line 3155 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (loader);
#line 3155 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 23791 "Photo.c"
	}
#line 3160 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = *scaling;
#line 3160 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = exceptions;
#line 3160 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = photo_calculate_pixbuf_dimensions (self, &_tmp7_, _tmp8_, &_tmp9_, &_tmp10_);
#line 3160 "/home/jens/Source/shotwell/src/Photo.vala"
	scaled_image = _tmp9_;
#line 3160 "/home/jens/Source/shotwell/src/Photo.vala"
	scaled_to_viewport = _tmp10_;
#line 3160 "/home/jens/Source/shotwell/src/Photo.vala"
	is_scaled = _tmp11_;
#line 3162 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = is_scaled;
#line 3162 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp12_) {
#line 23809 "Photo.c"
		GdkPixbuf* _tmp13_ = NULL;
		PhotoFileReader* _tmp14_ = NULL;
		GdkPixbuf* _tmp15_ = NULL;
		GdkPixbuf* _tmp16_ = NULL;
#line 3167 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp14_ = loader;
#line 3167 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp15_ = photo_file_reader_unscaled_read (_tmp14_, &_inner_error_);
#line 3167 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp13_ = _tmp15_;
#line 3167 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3167 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 3167 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_adapter_unref0 (loader);
#line 3167 "/home/jens/Source/shotwell/src/Photo.vala"
			return NULL;
#line 23828 "Photo.c"
		}
#line 3167 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = _tmp13_;
#line 3167 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp13_ = NULL;
#line 3167 "/home/jens/Source/shotwell/src/Photo.vala"
		result = _tmp16_;
#line 3167 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp13_);
#line 3167 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (loader);
#line 3167 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 23842 "Photo.c"
	}
#line 3170 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = loader;
#line 3170 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_get_raw_dimensions (self, &_tmp18_);
#line 3170 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp19_ = scaled_image;
#line 3170 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp20_ = photo_file_reader_scaled_read (_tmp17_, &_tmp18_, &_tmp19_, &_inner_error_);
#line 3170 "/home/jens/Source/shotwell/src/Photo.vala"
	pixbuf = _tmp20_;
#line 3170 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3170 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3170 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (loader);
#line 3170 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 23862 "Photo.c"
	}
#line 3178 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp21_ = pixbuf;
#line 3178 "/home/jens/Source/shotwell/src/Photo.vala"
	dimensions_for_pixbuf (_tmp21_, &_tmp22_);
#line 3178 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp23_ = dimensions_approx_equals (&scaled_image, &_tmp22_, PHOTO_SCALING_FUDGE);
#line 3178 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_assert (_tmp23_, "scaled_image.approx_equals(Dimensions.for_pixbuf(pixbuf), SCALING_FUDGE)");
#line 3180 "/home/jens/Source/shotwell/src/Photo.vala"
	result = pixbuf;
#line 3180 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (loader);
#line 3180 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 23878 "Photo.c"
}


GdkPixbuf* photo_get_master_pixbuf (Photo* self, Scaling* scaling, gboolean rotate, GError** error) {
	GdkPixbuf* result = NULL;
	GdkPixbuf* _tmp0_ = NULL;
	Scaling _tmp1_ = {0};
	gboolean _tmp2_ = FALSE;
	GdkPixbuf* _tmp3_ = NULL;
	GdkPixbuf* _tmp4_ = NULL;
	GError * _inner_error_ = NULL;
#line 3185 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 3185 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (scaling != NULL, NULL);
#line 3186 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = *scaling;
#line 3186 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = rotate;
#line 3186 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = photo_get_untransformed_pixbuf (self, &_tmp1_, _tmp2_, BACKING_FETCH_MODE_MASTER, &_inner_error_);
#line 3186 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = _tmp3_;
#line 3186 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3186 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3186 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 23908 "Photo.c"
	}
#line 3186 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = _tmp0_;
#line 3186 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = NULL;
#line 3186 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp4_;
#line 3186 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp0_);
#line 3186 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 23920 "Photo.c"
}


GdkPixbuf* photo_get_unmodified_pixbuf (Photo* self, Scaling* scaling, gboolean rotate, GError** error) {
	GdkPixbuf* result = NULL;
	GdkPixbuf* _tmp0_ = NULL;
	Scaling _tmp1_ = {0};
	gboolean _tmp2_ = FALSE;
	GdkPixbuf* _tmp3_ = NULL;
	GdkPixbuf* _tmp4_ = NULL;
	GError * _inner_error_ = NULL;
#line 3190 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 3190 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (scaling != NULL, NULL);
#line 3191 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = *scaling;
#line 3191 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = rotate;
#line 3191 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = photo_get_untransformed_pixbuf (self, &_tmp1_, _tmp2_, BACKING_FETCH_MODE_UNMODIFIED, &_inner_error_);
#line 3191 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = _tmp3_;
#line 3191 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3191 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3191 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 23950 "Photo.c"
	}
#line 3191 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = _tmp0_;
#line 3191 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = NULL;
#line 3191 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp4_;
#line 3191 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp0_);
#line 3191 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 23962 "Photo.c"
}


static GdkPixbuf* photo_get_untransformed_pixbuf (Photo* self, Scaling* scaling, gboolean rotate, BackingFetchMode fetch_mode, GError** error) {
	GdkPixbuf* result = NULL;
	Dimensions scaled_image = {0};
	Dimensions scaled_to_viewport = {0};
	Orientation original_orientation = 0;
	GdkPixbuf* pixbuf = NULL;
	Scaling _tmp6_ = {0};
	BackingFetchMode _tmp7_ = 0;
	GdkPixbuf* _tmp8_ = NULL;
	gboolean _tmp9_ = FALSE;
	GError * _inner_error_ = NULL;
#line 3195 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 3195 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (scaling != NULL, NULL);
#line 23981 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 3209 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 3209 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 23988 "Photo.c"
		{
			Scaling _tmp1_ = {0};
			Dimensions _tmp2_ = {0};
			Dimensions _tmp3_ = {0};
			Orientation _tmp4_ = 0;
#line 3210 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = *scaling;
#line 3210 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_calculate_pixbuf_dimensions (self, &_tmp1_, PHOTO_EXCEPTION_NONE, &_tmp2_, &_tmp3_);
#line 3210 "/home/jens/Source/shotwell/src/Photo.vala"
			scaled_image = _tmp2_;
#line 3210 "/home/jens/Source/shotwell/src/Photo.vala"
			scaled_to_viewport = _tmp3_;
#line 3212 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = photo_get_original_orientation (self);
#line 3212 "/home/jens/Source/shotwell/src/Photo.vala"
			original_orientation = _tmp4_;
#line 24006 "Photo.c"
		}
		__finally383:
		{
			PhotoRow* _tmp5_ = NULL;
#line 3209 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = self->row;
#line 3209 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 24015 "Photo.c"
		}
#line 3209 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3209 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 3209 "/home/jens/Source/shotwell/src/Photo.vala"
			return NULL;
#line 24023 "Photo.c"
		}
	}
#line 3216 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = *scaling;
#line 3216 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = fetch_mode;
#line 3216 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = photo_load_raw_pixbuf (self, &_tmp6_, PHOTO_EXCEPTION_NONE, _tmp7_, &_inner_error_);
#line 3216 "/home/jens/Source/shotwell/src/Photo.vala"
	pixbuf = _tmp8_;
#line 3216 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3216 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3216 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 24040 "Photo.c"
	}
#line 3222 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = rotate;
#line 3222 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp9_) {
#line 24046 "Photo.c"
		GdkPixbuf* _tmp10_ = NULL;
		GdkPixbuf* _tmp11_ = NULL;
#line 3223 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp10_ = pixbuf;
#line 3223 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = orientation_rotate_pixbuf (original_orientation, _tmp10_);
#line 3223 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (pixbuf);
#line 3223 "/home/jens/Source/shotwell/src/Photo.vala"
		pixbuf = _tmp11_;
#line 24057 "Photo.c"
	}
#line 3232 "/home/jens/Source/shotwell/src/Photo.vala"
	result = pixbuf;
#line 3232 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 24063 "Photo.c"
}


static GdkPixbuf* photo_real_get_pixbuf (PhotoSource* base, Scaling* scaling, GError** error) {
	Photo * self;
	GdkPixbuf* result = NULL;
	GdkPixbuf* _tmp0_ = NULL;
	Scaling _tmp1_ = {0};
	GdkPixbuf* _tmp2_ = NULL;
	GdkPixbuf* _tmp3_ = NULL;
	GError * _inner_error_ = NULL;
#line 3235 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO, Photo);
#line 3235 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (scaling != NULL, NULL);
#line 3236 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = *scaling;
#line 3236 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_get_pixbuf_with_options (self, &_tmp1_, PHOTO_EXCEPTION_NONE, BACKING_FETCH_MODE_BASELINE, &_inner_error_);
#line 3236 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = _tmp2_;
#line 3236 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3236 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3236 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 24091 "Photo.c"
	}
#line 3236 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp0_;
#line 3236 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = NULL;
#line 3236 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp3_;
#line 3236 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp0_);
#line 3236 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 24103 "Photo.c"
}


/**
     * One-stop shopping for the source pixbuf cache.
     *
     * The source pixbuf cache holds untransformed, unscaled (full-sized) pixbufs of Photo objects.
     * These can be rather large and shouldn't be held in memory for too long, nor should many be
     * allowed to stack up.
     *
     * If locate is non-null, a source pixbuf is returned for the Photo.  If keep is true, the
     * pixbuf is stored in the cache.  (Thus, passing a Photo w/ keep == false will drop the cached
     * pixbuf.)  If Photo is non-null but keep is false, null is returned.
     *
     * Whether locate is null or not, the cache is walked in its entirety, dropping expired pixbufs
     * and dropping excessive pixbufs from the LRU.  Locating a Photo "touches" the pixbuf, i.e.
     * it moves to the head of the LRU.
     */
static gpointer _photo_cached_pixbuf_ref0 (gpointer self) {
#line 3271 "/home/jens/Source/shotwell/src/Photo.vala"
	return self ? photo_cached_pixbuf_ref (self) : NULL;
#line 24125 "Photo.c"
}


static gboolean _photo_trim_source_pixbuf_cache_gsource_func (gpointer self) {
	gboolean result;
	result = photo_trim_source_pixbuf_cache ();
#line 3323 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 24134 "Photo.c"
}


static GdkPixbuf* photo_run_source_pixbuf_cache (Photo* locate, gboolean keep, GError** error) {
	GdkPixbuf* result = NULL;
	GError * _inner_error_ = NULL;
#line 3254 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail ((locate == NULL) || IS_PHOTO (locate), NULL);
#line 24143 "Photo.c"
	{
		GeeLinkedList* _tmp0_ = NULL;
#line 3255 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = photo_source_pixbuf_cache;
#line 3255 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&__lock_photo_source_pixbuf_cache);
#line 24150 "Photo.c"
		{
			PhotoCachedPixbuf* found = NULL;
			gdouble min_elapsed = 0.0;
			gint count = 0;
			GeeIterator* iter = NULL;
			GeeLinkedList* _tmp1_ = NULL;
			GeeIterator* _tmp2_ = NULL;
			gboolean _tmp29_ = FALSE;
			gboolean _tmp30_ = FALSE;
			PhotoCachedPixbuf* _tmp31_ = NULL;
			gboolean _tmp43_ = FALSE;
			PhotoCachedPixbuf* _tmp44_ = NULL;
			guint _tmp59_ = 0U;
			GeeLinkedList* _tmp61_ = NULL;
			gint _tmp62_ = 0;
			gint _tmp63_ = 0;
			GdkPixbuf* _tmp69_ = NULL;
			PhotoCachedPixbuf* _tmp70_ = NULL;
			GdkPixbuf* _tmp73_ = NULL;
#line 3256 "/home/jens/Source/shotwell/src/Photo.vala"
			found = NULL;
#line 3260 "/home/jens/Source/shotwell/src/Photo.vala"
			min_elapsed = DBL_MAX;
#line 3261 "/home/jens/Source/shotwell/src/Photo.vala"
			count = 0;
#line 3262 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = photo_source_pixbuf_cache;
#line 3262 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = gee_abstract_collection_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
#line 3262 "/home/jens/Source/shotwell/src/Photo.vala"
			iter = _tmp2_;
#line 3263 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 24184 "Photo.c"
				GeeIterator* _tmp3_ = NULL;
				gboolean _tmp4_ = FALSE;
				PhotoCachedPixbuf* cached_pixbuf = NULL;
				GeeIterator* _tmp5_ = NULL;
				gpointer _tmp6_ = NULL;
				gdouble elapsed = 0.0;
				PhotoCachedPixbuf* _tmp7_ = NULL;
				GTimer* _tmp8_ = NULL;
				gdouble _tmp9_ = 0.0;
				gdouble _tmp10_ = 0.0;
				gboolean _tmp11_ = FALSE;
				Photo* _tmp12_ = NULL;
#line 3263 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = iter;
#line 3263 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = gee_iterator_next (_tmp3_);
#line 3263 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp4_) {
#line 3263 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 24205 "Photo.c"
				}
#line 3264 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = iter;
#line 3264 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = gee_iterator_get (_tmp5_);
#line 3264 "/home/jens/Source/shotwell/src/Photo.vala"
				cached_pixbuf = (PhotoCachedPixbuf*) _tmp6_;
#line 3266 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = cached_pixbuf;
#line 3266 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = _tmp7_->last_touched;
#line 3266 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = g_timer_elapsed (_tmp8_, NULL);
#line 3266 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = trunc (_tmp9_);
#line 3266 "/home/jens/Source/shotwell/src/Photo.vala"
				elapsed = _tmp10_ + 1;
#line 3268 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = locate;
#line 3268 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp12_ != NULL) {
#line 24227 "Photo.c"
					PhotoCachedPixbuf* _tmp13_ = NULL;
					Photo* _tmp14_ = NULL;
					Photo* _tmp15_ = NULL;
					gboolean _tmp16_ = FALSE;
#line 3268 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp13_ = cached_pixbuf;
#line 3268 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp14_ = _tmp13_->photo;
#line 3268 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp15_ = locate;
#line 3268 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp16_ = data_source_equals (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, TYPE_DATA_SOURCE, DataSource), G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, TYPE_DATA_SOURCE, DataSource));
#line 3268 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp11_ = _tmp16_;
#line 24242 "Photo.c"
				} else {
#line 3268 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp11_ = FALSE;
#line 24246 "Photo.c"
				}
#line 3268 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp11_) {
#line 24250 "Photo.c"
					GeeIterator* _tmp17_ = NULL;
					PhotoCachedPixbuf* _tmp18_ = NULL;
					PhotoCachedPixbuf* _tmp19_ = NULL;
					gint _tmp20_ = 0;
#line 3270 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp17_ = iter;
#line 3270 "/home/jens/Source/shotwell/src/Photo.vala"
					gee_iterator_remove (_tmp17_);
#line 3271 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp18_ = cached_pixbuf;
#line 3271 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp19_ = _photo_cached_pixbuf_ref0 (_tmp18_);
#line 3271 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_cached_pixbuf_unref0 (found);
#line 3271 "/home/jens/Source/shotwell/src/Photo.vala"
					found = _tmp19_;
#line 3274 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp20_ = count;
#line 3274 "/home/jens/Source/shotwell/src/Photo.vala"
					count = _tmp20_ + 1;
#line 24271 "Photo.c"
				} else {
					gdouble _tmp21_ = 0.0;
#line 3275 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp21_ = elapsed;
#line 3275 "/home/jens/Source/shotwell/src/Photo.vala"
					if (_tmp21_ >= ((gdouble) PHOTO_SOURCE_PIXBUF_TIME_TO_LIVE_SEC)) {
#line 24278 "Photo.c"
						GeeIterator* _tmp22_ = NULL;
#line 3276 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp22_ = iter;
#line 3276 "/home/jens/Source/shotwell/src/Photo.vala"
						gee_iterator_remove (_tmp22_);
#line 24284 "Photo.c"
					} else {
						gint _tmp23_ = 0;
#line 3277 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp23_ = count;
#line 3277 "/home/jens/Source/shotwell/src/Photo.vala"
						if (_tmp23_ >= PHOTO_SOURCE_PIXBUF_MAX_LRU_COUNT) {
#line 24291 "Photo.c"
							GeeIterator* _tmp24_ = NULL;
#line 3278 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp24_ = iter;
#line 3278 "/home/jens/Source/shotwell/src/Photo.vala"
							gee_iterator_remove (_tmp24_);
#line 24297 "Photo.c"
						} else {
							gdouble _tmp25_ = 0.0;
							gdouble _tmp26_ = 0.0;
							gdouble _tmp27_ = 0.0;
							gint _tmp28_ = 0;
#line 3282 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp25_ = elapsed;
#line 3282 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp26_ = min_elapsed;
#line 3282 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp27_ = MIN (_tmp25_, _tmp26_);
#line 3282 "/home/jens/Source/shotwell/src/Photo.vala"
							min_elapsed = _tmp27_;
#line 3283 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp28_ = count;
#line 3283 "/home/jens/Source/shotwell/src/Photo.vala"
							count = _tmp28_ + 1;
#line 24315 "Photo.c"
						}
					}
				}
#line 3263 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_cached_pixbuf_unref0 (cached_pixbuf);
#line 24321 "Photo.c"
			}
#line 3288 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp31_ = found;
#line 3288 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp31_ == NULL) {
#line 24327 "Photo.c"
				Photo* _tmp32_ = NULL;
#line 3288 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp32_ = locate;
#line 3288 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp30_ = _tmp32_ != NULL;
#line 24333 "Photo.c"
			} else {
#line 3288 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp30_ = FALSE;
#line 24337 "Photo.c"
			}
#line 3288 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp30_) {
#line 24341 "Photo.c"
				gboolean _tmp33_ = FALSE;
#line 3288 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp33_ = keep;
#line 3288 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp29_ = _tmp33_;
#line 24347 "Photo.c"
			} else {
#line 3288 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp29_ = FALSE;
#line 24351 "Photo.c"
			}
#line 3288 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp29_) {
#line 24355 "Photo.c"
				GdkPixbuf* _tmp34_ = NULL;
				Photo* _tmp35_ = NULL;
				Scaling _tmp36_ = {0};
				GdkPixbuf* _tmp37_ = NULL;
				Photo* _tmp38_ = NULL;
				PhotoCachedPixbuf* _tmp39_ = NULL;
#line 3290 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp35_ = locate;
#line 3290 "/home/jens/Source/shotwell/src/Photo.vala"
				scaling_for_original (&_tmp36_);
#line 3290 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp37_ = photo_load_raw_pixbuf (_tmp35_, &_tmp36_, PHOTO_EXCEPTION_ALL, BACKING_FETCH_MODE_SOURCE, &_inner_error_);
#line 3290 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp34_ = _tmp37_;
#line 3290 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3290 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (iter);
#line 3290 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_cached_pixbuf_unref0 (found);
#line 24376 "Photo.c"
					goto __finally384;
				}
#line 3289 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp38_ = locate;
#line 3289 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp39_ = photo_cached_pixbuf_new (_tmp38_, _tmp34_);
#line 3289 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_cached_pixbuf_unref0 (found);
#line 3289 "/home/jens/Source/shotwell/src/Photo.vala"
				found = _tmp39_;
#line 3288 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (_tmp34_);
#line 24389 "Photo.c"
			} else {
				PhotoCachedPixbuf* _tmp40_ = NULL;
#line 3291 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp40_ = found;
#line 3291 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp40_ != NULL) {
#line 24396 "Photo.c"
					PhotoCachedPixbuf* _tmp41_ = NULL;
					GTimer* _tmp42_ = NULL;
#line 3293 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp41_ = found;
#line 3293 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp42_ = _tmp41_->last_touched;
#line 3293 "/home/jens/Source/shotwell/src/Photo.vala"
					g_timer_start (_tmp42_);
#line 24405 "Photo.c"
				}
			}
#line 3297 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp44_ = found;
#line 3297 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp44_ != NULL) {
#line 24412 "Photo.c"
				gboolean _tmp45_ = FALSE;
#line 3297 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp45_ = keep;
#line 3297 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp43_ = _tmp45_;
#line 24418 "Photo.c"
			} else {
#line 3297 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp43_ = FALSE;
#line 24422 "Photo.c"
			}
#line 3297 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp43_) {
#line 24426 "Photo.c"
				GeeLinkedList* _tmp46_ = NULL;
				PhotoCachedPixbuf* _tmp47_ = NULL;
				PhotoCachedPixbuf* _tmp48_ = NULL;
				GTimer* _tmp49_ = NULL;
				gdouble _tmp50_ = 0.0;
				gdouble _tmp51_ = 0.0;
				gdouble _tmp52_ = 0.0;
#line 3298 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp46_ = photo_source_pixbuf_cache;
#line 3298 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp47_ = found;
#line 3298 "/home/jens/Source/shotwell/src/Photo.vala"
				gee_abstract_list_insert (G_TYPE_CHECK_INSTANCE_CAST (_tmp46_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), 0, _tmp47_);
#line 3303 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp48_ = found;
#line 3303 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp49_ = _tmp48_->last_touched;
#line 3303 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp50_ = g_timer_elapsed (_tmp49_, NULL);
#line 3303 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp51_ = min_elapsed;
#line 3303 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp52_ = MIN (_tmp50_, _tmp51_);
#line 3303 "/home/jens/Source/shotwell/src/Photo.vala"
				min_elapsed = _tmp52_;
#line 3307 "/home/jens/Source/shotwell/src/Photo.vala"
				while (TRUE) {
#line 24454 "Photo.c"
					GeeLinkedList* _tmp53_ = NULL;
					gint _tmp54_ = 0;
					gint _tmp55_ = 0;
					GeeLinkedList* _tmp56_ = NULL;
					gpointer _tmp57_ = NULL;
					PhotoCachedPixbuf* _tmp58_ = NULL;
#line 3307 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp53_ = photo_source_pixbuf_cache;
#line 3307 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp54_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
#line 3307 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp55_ = _tmp54_;
#line 3307 "/home/jens/Source/shotwell/src/Photo.vala"
					if (!(_tmp55_ > PHOTO_SOURCE_PIXBUF_MAX_LRU_COUNT)) {
#line 3307 "/home/jens/Source/shotwell/src/Photo.vala"
						break;
#line 24471 "Photo.c"
					}
#line 3308 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp56_ = photo_source_pixbuf_cache;
#line 3308 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp57_ = gee_deque_poll_tail (G_TYPE_CHECK_INSTANCE_CAST (_tmp56_, GEE_TYPE_DEQUE, GeeDeque));
#line 3308 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp58_ = (PhotoCachedPixbuf*) _tmp57_;
#line 3308 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_cached_pixbuf_unref0 (_tmp58_);
#line 24481 "Photo.c"
				}
			}
#line 3312 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp59_ = photo_discard_source_id;
#line 3312 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp59_ != ((guint) 0)) {
#line 24488 "Photo.c"
				guint _tmp60_ = 0U;
#line 3313 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp60_ = photo_discard_source_id;
#line 3313 "/home/jens/Source/shotwell/src/Photo.vala"
				g_source_remove (_tmp60_);
#line 3314 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_discard_source_id = (guint) 0;
#line 24496 "Photo.c"
			}
#line 3318 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp61_ = photo_source_pixbuf_cache;
#line 3318 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp62_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp61_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
#line 3318 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp63_ = _tmp62_;
#line 3318 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp63_ > PHOTO_SOURCE_PIXBUF_MIN_LRU_COUNT) {
#line 24506 "Photo.c"
				gdouble _tmp64_ = 0.0;
				guint retry_sec = 0U;
				gdouble _tmp65_ = 0.0;
				gdouble _tmp66_ = 0.0;
				guint _tmp67_ = 0U;
				guint _tmp68_ = 0U;
#line 3319 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp64_ = min_elapsed;
#line 3319 "/home/jens/Source/shotwell/src/Photo.vala"
				_vala_assert (_tmp64_ >= 0.0, "min_elapsed >= 0.0");
#line 3322 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp65_ = min_elapsed;
#line 3322 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp66_ = trunc (_tmp65_);
#line 3322 "/home/jens/Source/shotwell/src/Photo.vala"
				retry_sec = PHOTO_SOURCE_PIXBUF_TIME_TO_LIVE_SEC - ((guint) _tmp66_);
#line 3323 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp67_ = retry_sec;
#line 3323 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp68_ = g_timeout_add_seconds_full (G_PRIORITY_LOW, _tmp67_, _photo_trim_source_pixbuf_cache_gsource_func, NULL, NULL);
#line 3323 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_discard_source_id = _tmp68_;
#line 24529 "Photo.c"
			}
#line 3326 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp70_ = found;
#line 3326 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp70_ != NULL) {
#line 24535 "Photo.c"
				PhotoCachedPixbuf* _tmp71_ = NULL;
				GdkPixbuf* _tmp72_ = NULL;
#line 3326 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp71_ = found;
#line 3326 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp72_ = _tmp71_->pixbuf;
#line 3326 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp69_ = _tmp72_;
#line 24544 "Photo.c"
			} else {
#line 3326 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp69_ = NULL;
#line 24548 "Photo.c"
			}
#line 3326 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp73_ = _g_object_ref0 (_tmp69_);
#line 3326 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp73_;
#line 3326 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (iter);
#line 3326 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_cached_pixbuf_unref0 (found);
#line 24558 "Photo.c"
			{
				GeeLinkedList* _tmp74_ = NULL;
#line 3255 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp74_ = photo_source_pixbuf_cache;
#line 3255 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&__lock_photo_source_pixbuf_cache);
#line 24565 "Photo.c"
			}
#line 3326 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 24569 "Photo.c"
		}
		__finally384:
		{
			GeeLinkedList* _tmp75_ = NULL;
#line 3255 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp75_ = photo_source_pixbuf_cache;
#line 3255 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&__lock_photo_source_pixbuf_cache);
#line 24578 "Photo.c"
		}
#line 3255 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3255 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 24584 "Photo.c"
	}
}


static gboolean photo_trim_source_pixbuf_cache (void) {
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
	{
		GdkPixbuf* _tmp0_ = NULL;
		GdkPixbuf* _tmp1_ = NULL;
#line 3332 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = photo_run_source_pixbuf_cache (NULL, FALSE, &_inner_error_);
#line 3332 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = _tmp0_;
#line 3332 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp1_);
#line 3332 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 24603 "Photo.c"
			goto __catch385_g_error;
		}
	}
	goto __finally385;
	__catch385_g_error:
	{
		GError* err = NULL;
#line 3331 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 3331 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 3331 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 24617 "Photo.c"
	}
	__finally385:
#line 3331 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 24622 "Photo.c"
		gboolean _tmp2_ = FALSE;
#line 3331 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 3331 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 3331 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp2_;
#line 24630 "Photo.c"
	}
#line 3336 "/home/jens/Source/shotwell/src/Photo.vala"
	result = FALSE;
#line 3336 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 24636 "Photo.c"
}


/**
     * @brief Get a copy of what's in the cache.
     *
     * @return A copy of the Pixbuf with the image data from unmodified_precached.
     */
GdkPixbuf* photo_get_prefetched_copy (Photo* self, GError** error) {
	GdkPixbuf* result = NULL;
	GdkPixbuf* _tmp0_ = NULL;
	GdkPixbuf* _tmp1_ = NULL;
	GdkPixbuf* _tmp2_ = NULL;
	GdkPixbuf* _tmp3_ = NULL;
	GdkPixbuf* _tmp4_ = NULL;
	GdkPixbuf* _tmp5_ = NULL;
	GError * _inner_error_ = NULL;
#line 3344 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 3345 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = photo_run_source_pixbuf_cache (self, TRUE, &_inner_error_);
#line 3345 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = _tmp1_;
#line 3345 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3345 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3345 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 24666 "Photo.c"
	}
#line 3345 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = _tmp0_;
#line 3345 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = NULL;
#line 3345 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp2_;
#line 3345 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = gdk_pixbuf_copy (_tmp3_);
#line 3345 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = _tmp4_;
#line 3345 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp3_);
#line 3345 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp5_;
#line 3345 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp0_);
#line 3345 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 24686 "Photo.c"
}


/**
     * @brief Discards the cached version of the unmodified image.
     */
void photo_discard_prefetched (Photo* self) {
	GError * _inner_error_ = NULL;
#line 3351 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 24697 "Photo.c"
	{
		GdkPixbuf* _tmp0_ = NULL;
		GdkPixbuf* _tmp1_ = NULL;
#line 3353 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = photo_run_source_pixbuf_cache (self, FALSE, &_inner_error_);
#line 3353 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = _tmp0_;
#line 3353 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp1_);
#line 3353 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 24709 "Photo.c"
			goto __catch386_g_error;
		}
	}
	goto __finally386;
	__catch386_g_error:
	{
		GError* err = NULL;
#line 3352 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 3352 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 3352 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 24723 "Photo.c"
	}
	__finally386:
#line 3352 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3352 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 3352 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 3352 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 24734 "Photo.c"
	}
}


/**
     * @brief Returns a fully transformed and scaled pixbuf.  Transformations may be excluded via
     * the mask. If the image is smaller than the scaling, it will be returned in its actual size.
     * The caller is responsible for scaling thereafter.
     *
     * @param scaling A scaling object that describes the size the output pixbuf should be.
     * @param exceptions The parts of the pipeline that should be skipped; defaults to NONE if
     *      left unset.
     * @param fetch_mode The fetch mode; if left unset, defaults to BASELINE so that
     *      we get the image exactly as it is in the file.
     */
GdkPixbuf* photo_get_pixbuf_with_options (Photo* self, Scaling* scaling, PhotoException exceptions, BackingFetchMode fetch_mode, GError** error) {
	GdkPixbuf* result = NULL;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	gboolean is_scaled = FALSE;
	gboolean is_cropped = FALSE;
	gboolean is_straightened = FALSE;
	Dimensions scaled_to_viewport = {0};
	Dimensions original = {0};
	Dimensions scaled = {0};
	EditingToolsRedeyeInstance* redeye_instances = NULL;
	gint redeye_instances_length1 = 0;
	gint _redeye_instances_size_ = 0;
	Box crop = {0};
	gdouble straightening_angle = 0.0;
	PixelTransformer* transformer = NULL;
	Orientation orientation = 0;
	GdkPixbuf* pixbuf = NULL;
	GdkPixbuf* _tmp33_ = NULL;
	PhotoException _tmp34_ = 0;
	gboolean _tmp35_ = FALSE;
	PhotoException _tmp40_ = 0;
	gboolean _tmp41_ = FALSE;
	PhotoException _tmp46_ = 0;
	gboolean _tmp47_ = FALSE;
	PhotoException _tmp85_ = 0;
	gboolean _tmp86_ = FALSE;
	gboolean _tmp89_ = FALSE;
	PhotoException _tmp96_ = 0;
	gboolean _tmp97_ = FALSE;
	gboolean _tmp101_ = FALSE;
	gboolean _tmp102_ = FALSE;
	GError * _inner_error_ = NULL;
#line 3369 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 3369 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (scaling != NULL, NULL);
#line 3382 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = photo_get_develop_raw_photos_to_files ();
#line 3382 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = _tmp3_;
#line 3382 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp4_) {
#line 24796 "Photo.c"
		PhotoFileFormat _tmp5_ = 0;
#line 3383 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = photo_get_master_file_format (self);
#line 3383 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = _tmp5_ == PHOTO_FILE_FORMAT_RAW;
#line 24802 "Photo.c"
	} else {
#line 3382 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = FALSE;
#line 24806 "Photo.c"
	}
#line 3382 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp2_) {
#line 24810 "Photo.c"
		gboolean _tmp6_ = FALSE;
		gboolean _tmp7_ = FALSE;
		BackingFetchMode _tmp8_ = 0;
#line 3384 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = fetch_mode;
#line 3384 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp8_ == BACKING_FETCH_MODE_BASELINE) {
#line 3384 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = TRUE;
#line 24820 "Photo.c"
		} else {
			BackingFetchMode _tmp9_ = 0;
#line 3384 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = fetch_mode;
#line 3384 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = _tmp9_ == BACKING_FETCH_MODE_UNMODIFIED;
#line 24827 "Photo.c"
		}
#line 3384 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp7_) {
#line 3384 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = TRUE;
#line 24833 "Photo.c"
		} else {
			BackingFetchMode _tmp10_ = 0;
#line 3385 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = fetch_mode;
#line 3385 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = _tmp10_ == BACKING_FETCH_MODE_SOURCE;
#line 24840 "Photo.c"
		}
#line 3384 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = _tmp6_;
#line 24844 "Photo.c"
	} else {
#line 3382 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = FALSE;
#line 24848 "Photo.c"
	}
#line 3382 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_) {
#line 24852 "Photo.c"
		RawDeveloper _tmp11_ = 0;
		gboolean _tmp12_ = FALSE;
#line 3386 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = photo_get_raw_developer (self);
#line 3386 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = photo_is_raw_developer_complete (self, _tmp11_);
#line 3386 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = !_tmp12_;
#line 24861 "Photo.c"
	} else {
#line 3382 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = FALSE;
#line 24865 "Photo.c"
	}
#line 3382 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp0_) {
#line 24869 "Photo.c"
		RawDeveloper _tmp13_ = 0;
#line 3387 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp13_ = photo_get_raw_developer (self);
#line 3387 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_set_raw_developer (self, _tmp13_);
#line 24875 "Photo.c"
	}
#line 3392 "/home/jens/Source/shotwell/src/Photo.vala"
	dimensions_init (&original, 0, 0);
#line 3393 "/home/jens/Source/shotwell/src/Photo.vala"
	dimensions_init (&scaled, 0, 0);
#line 3394 "/home/jens/Source/shotwell/src/Photo.vala"
	redeye_instances = NULL;
#line 3394 "/home/jens/Source/shotwell/src/Photo.vala"
	redeye_instances_length1 = 0;
#line 3394 "/home/jens/Source/shotwell/src/Photo.vala"
	_redeye_instances_size_ = redeye_instances_length1;
#line 3397 "/home/jens/Source/shotwell/src/Photo.vala"
	transformer = NULL;
#line 24889 "Photo.c"
	{
		PhotoRow* _tmp14_ = NULL;
#line 3400 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp14_ = self->row;
#line 3400 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 24896 "Photo.c"
		{
			Dimensions _tmp15_ = {0};
			PhotoException _tmp16_ = 0;
			Dimensions _tmp17_ = {0};
			Dimensions _tmp18_ = {0};
			Dimensions _tmp19_ = {0};
			Dimensions _tmp20_ = {0};
			Dimensions _tmp21_ = {0};
			gboolean _tmp22_ = FALSE;
			gint _tmp23_ = 0;
			EditingToolsRedeyeInstance* _tmp24_ = NULL;
			Box _tmp25_ = {0};
			gboolean _tmp26_ = FALSE;
			gdouble _tmp27_ = 0.0;
			gboolean _tmp28_ = FALSE;
			gboolean _tmp29_ = FALSE;
			Orientation _tmp31_ = 0;
#line 3401 "/home/jens/Source/shotwell/src/Photo.vala"
			media_source_get_dimensions (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), PHOTO_EXCEPTION_ALL, &_tmp15_);
#line 3401 "/home/jens/Source/shotwell/src/Photo.vala"
			original = _tmp15_;
#line 3402 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp16_ = exceptions;
#line 3402 "/home/jens/Source/shotwell/src/Photo.vala"
			media_source_get_dimensions (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), _tmp16_, &_tmp17_);
#line 3402 "/home/jens/Source/shotwell/src/Photo.vala"
			scaling_get_scaled_dimensions (scaling, &_tmp17_, &_tmp18_);
#line 3402 "/home/jens/Source/shotwell/src/Photo.vala"
			scaled = _tmp18_;
#line 3403 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp19_ = scaled;
#line 3403 "/home/jens/Source/shotwell/src/Photo.vala"
			scaled_to_viewport = _tmp19_;
#line 3405 "/home/jens/Source/shotwell/src/Photo.vala"
			media_source_get_dimensions (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), PHOTO_EXCEPTION_NONE, &_tmp20_);
#line 3405 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp21_ = scaled;
#line 3405 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp22_ = dimensions_equals (&_tmp20_, &_tmp21_);
#line 3405 "/home/jens/Source/shotwell/src/Photo.vala"
			is_scaled = !_tmp22_;
#line 3407 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp24_ = photo_get_raw_redeye_instances (self, &_tmp23_);
#line 3407 "/home/jens/Source/shotwell/src/Photo.vala"
			redeye_instances = (g_free (redeye_instances), NULL);
#line 3407 "/home/jens/Source/shotwell/src/Photo.vala"
			redeye_instances = _tmp24_;
#line 3407 "/home/jens/Source/shotwell/src/Photo.vala"
			redeye_instances_length1 = _tmp23_;
#line 3407 "/home/jens/Source/shotwell/src/Photo.vala"
			_redeye_instances_size_ = redeye_instances_length1;
#line 3409 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp26_ = photo_get_raw_crop (self, &_tmp25_);
#line 3409 "/home/jens/Source/shotwell/src/Photo.vala"
			crop = _tmp25_;
#line 3409 "/home/jens/Source/shotwell/src/Photo.vala"
			is_cropped = _tmp26_;
#line 3411 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp28_ = photo_get_raw_straighten (self, &_tmp27_);
#line 3411 "/home/jens/Source/shotwell/src/Photo.vala"
			straightening_angle = _tmp27_;
#line 3411 "/home/jens/Source/shotwell/src/Photo.vala"
			is_straightened = _tmp28_;
#line 3413 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp29_ = photo_has_color_adjustments (self);
#line 3413 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp29_) {
#line 24964 "Photo.c"
				PixelTransformer* _tmp30_ = NULL;
#line 3414 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp30_ = photo_get_pixel_transformer (self);
#line 3414 "/home/jens/Source/shotwell/src/Photo.vala"
				_pixel_transformer_unref0 (transformer);
#line 3414 "/home/jens/Source/shotwell/src/Photo.vala"
				transformer = _tmp30_;
#line 24972 "Photo.c"
			}
#line 3416 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp31_ = photo_get_orientation (self);
#line 3416 "/home/jens/Source/shotwell/src/Photo.vala"
			orientation = _tmp31_;
#line 24978 "Photo.c"
		}
		__finally387:
		{
			PhotoRow* _tmp32_ = NULL;
#line 3400 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp32_ = self->row;
#line 3400 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 24987 "Photo.c"
		}
#line 3400 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3400 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 3400 "/home/jens/Source/shotwell/src/Photo.vala"
			_pixel_transformer_unref0 (transformer);
#line 3400 "/home/jens/Source/shotwell/src/Photo.vala"
			redeye_instances = (g_free (redeye_instances), NULL);
#line 3400 "/home/jens/Source/shotwell/src/Photo.vala"
			return NULL;
#line 24999 "Photo.c"
		}
	}
#line 3423 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp33_ = photo_get_prefetched_copy (self, &_inner_error_);
#line 3423 "/home/jens/Source/shotwell/src/Photo.vala"
	pixbuf = _tmp33_;
#line 3423 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3423 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3423 "/home/jens/Source/shotwell/src/Photo.vala"
		_pixel_transformer_unref0 (transformer);
#line 3423 "/home/jens/Source/shotwell/src/Photo.vala"
		redeye_instances = (g_free (redeye_instances), NULL);
#line 3423 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 25016 "Photo.c"
	}
#line 3430 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp34_ = exceptions;
#line 3430 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp35_ = photo_exception_allows (_tmp34_, PHOTO_EXCEPTION_REDEYE);
#line 3430 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp35_) {
#line 25024 "Photo.c"
		EditingToolsRedeyeInstance* _tmp36_ = NULL;
		gint _tmp36__length1 = 0;
#line 3435 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp36_ = redeye_instances;
#line 3435 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp36__length1 = redeye_instances_length1;
#line 25031 "Photo.c"
		{
			EditingToolsRedeyeInstance* instance_collection = NULL;
			gint instance_collection_length1 = 0;
			gint _instance_collection_size_ = 0;
			gint instance_it = 0;
#line 3435 "/home/jens/Source/shotwell/src/Photo.vala"
			instance_collection = _tmp36_;
#line 3435 "/home/jens/Source/shotwell/src/Photo.vala"
			instance_collection_length1 = _tmp36__length1;
#line 3435 "/home/jens/Source/shotwell/src/Photo.vala"
			for (instance_it = 0; instance_it < _tmp36__length1; instance_it = instance_it + 1) {
#line 25043 "Photo.c"
				EditingToolsRedeyeInstance instance = {0};
#line 3435 "/home/jens/Source/shotwell/src/Photo.vala"
				instance = instance_collection[instance_it];
#line 25047 "Photo.c"
				{
					GdkPixbuf* _tmp37_ = NULL;
					EditingToolsRedeyeInstance _tmp38_ = {0};
					GdkPixbuf* _tmp39_ = NULL;
#line 3436 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp37_ = pixbuf;
#line 3436 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp38_ = instance;
#line 3436 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp39_ = photo_do_redeye (self, _tmp37_, &_tmp38_);
#line 3436 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (pixbuf);
#line 3436 "/home/jens/Source/shotwell/src/Photo.vala"
					pixbuf = _tmp39_;
#line 25062 "Photo.c"
				}
			}
		}
	}
#line 3444 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp40_ = exceptions;
#line 3444 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp41_ = photo_exception_allows (_tmp40_, PHOTO_EXCEPTION_STRAIGHTEN);
#line 3444 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp41_) {
#line 25073 "Photo.c"
		gboolean _tmp42_ = FALSE;
#line 3448 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp42_ = is_straightened;
#line 3448 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp42_) {
#line 25079 "Photo.c"
			GdkPixbuf* _tmp43_ = NULL;
			gdouble _tmp44_ = 0.0;
			GdkPixbuf* _tmp45_ = NULL;
#line 3449 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp43_ = pixbuf;
#line 3449 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp44_ = straightening_angle;
#line 3449 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp45_ = rotate_arb (_tmp43_, _tmp44_);
#line 3449 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (pixbuf);
#line 3449 "/home/jens/Source/shotwell/src/Photo.vala"
			pixbuf = _tmp45_;
#line 25093 "Photo.c"
		}
	}
#line 3458 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp46_ = exceptions;
#line 3458 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp47_ = photo_exception_allows (_tmp46_, PHOTO_EXCEPTION_CROP);
#line 3458 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp47_) {
#line 25102 "Photo.c"
		gboolean _tmp48_ = FALSE;
#line 3462 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp48_ = is_cropped;
#line 3462 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp48_) {
#line 25108 "Photo.c"
			Box _tmp49_ = {0};
			gint _tmp50_ = 0;
			GdkPixbuf* _tmp51_ = NULL;
			gint _tmp52_ = 0;
			gint _tmp53_ = 0;
			gint _tmp54_ = 0;
			Box _tmp55_ = {0};
			gint _tmp56_ = 0;
			GdkPixbuf* _tmp57_ = NULL;
			gint _tmp58_ = 0;
			gint _tmp59_ = 0;
			gint _tmp60_ = 0;
			Box _tmp61_ = {0};
			gint _tmp62_ = 0;
			Box _tmp63_ = {0};
			gint _tmp64_ = 0;
			GdkPixbuf* _tmp65_ = NULL;
			gint _tmp66_ = 0;
			gint _tmp67_ = 0;
			gint _tmp68_ = 0;
			Box _tmp69_ = {0};
			gint _tmp70_ = 0;
			Box _tmp71_ = {0};
			gint _tmp72_ = 0;
			GdkPixbuf* _tmp73_ = NULL;
			gint _tmp74_ = 0;
			gint _tmp75_ = 0;
			gint _tmp76_ = 0;
			GdkPixbuf* _tmp77_ = NULL;
			Box _tmp78_ = {0};
			gint _tmp79_ = 0;
			Box _tmp80_ = {0};
			gint _tmp81_ = 0;
			gint _tmp82_ = 0;
			gint _tmp83_ = 0;
			GdkPixbuf* _tmp84_ = NULL;
#line 3467 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp49_ = crop;
#line 3467 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp50_ = _tmp49_.left;
#line 3467 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp51_ = pixbuf;
#line 3467 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp52_ = gdk_pixbuf_get_width (_tmp51_);
#line 3467 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp53_ = _tmp52_;
#line 3467 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp54_ = CLAMP (_tmp50_, 0, _tmp53_ - 2);
#line 3467 "/home/jens/Source/shotwell/src/Photo.vala"
			crop.left = _tmp54_;
#line 3468 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp55_ = crop;
#line 3468 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp56_ = _tmp55_.top;
#line 3468 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp57_ = pixbuf;
#line 3468 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp58_ = gdk_pixbuf_get_height (_tmp57_);
#line 3468 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp59_ = _tmp58_;
#line 3468 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp60_ = CLAMP (_tmp56_, 0, _tmp59_ - 2);
#line 3468 "/home/jens/Source/shotwell/src/Photo.vala"
			crop.top = _tmp60_;
#line 3470 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp61_ = crop;
#line 3470 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp62_ = _tmp61_.right;
#line 3470 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp63_ = crop;
#line 3470 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp64_ = _tmp63_.left;
#line 3470 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp65_ = pixbuf;
#line 3470 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp66_ = gdk_pixbuf_get_width (_tmp65_);
#line 3470 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp67_ = _tmp66_;
#line 3470 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp68_ = CLAMP (_tmp62_, _tmp64_ + 1, _tmp67_ - 1);
#line 3470 "/home/jens/Source/shotwell/src/Photo.vala"
			crop.right = _tmp68_;
#line 3471 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp69_ = crop;
#line 3471 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp70_ = _tmp69_.bottom;
#line 3471 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp71_ = crop;
#line 3471 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp72_ = _tmp71_.top;
#line 3471 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp73_ = pixbuf;
#line 3471 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp74_ = gdk_pixbuf_get_height (_tmp73_);
#line 3471 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp75_ = _tmp74_;
#line 3471 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp76_ = CLAMP (_tmp70_, _tmp72_ + 1, _tmp75_ - 1);
#line 3471 "/home/jens/Source/shotwell/src/Photo.vala"
			crop.bottom = _tmp76_;
#line 3473 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp77_ = pixbuf;
#line 3473 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp78_ = crop;
#line 3473 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp79_ = _tmp78_.left;
#line 3473 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp80_ = crop;
#line 3473 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp81_ = _tmp80_.top;
#line 3473 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp82_ = box_get_width (&crop);
#line 3473 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp83_ = box_get_height (&crop);
#line 3473 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp84_ = gdk_pixbuf_new_subpixbuf (_tmp77_, _tmp79_, _tmp81_, _tmp82_, _tmp83_);
#line 3473 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (pixbuf);
#line 3473 "/home/jens/Source/shotwell/src/Photo.vala"
			pixbuf = _tmp84_;
#line 25229 "Photo.c"
		}
	}
#line 3483 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp85_ = exceptions;
#line 3483 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp86_ = photo_exception_allows (_tmp85_, PHOTO_EXCEPTION_ORIENTATION);
#line 3483 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp86_) {
#line 25238 "Photo.c"
		GdkPixbuf* _tmp87_ = NULL;
		GdkPixbuf* _tmp88_ = NULL;
#line 3487 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp87_ = pixbuf;
#line 3487 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp88_ = orientation_rotate_pixbuf (orientation, _tmp87_);
#line 3487 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (pixbuf);
#line 3487 "/home/jens/Source/shotwell/src/Photo.vala"
		pixbuf = _tmp88_;
#line 25249 "Photo.c"
	}
#line 3494 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp89_ = is_scaled;
#line 3494 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp89_) {
#line 25255 "Photo.c"
		GdkPixbuf* _tmp90_ = NULL;
		Dimensions _tmp91_ = {0};
		gint _tmp92_ = 0;
		Dimensions _tmp93_ = {0};
		gint _tmp94_ = 0;
		GdkPixbuf* _tmp95_ = NULL;
#line 3498 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp90_ = pixbuf;
#line 3498 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp91_ = scaled_to_viewport;
#line 3498 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp92_ = _tmp91_.width;
#line 3498 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp93_ = scaled_to_viewport;
#line 3498 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp94_ = _tmp93_.height;
#line 3498 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp95_ = gdk_pixbuf_scale_simple (_tmp90_, _tmp92_, _tmp94_, GDK_INTERP_BILINEAR);
#line 3498 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (pixbuf);
#line 3498 "/home/jens/Source/shotwell/src/Photo.vala"
		pixbuf = _tmp95_;
#line 25278 "Photo.c"
	}
#line 3506 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp96_ = exceptions;
#line 3506 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp97_ = photo_exception_allows (_tmp96_, PHOTO_EXCEPTION_ADJUST);
#line 3506 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp97_) {
#line 25286 "Photo.c"
		PixelTransformer* _tmp98_ = NULL;
#line 3510 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp98_ = transformer;
#line 3510 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp98_ != NULL) {
#line 25292 "Photo.c"
			PixelTransformer* _tmp99_ = NULL;
			GdkPixbuf* _tmp100_ = NULL;
#line 3511 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp99_ = transformer;
#line 3511 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp100_ = pixbuf;
#line 3511 "/home/jens/Source/shotwell/src/Photo.vala"
			pixel_transformer_transform_pixbuf (_tmp99_, _tmp100_, NULL);
#line 25301 "Photo.c"
		}
	}
#line 3520 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp102_ = is_scaled;
#line 3520 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp102_) {
#line 25308 "Photo.c"
		gboolean _tmp103_ = FALSE;
#line 3520 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp103_ = is_straightened;
#line 3520 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp101_ = !_tmp103_;
#line 25314 "Photo.c"
	} else {
#line 3520 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp101_ = FALSE;
#line 25318 "Photo.c"
	}
#line 3520 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp101_) {
#line 25322 "Photo.c"
		GdkPixbuf* _tmp104_ = NULL;
		Dimensions _tmp105_ = {0};
		gboolean _tmp106_ = FALSE;
#line 3521 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp104_ = pixbuf;
#line 3521 "/home/jens/Source/shotwell/src/Photo.vala"
		dimensions_for_pixbuf (_tmp104_, &_tmp105_);
#line 3521 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp106_ = dimensions_approx_equals (&scaled_to_viewport, &_tmp105_, PHOTO_SCALING_FUDGE);
#line 3521 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_assert (_tmp106_, "scaled_to_viewport.approx_equals(Dimensions.for_pixbuf(pixbuf), SCALING_FUDGE)");
#line 25334 "Photo.c"
	}
#line 3529 "/home/jens/Source/shotwell/src/Photo.vala"
	result = pixbuf;
#line 3529 "/home/jens/Source/shotwell/src/Photo.vala"
	_pixel_transformer_unref0 (transformer);
#line 3529 "/home/jens/Source/shotwell/src/Photo.vala"
	redeye_instances = (g_free (redeye_instances), NULL);
#line 3529 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 25344 "Photo.c"
}


static gboolean photo_real_has_user_generated_metadata (Photo* self) {
	gboolean _tmp0_ = FALSE;
#line 3537 "/home/jens/Source/shotwell/src/Photo.vala"
	g_critical ("Type `%s' does not implement abstract method `photo_has_user_generated_metadata'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
#line 3537 "/home/jens/Source/shotwell/src/Photo.vala"
	return _tmp0_;
#line 25354 "Photo.c"
}


gboolean photo_has_user_generated_metadata (Photo* self) {
#line 3537 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 3537 "/home/jens/Source/shotwell/src/Photo.vala"
	return PHOTO_GET_CLASS (self)->has_user_generated_metadata (self);
#line 25363 "Photo.c"
}


static void photo_real_set_user_metadata_for_export (Photo* self, PhotoMetadata* metadata) {
#line 3541 "/home/jens/Source/shotwell/src/Photo.vala"
	g_critical ("Type `%s' does not implement abstract method `photo_set_user_metadata_for_export'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
#line 3541 "/home/jens/Source/shotwell/src/Photo.vala"
	return;
#line 25372 "Photo.c"
}


void photo_set_user_metadata_for_export (Photo* self, PhotoMetadata* metadata) {
#line 3541 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 3541 "/home/jens/Source/shotwell/src/Photo.vala"
	PHOTO_GET_CLASS (self)->set_user_metadata_for_export (self, metadata);
#line 25381 "Photo.c"
}


gchar* photo_get_export_basename (Photo* self, PhotoFileFormat* file_format) {
	gchar* result = NULL;
	PhotoFileFormat* _tmp0_ = NULL;
#line 3548 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 3549 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = file_format;
#line 3549 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp0_ != NULL) {
#line 25394 "Photo.c"
		PhotoFileFormat* _tmp1_ = NULL;
		PhotoFileFormatProperties* _tmp2_ = NULL;
		PhotoFileFormatProperties* _tmp3_ = NULL;
		GFile* _tmp4_ = NULL;
		GFile* _tmp5_ = NULL;
		GFile* _tmp6_ = NULL;
		GFile* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
		gchar* _tmp9_ = NULL;
#line 3550 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = file_format;
#line 3550 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = photo_file_format_get_properties (*_tmp1_);
#line 3550 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = _tmp2_;
#line 3550 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = media_source_get_master_file (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 3550 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = _tmp4_;
#line 3550 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = photo_file_format_properties_convert_file_extension (_tmp3_, _tmp5_);
#line 3550 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = _tmp6_;
#line 3550 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = g_file_get_basename (_tmp7_);
#line 3550 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp9_ = _tmp8_;
#line 3550 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp7_);
#line 3550 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp5_);
#line 3550 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_format_properties_unref0 (_tmp3_);
#line 3550 "/home/jens/Source/shotwell/src/Photo.vala"
		result = _tmp9_;
#line 3550 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 25432 "Photo.c"
	} else {
		PhotoFileFormat _tmp10_ = 0;
		gboolean _tmp11_ = FALSE;
#line 3552 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp10_ = photo_get_file_format (self);
#line 3552 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = photo_file_format_can_write (_tmp10_);
#line 3552 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp11_) {
#line 25442 "Photo.c"
			PhotoFileFormat _tmp12_ = 0;
			PhotoFileFormatProperties* _tmp13_ = NULL;
			PhotoFileFormatProperties* _tmp14_ = NULL;
			GFile* _tmp15_ = NULL;
			GFile* _tmp16_ = NULL;
			GFile* _tmp17_ = NULL;
			GFile* _tmp18_ = NULL;
			gchar* _tmp19_ = NULL;
			gchar* _tmp20_ = NULL;
#line 3553 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = photo_get_file_format (self);
#line 3553 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = photo_file_format_get_properties (_tmp12_);
#line 3553 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp14_ = _tmp13_;
#line 3553 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp15_ = media_source_get_master_file (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 3553 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp16_ = _tmp15_;
#line 3553 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp17_ = photo_file_format_properties_convert_file_extension (_tmp14_, _tmp16_);
#line 3553 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp18_ = _tmp17_;
#line 3553 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp19_ = g_file_get_basename (_tmp18_);
#line 3553 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp20_ = _tmp19_;
#line 3553 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tmp18_);
#line 3553 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tmp16_);
#line 3553 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_format_properties_unref0 (_tmp14_);
#line 3553 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp20_;
#line 3553 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 25480 "Photo.c"
		} else {
			PhotoFileFormat _tmp21_ = 0;
			PhotoFileFormatProperties* _tmp22_ = NULL;
			PhotoFileFormatProperties* _tmp23_ = NULL;
			GFile* _tmp24_ = NULL;
			GFile* _tmp25_ = NULL;
			GFile* _tmp26_ = NULL;
			GFile* _tmp27_ = NULL;
			gchar* _tmp28_ = NULL;
			gchar* _tmp29_ = NULL;
#line 3556 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp21_ = photo_file_format_get_system_default_format ();
#line 3556 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp22_ = photo_file_format_get_properties (_tmp21_);
#line 3556 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp23_ = _tmp22_;
#line 3556 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp24_ = media_source_get_master_file (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 3556 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp25_ = _tmp24_;
#line 3556 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp26_ = photo_file_format_properties_convert_file_extension (_tmp23_, _tmp25_);
#line 3556 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp27_ = _tmp26_;
#line 3556 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp28_ = g_file_get_basename (_tmp27_);
#line 3556 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp29_ = _tmp28_;
#line 3556 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tmp27_);
#line 3556 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tmp25_);
#line 3556 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_format_properties_unref0 (_tmp23_);
#line 3556 "/home/jens/Source/shotwell/src/Photo.vala"
			result = _tmp29_;
#line 3556 "/home/jens/Source/shotwell/src/Photo.vala"
			return result;
#line 25519 "Photo.c"
		}
	}
}


static gboolean photo_export_fullsized_backing (Photo* self, GFile* file, gboolean export_metadata, GError** error) {
	gboolean result = FALSE;
	PhotoFileReader* export_reader = NULL;
	gboolean is_master = FALSE;
	PhotoFileReader* _tmp30_ = NULL;
	PhotoFileFormatProperties* format_properties = NULL;
	PhotoFileReader* _tmp31_ = NULL;
	PhotoFileFormat _tmp32_ = 0;
	PhotoFileFormatProperties* _tmp33_ = NULL;
	GFile* dest_file = NULL;
	PhotoFileFormatProperties* _tmp34_ = NULL;
	GFile* _tmp35_ = NULL;
	GFile* _tmp36_ = NULL;
	PhotoFileMetadataWriter* writer = NULL;
	PhotoFileReader* _tmp37_ = NULL;
	PhotoFileFormat _tmp38_ = 0;
	GFile* _tmp39_ = NULL;
	gchar* _tmp40_ = NULL;
	gchar* _tmp41_ = NULL;
	PhotoFileMetadataWriter* _tmp42_ = NULL;
	PhotoFileMetadataWriter* _tmp43_ = NULL;
	gchar* _tmp45_ = NULL;
	gchar* _tmp46_ = NULL;
	PhotoFileMetadataWriter* _tmp47_ = NULL;
	gchar* _tmp48_ = NULL;
	gchar* _tmp49_ = NULL;
	PhotoFileReader* _tmp50_ = NULL;
	GFile* _tmp51_ = NULL;
	GFile* _tmp52_ = NULL;
	GFile* _tmp53_ = NULL;
	gboolean _tmp55_ = FALSE;
	gboolean _tmp56_ = FALSE;
	gboolean _tmp57_ = FALSE;
	gboolean _tmp58_ = FALSE;
	gboolean _tmp59_ = FALSE;
	gboolean _tmp60_ = FALSE;
	PhotoMetadata* metadata = NULL;
	PhotoFileReader* _tmp68_ = NULL;
	PhotoMetadata* _tmp69_ = NULL;
	PhotoMetadata* _tmp71_ = NULL;
	PhotoFileMetadataWriter* _tmp75_ = NULL;
	gchar* _tmp76_ = NULL;
	gchar* _tmp77_ = NULL;
	time_t _tmp78_ = 0;
	gboolean _tmp84_ = FALSE;
	PhotoFileMetadataWriter* _tmp101_ = NULL;
	PhotoMetadata* _tmp102_ = NULL;
	GError * _inner_error_ = NULL;
#line 3562 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 3562 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_IS_FILE (file), FALSE);
#line 3565 "/home/jens/Source/shotwell/src/Photo.vala"
	export_reader = NULL;
#line 3566 "/home/jens/Source/shotwell/src/Photo.vala"
	is_master = TRUE;
#line 25581 "Photo.c"
	{
		PhotoBackingReaders* _tmp0_ = NULL;
#line 3567 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->readers;
#line 3567 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_readers);
#line 25588 "Photo.c"
		{
			gboolean _tmp1_ = FALSE;
			PhotoBackingReaders* _tmp2_ = NULL;
			PhotoFileReader* _tmp3_ = NULL;
#line 3568 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = self->priv->readers;
#line 3568 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = _tmp2_->editable;
#line 3568 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp3_ != NULL) {
#line 25599 "Photo.c"
				PhotoBackingReaders* _tmp4_ = NULL;
				PhotoFileReader* _tmp5_ = NULL;
				PhotoFileFormat _tmp6_ = 0;
				gboolean _tmp7_ = FALSE;
#line 3568 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = self->priv->readers;
#line 3568 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = _tmp4_->editable;
#line 3568 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = photo_file_adapter_get_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 3568 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = photo_file_format_can_write_metadata (_tmp6_);
#line 3568 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = _tmp7_;
#line 25614 "Photo.c"
			} else {
#line 3568 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp1_ = FALSE;
#line 25618 "Photo.c"
			}
#line 3568 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp1_) {
#line 25622 "Photo.c"
				PhotoBackingReaders* _tmp8_ = NULL;
				PhotoFileReader* _tmp9_ = NULL;
				PhotoFileReader* _tmp10_ = NULL;
#line 3569 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = self->priv->readers;
#line 3569 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = _tmp8_->editable;
#line 3569 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = _photo_file_adapter_ref0 (_tmp9_);
#line 3569 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_file_adapter_unref0 (export_reader);
#line 3569 "/home/jens/Source/shotwell/src/Photo.vala"
				export_reader = _tmp10_;
#line 3570 "/home/jens/Source/shotwell/src/Photo.vala"
				is_master = FALSE;
#line 25638 "Photo.c"
			} else {
				gboolean _tmp11_ = FALSE;
				PhotoBackingReaders* _tmp12_ = NULL;
				PhotoFileReader* _tmp13_ = NULL;
#line 3571 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = self->priv->readers;
#line 3571 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = _tmp12_->developer;
#line 3571 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp13_ != NULL) {
#line 25649 "Photo.c"
					PhotoBackingReaders* _tmp14_ = NULL;
					PhotoFileReader* _tmp15_ = NULL;
					PhotoFileFormat _tmp16_ = 0;
					gboolean _tmp17_ = FALSE;
#line 3571 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp14_ = self->priv->readers;
#line 3571 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp15_ = _tmp14_->developer;
#line 3571 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp16_ = photo_file_adapter_get_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 3571 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp17_ = photo_file_format_can_write_metadata (_tmp16_);
#line 3571 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp11_ = _tmp17_;
#line 25664 "Photo.c"
				} else {
#line 3571 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp11_ = FALSE;
#line 25668 "Photo.c"
				}
#line 3571 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp11_) {
#line 25672 "Photo.c"
					PhotoBackingReaders* _tmp18_ = NULL;
					PhotoFileReader* _tmp19_ = NULL;
					PhotoFileReader* _tmp20_ = NULL;
#line 3572 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp18_ = self->priv->readers;
#line 3572 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp19_ = _tmp18_->developer;
#line 3572 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp20_ = _photo_file_adapter_ref0 (_tmp19_);
#line 3572 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_file_adapter_unref0 (export_reader);
#line 3572 "/home/jens/Source/shotwell/src/Photo.vala"
					export_reader = _tmp20_;
#line 3573 "/home/jens/Source/shotwell/src/Photo.vala"
					is_master = FALSE;
#line 25688 "Photo.c"
				} else {
					PhotoBackingReaders* _tmp21_ = NULL;
					PhotoFileReader* _tmp22_ = NULL;
					PhotoFileFormat _tmp23_ = 0;
					gboolean _tmp24_ = FALSE;
#line 3574 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp21_ = self->priv->readers;
#line 3574 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp22_ = _tmp21_->master;
#line 3574 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp23_ = photo_file_adapter_get_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 3574 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp24_ = photo_file_format_can_write_metadata (_tmp23_);
#line 3574 "/home/jens/Source/shotwell/src/Photo.vala"
					if (_tmp24_) {
#line 25704 "Photo.c"
						PhotoBackingReaders* _tmp25_ = NULL;
						PhotoFileReader* _tmp26_ = NULL;
						PhotoFileReader* _tmp27_ = NULL;
#line 3575 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp25_ = self->priv->readers;
#line 3575 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp26_ = _tmp25_->master;
#line 3575 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp27_ = _photo_file_adapter_ref0 (_tmp26_);
#line 3575 "/home/jens/Source/shotwell/src/Photo.vala"
						_photo_file_adapter_unref0 (export_reader);
#line 3575 "/home/jens/Source/shotwell/src/Photo.vala"
						export_reader = _tmp27_;
#line 25718 "Photo.c"
					}
				}
			}
		}
		__finally388:
		{
			PhotoBackingReaders* _tmp28_ = NULL;
#line 3567 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp28_ = self->priv->readers;
#line 3567 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 25730 "Photo.c"
		}
#line 3567 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 25734 "Photo.c"
			gboolean _tmp29_ = FALSE;
#line 3567 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 3567 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_adapter_unref0 (export_reader);
#line 3567 "/home/jens/Source/shotwell/src/Photo.vala"
			return _tmp29_;
#line 25742 "Photo.c"
		}
	}
#line 3579 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp30_ = export_reader;
#line 3579 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp30_ == NULL) {
#line 3580 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 3580 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (export_reader);
#line 3580 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 25755 "Photo.c"
	}
#line 3582 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp31_ = export_reader;
#line 3582 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp32_ = photo_file_adapter_get_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 3582 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp33_ = photo_file_format_get_properties (_tmp32_);
#line 3582 "/home/jens/Source/shotwell/src/Photo.vala"
	format_properties = _tmp33_;
#line 3585 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp34_ = format_properties;
#line 3585 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp35_ = file;
#line 3585 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp36_ = photo_file_format_properties_convert_file_extension (_tmp34_, _tmp35_);
#line 3585 "/home/jens/Source/shotwell/src/Photo.vala"
	dest_file = _tmp36_;
#line 3588 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp37_ = export_reader;
#line 3588 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp38_ = photo_file_adapter_get_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp37_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 3588 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp39_ = dest_file;
#line 3588 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp40_ = g_file_get_path (_tmp39_);
#line 3588 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp41_ = _tmp40_;
#line 3588 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp42_ = photo_file_format_create_metadata_writer (_tmp38_, _tmp41_, &_inner_error_);
#line 3588 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp43_ = _tmp42_;
#line 3588 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp41_);
#line 3588 "/home/jens/Source/shotwell/src/Photo.vala"
	writer = _tmp43_;
#line 3588 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 25793 "Photo.c"
		gboolean _tmp44_ = FALSE;
#line 3588 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3588 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (dest_file);
#line 3588 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_format_properties_unref0 (format_properties);
#line 3588 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (export_reader);
#line 3588 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp44_;
#line 25805 "Photo.c"
	}
#line 3591 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp45_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 3591 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp46_ = _tmp45_;
#line 3591 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp47_ = writer;
#line 3591 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp48_ = photo_file_adapter_get_filepath (G_TYPE_CHECK_INSTANCE_CAST (_tmp47_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 3591 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp49_ = _tmp48_;
#line 3591 "/home/jens/Source/shotwell/src/Photo.vala"
	g_debug ("Photo.vala:3591: Exporting full-sized copy of %s to %s", _tmp46_, _tmp49_);
#line 3591 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp49_);
#line 3591 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp46_);
#line 3593 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp50_ = export_reader;
#line 3593 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp51_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp50_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 3593 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp52_ = _tmp51_;
#line 3593 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp53_ = dest_file;
#line 3593 "/home/jens/Source/shotwell/src/Photo.vala"
	g_file_copy (_tmp52_, _tmp53_, G_FILE_COPY_OVERWRITE | G_FILE_COPY_TARGET_DEFAULT_PERMS, NULL, NULL, NULL, &_inner_error_);
#line 3593 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp52_);
#line 3593 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 25837 "Photo.c"
		gboolean _tmp54_ = FALSE;
#line 3593 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3593 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (writer);
#line 3593 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (dest_file);
#line 3593 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_format_properties_unref0 (format_properties);
#line 3593 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (export_reader);
#line 3593 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp54_;
#line 25851 "Photo.c"
	}
#line 3598 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp60_ = photo_has_alterations (self);
#line 3598 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp60_) {
#line 25857 "Photo.c"
		gboolean _tmp61_ = FALSE;
#line 3598 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp61_ = is_master;
#line 3598 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp59_ = _tmp61_;
#line 25863 "Photo.c"
	} else {
#line 3598 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp59_ = FALSE;
#line 25867 "Photo.c"
	}
#line 3598 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp59_) {
#line 25871 "Photo.c"
		gboolean _tmp62_ = FALSE;
#line 3598 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp62_ = photo_has_user_generated_metadata (self);
#line 3598 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp58_ = !_tmp62_;
#line 25877 "Photo.c"
	} else {
#line 3598 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp58_ = FALSE;
#line 25881 "Photo.c"
	}
#line 3598 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp58_) {
#line 25885 "Photo.c"
		gchar* _tmp63_ = NULL;
		gchar* _tmp64_ = NULL;
#line 3599 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp63_ = media_source_get_title (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 3599 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp64_ = _tmp63_;
#line 3599 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp57_ = _tmp64_ == NULL;
#line 3599 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp64_);
#line 25896 "Photo.c"
	} else {
#line 3598 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp57_ = FALSE;
#line 25900 "Photo.c"
	}
#line 3598 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp57_) {
#line 25904 "Photo.c"
		gchar* _tmp65_ = NULL;
		gchar* _tmp66_ = NULL;
#line 3599 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp65_ = media_source_get_comment (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 3599 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp66_ = _tmp65_;
#line 3599 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp56_ = _tmp66_ == NULL;
#line 3599 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp66_);
#line 25915 "Photo.c"
	} else {
#line 3598 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp56_ = FALSE;
#line 25919 "Photo.c"
	}
#line 3598 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp56_) {
#line 25923 "Photo.c"
		gboolean _tmp67_ = FALSE;
#line 3599 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp67_ = export_metadata;
#line 3599 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp55_ = _tmp67_;
#line 25929 "Photo.c"
	} else {
#line 3598 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp55_ = FALSE;
#line 25933 "Photo.c"
	}
#line 3598 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp55_) {
#line 3600 "/home/jens/Source/shotwell/src/Photo.vala"
		result = TRUE;
#line 3600 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (writer);
#line 3600 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (dest_file);
#line 3600 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_format_properties_unref0 (format_properties);
#line 3600 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (export_reader);
#line 3600 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 25949 "Photo.c"
	}
#line 3603 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp68_ = export_reader;
#line 3603 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp69_ = photo_file_reader_read_metadata (_tmp68_, &_inner_error_);
#line 3603 "/home/jens/Source/shotwell/src/Photo.vala"
	metadata = _tmp69_;
#line 3603 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 25959 "Photo.c"
		gboolean _tmp70_ = FALSE;
#line 3603 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3603 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (writer);
#line 3603 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (dest_file);
#line 3603 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_format_properties_unref0 (format_properties);
#line 3603 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (export_reader);
#line 3603 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp70_;
#line 25973 "Photo.c"
	}
#line 3604 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp71_ = metadata;
#line 3604 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp71_ == NULL) {
#line 25979 "Photo.c"
		PhotoFileReader* _tmp72_ = NULL;
		PhotoFileFormat _tmp73_ = 0;
		PhotoMetadata* _tmp74_ = NULL;
#line 3605 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp72_ = export_reader;
#line 3605 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp73_ = photo_file_adapter_get_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp72_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 3605 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp74_ = photo_file_format_create_metadata (_tmp73_);
#line 3605 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (metadata);
#line 3605 "/home/jens/Source/shotwell/src/Photo.vala"
		metadata = _tmp74_;
#line 25993 "Photo.c"
	}
#line 3607 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp75_ = writer;
#line 3607 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp76_ = photo_file_adapter_get_filepath (G_TYPE_CHECK_INSTANCE_CAST (_tmp75_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 3607 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp77_ = _tmp76_;
#line 3607 "/home/jens/Source/shotwell/src/Photo.vala"
	g_debug ("Photo.vala:3607: Updating metadata of %s", _tmp77_);
#line 3607 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp77_);
#line 3609 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp78_ = media_source_get_exposure_time (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 3609 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp78_ != ((time_t) 0)) {
#line 26009 "Photo.c"
		PhotoMetadata* _tmp79_ = NULL;
		time_t _tmp80_ = 0;
		MetadataDateTime* _tmp81_ = NULL;
		MetadataDateTime* _tmp82_ = NULL;
#line 3610 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp79_ = metadata;
#line 3610 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp80_ = media_source_get_exposure_time (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 3610 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp81_ = metadata_date_time_new (_tmp80_);
#line 3610 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp82_ = _tmp81_;
#line 3610 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_set_exposure_date_time (_tmp79_, _tmp82_, PHOTO_METADATA_SET_OPTION_ALL_DOMAINS);
#line 3610 "/home/jens/Source/shotwell/src/Photo.vala"
		_metadata_date_time_unref0 (_tmp82_);
#line 26026 "Photo.c"
	} else {
		PhotoMetadata* _tmp83_ = NULL;
#line 3612 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp83_ = metadata;
#line 3612 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_set_exposure_date_time (_tmp83_, NULL, PHOTO_METADATA_SET_OPTION_ALL_DOMAINS);
#line 26033 "Photo.c"
	}
#line 3614 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp84_ = export_metadata;
#line 3614 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp84_) {
#line 26039 "Photo.c"
		PhotoMetadata* _tmp85_ = NULL;
		gchar* _tmp86_ = NULL;
		gchar* _tmp87_ = NULL;
		PhotoMetadata* _tmp88_ = NULL;
		gchar* _tmp89_ = NULL;
		gchar* _tmp90_ = NULL;
		PhotoMetadata* _tmp91_ = NULL;
		Dimensions _tmp92_ = {0};
		PhotoMetadata* _tmp93_ = NULL;
		Orientation _tmp94_ = 0;
		PhotoMetadata* _tmp95_ = NULL;
		Orientation _tmp96_ = 0;
		Orientation _tmp97_ = 0;
		PhotoMetadata* _tmp99_ = NULL;
#line 3616 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp85_ = metadata;
#line 3616 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp86_ = media_source_get_title (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 3616 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp87_ = _tmp86_;
#line 3616 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_set_title (_tmp85_, _tmp87_, PHOTO_METADATA_SET_OPTION_ALL_DOMAINS);
#line 3616 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp87_);
#line 3617 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp88_ = metadata;
#line 3617 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp89_ = media_source_get_comment (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 3617 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp90_ = _tmp89_;
#line 3617 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_set_comment (_tmp88_, _tmp90_, PHOTO_METADATA_SET_OPTION_ALL_DOMAINS);
#line 3617 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp90_);
#line 3618 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp91_ = metadata;
#line 3618 "/home/jens/Source/shotwell/src/Photo.vala"
		media_source_get_dimensions (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), PHOTO_EXCEPTION_NONE, &_tmp92_);
#line 3618 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_set_pixel_dimensions (_tmp91_, &_tmp92_, PHOTO_METADATA_SET_OPTION_ALL_DOMAINS);
#line 3619 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp93_ = metadata;
#line 3619 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp94_ = photo_get_orientation (self);
#line 3619 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_set_orientation (_tmp93_, _tmp94_);
#line 3620 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp95_ = metadata;
#line 3620 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_set_software (_tmp95_, RESOURCES_APP_TITLE, RESOURCES_APP_VERSION);
#line 3622 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp96_ = photo_get_orientation (self);
#line 3622 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp97_ = photo_get_original_orientation (self);
#line 3622 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp96_ != _tmp97_) {
#line 26096 "Photo.c"
			PhotoMetadata* _tmp98_ = NULL;
#line 3623 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp98_ = metadata;
#line 3623 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_metadata_remove_exif_thumbnail (_tmp98_);
#line 26102 "Photo.c"
		}
#line 3625 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp99_ = metadata;
#line 3625 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_set_user_metadata_for_export (self, _tmp99_);
#line 26108 "Photo.c"
	} else {
		PhotoMetadata* _tmp100_ = NULL;
#line 3629 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp100_ = metadata;
#line 3629 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_clear (_tmp100_);
#line 26115 "Photo.c"
	}
#line 3631 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp101_ = writer;
#line 3631 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp102_ = metadata;
#line 3631 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_file_metadata_writer_write_metadata (_tmp101_, _tmp102_, &_inner_error_);
#line 3631 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 26125 "Photo.c"
		gboolean _tmp103_ = FALSE;
#line 3631 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3631 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (metadata);
#line 3631 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (writer);
#line 3631 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (dest_file);
#line 3631 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_format_properties_unref0 (format_properties);
#line 3631 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (export_reader);
#line 3631 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp103_;
#line 26141 "Photo.c"
	}
#line 3633 "/home/jens/Source/shotwell/src/Photo.vala"
	result = TRUE;
#line 3633 "/home/jens/Source/shotwell/src/Photo.vala"
	_media_metadata_unref0 (metadata);
#line 3633 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (writer);
#line 3633 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (dest_file);
#line 3633 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_format_properties_unref0 (format_properties);
#line 3633 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (export_reader);
#line 3633 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 26157 "Photo.c"
}


gboolean photo_is_export_required (Photo* self, Scaling* scaling, PhotoFileFormat export_format) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
#line 3639 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 3639 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (scaling != NULL, FALSE);
#line 3640 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = scaling_is_unscaled (scaling);
#line 3640 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp3_) {
#line 3640 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = TRUE;
#line 26177 "Photo.c"
	} else {
		gboolean _tmp4_ = FALSE;
#line 3640 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = photo_has_alterations (self);
#line 3640 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = _tmp4_;
#line 26184 "Photo.c"
	}
#line 3640 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp2_) {
#line 3640 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = TRUE;
#line 26190 "Photo.c"
	} else {
		gboolean _tmp5_ = FALSE;
#line 3640 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = photo_has_user_generated_metadata (self);
#line 3640 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = _tmp5_;
#line 26197 "Photo.c"
	}
#line 3640 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_) {
#line 3640 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = TRUE;
#line 26203 "Photo.c"
	} else {
		PhotoFileFormat _tmp6_ = 0;
		PhotoFileFormat _tmp7_ = 0;
#line 3641 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = export_format;
#line 3641 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = photo_get_file_format (self);
#line 3641 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = _tmp6_ != _tmp7_;
#line 26213 "Photo.c"
	}
#line 3640 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 3640 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 26219 "Photo.c"
}


void photo_export (Photo* self, GFile* dest_file, Scaling* scaling, JpegQuality quality, PhotoFileFormat export_format, gboolean direct_copy_unmodified, gboolean export_metadata, GError** error) {
	gboolean _tmp0_ = FALSE;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp7_ = FALSE;
	PhotoMetadata* metadata = NULL;
	PhotoMetadata* _tmp18_ = NULL;
	PhotoMetadata* _tmp19_ = NULL;
	PhotoFileFormat _tmp22_ = 0;
	gboolean _tmp23_ = FALSE;
	PhotoFileWriter* writer = NULL;
	PhotoFileFormat _tmp25_ = 0;
	GFile* _tmp26_ = NULL;
	gchar* _tmp27_ = NULL;
	gchar* _tmp28_ = NULL;
	PhotoFileWriter* _tmp29_ = NULL;
	PhotoFileWriter* _tmp30_ = NULL;
	gchar* _tmp31_ = NULL;
	gchar* _tmp32_ = NULL;
	PhotoFileWriter* _tmp33_ = NULL;
	gchar* _tmp34_ = NULL;
	gchar* _tmp35_ = NULL;
	PhotoFileFormat _tmp36_ = 0;
	GEnumValue* _tmp37_;
	GdkPixbuf* pixbuf = NULL;
	gboolean _tmp38_ = FALSE;
	PhotoFileFormat _tmp39_ = 0;
	PhotoFileWriter* _tmp49_ = NULL;
	GdkPixbuf* _tmp50_ = NULL;
	JpegQuality _tmp51_ = 0;
	PhotoFileWriter* _tmp52_ = NULL;
	gchar* _tmp53_ = NULL;
	gchar* _tmp54_ = NULL;
	gboolean _tmp55_ = FALSE;
	gboolean _tmp75_ = FALSE;
	PhotoFileFormat _tmp76_ = 0;
	PhotoFileMetadataWriter* _tmp86_ = NULL;
	PhotoFileFormat _tmp87_ = 0;
	GFile* _tmp88_ = NULL;
	gchar* _tmp89_ = NULL;
	gchar* _tmp90_ = NULL;
	PhotoFileMetadataWriter* _tmp91_ = NULL;
	PhotoFileMetadataWriter* _tmp92_ = NULL;
	PhotoFileMetadataWriter* _tmp93_ = NULL;
	PhotoFileMetadataWriter* _tmp94_ = NULL;
	PhotoMetadata* _tmp95_ = NULL;
	GError * _inner_error_ = NULL;
#line 3647 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 3647 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_IS_FILE (dest_file));
#line 3647 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (scaling != NULL);
#line 3649 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = direct_copy_unmodified;
#line 3649 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp0_) {
#line 26281 "Photo.c"
		GFile* _tmp1_ = NULL;
		GFile* _tmp2_ = NULL;
		GFile* _tmp3_ = NULL;
#line 3650 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = media_source_get_master_file (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 3650 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = _tmp1_;
#line 3650 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = dest_file;
#line 3650 "/home/jens/Source/shotwell/src/Photo.vala"
		g_file_copy (_tmp2_, _tmp3_, G_FILE_COPY_OVERWRITE | G_FILE_COPY_TARGET_DEFAULT_PERMS, NULL, NULL, NULL, &_inner_error_);
#line 3650 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp2_);
#line 3650 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3650 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 3650 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 26301 "Photo.c"
		}
#line 3652 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 26305 "Photo.c"
	}
#line 3659 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = scaling_is_unscaled (scaling);
#line 3659 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp7_) {
#line 26311 "Photo.c"
		gboolean _tmp8_ = FALSE;
		gboolean _tmp9_ = FALSE;
#line 3659 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp9_ = photo_has_alterations (self);
#line 3659 "/home/jens/Source/shotwell/src/Photo.vala"
		if (!_tmp9_) {
#line 3659 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = TRUE;
#line 26320 "Photo.c"
		} else {
			gboolean _tmp10_ = FALSE;
#line 3659 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = photo_only_metadata_changed (self);
#line 3659 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = _tmp10_;
#line 26327 "Photo.c"
		}
#line 3659 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = _tmp8_;
#line 26331 "Photo.c"
	} else {
#line 3659 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = FALSE;
#line 26335 "Photo.c"
	}
#line 3659 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp6_) {
#line 26339 "Photo.c"
		PhotoFileFormat _tmp11_ = 0;
		PhotoFileFormat _tmp12_ = 0;
#line 3660 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = export_format;
#line 3660 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = photo_get_file_format (self);
#line 3660 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = _tmp11_ == _tmp12_;
#line 26348 "Photo.c"
	} else {
#line 3659 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = FALSE;
#line 26352 "Photo.c"
	}
#line 3659 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp5_) {
#line 26356 "Photo.c"
		PhotoFileFormat _tmp13_ = 0;
#line 3660 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp13_ = photo_get_file_format (self);
#line 3660 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = _tmp13_ == PHOTO_FILE_FORMAT_JFIF;
#line 26362 "Photo.c"
	} else {
#line 3659 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = FALSE;
#line 26366 "Photo.c"
	}
#line 3659 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp4_) {
#line 26370 "Photo.c"
		gboolean _tmp14_ = FALSE;
		GFile* _tmp15_ = NULL;
		gboolean _tmp16_ = FALSE;
		gboolean _tmp17_ = FALSE;
#line 3661 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp15_ = dest_file;
#line 3661 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = export_metadata;
#line 3661 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp17_ = photo_export_fullsized_backing (self, _tmp15_, _tmp16_, &_inner_error_);
#line 3661 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp14_ = _tmp17_;
#line 3661 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3661 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 3661 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 26389 "Photo.c"
		}
#line 3661 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp14_) {
#line 3662 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 26395 "Photo.c"
		}
	}
#line 3668 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp18_ = photo_source_get_metadata (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_SOURCE, PhotoSource));
#line 3668 "/home/jens/Source/shotwell/src/Photo.vala"
	metadata = _tmp18_;
#line 3669 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp19_ = metadata;
#line 3669 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp19_ == NULL) {
#line 26406 "Photo.c"
		PhotoFileFormat _tmp20_ = 0;
		PhotoMetadata* _tmp21_ = NULL;
#line 3670 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = export_format;
#line 3670 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = photo_file_format_create_metadata (_tmp20_);
#line 3670 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (metadata);
#line 3670 "/home/jens/Source/shotwell/src/Photo.vala"
		metadata = _tmp21_;
#line 26417 "Photo.c"
	}
#line 3672 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_ = export_format;
#line 3672 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp23_ = photo_file_format_can_write (_tmp22_);
#line 3672 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp23_) {
#line 26425 "Photo.c"
		PhotoFileFormat _tmp24_ = 0;
#line 3673 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp24_ = photo_file_format_get_system_default_format ();
#line 3673 "/home/jens/Source/shotwell/src/Photo.vala"
		export_format = _tmp24_;
#line 26431 "Photo.c"
	}
#line 3675 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp25_ = export_format;
#line 3675 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp26_ = dest_file;
#line 3675 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp27_ = g_file_get_path (_tmp26_);
#line 3675 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp28_ = _tmp27_;
#line 3675 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp29_ = photo_file_format_create_writer (_tmp25_, _tmp28_, &_inner_error_);
#line 3675 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp30_ = _tmp29_;
#line 3675 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp28_);
#line 3675 "/home/jens/Source/shotwell/src/Photo.vala"
	writer = _tmp30_;
#line 3675 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3675 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3675 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (metadata);
#line 3675 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 26457 "Photo.c"
	}
#line 3677 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp31_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 3677 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp32_ = _tmp31_;
#line 3677 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp33_ = writer;
#line 3677 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp34_ = photo_file_adapter_get_filepath (G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 3677 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp35_ = _tmp34_;
#line 3677 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp36_ = export_format;
#line 3678 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp37_ = g_enum_get_value (g_type_class_ref (TYPE_PHOTO_FILE_FORMAT), _tmp36_);
#line 3677 "/home/jens/Source/shotwell/src/Photo.vala"
	g_debug ("Photo.vala:3677: Saving transformed version of %s to %s in file format" \
" %s", _tmp32_, _tmp35_, (_tmp37_ != NULL) ? _tmp37_->value_name : NULL);
#line 3677 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp35_);
#line 3677 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp32_);
#line 3684 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp39_ = photo_get_file_format (self);
#line 3684 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp39_ == PHOTO_FILE_FORMAT_JFIF) {
#line 3684 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp38_ = TRUE;
#line 26485 "Photo.c"
	} else {
		PhotoFileFormat _tmp40_ = 0;
#line 3685 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp40_ = photo_get_file_format (self);
#line 3685 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp38_ = _tmp40_ == PHOTO_FILE_FORMAT_RAW;
#line 26492 "Photo.c"
	}
#line 3684 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp38_) {
#line 26496 "Photo.c"
		GdkPixbuf* _tmp41_ = NULL;
		Scaling _tmp42_ = {0};
		GdkPixbuf* _tmp43_ = NULL;
		GdkPixbuf* _tmp44_ = NULL;
#line 3686 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp42_ = *scaling;
#line 3686 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp43_ = photo_get_pixbuf_with_options (self, &_tmp42_, PHOTO_EXCEPTION_ORIENTATION, BACKING_FETCH_MODE_SOURCE, &_inner_error_);
#line 3686 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp41_ = _tmp43_;
#line 3686 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3686 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 3686 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (pixbuf);
#line 3686 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_adapter_unref0 (writer);
#line 3686 "/home/jens/Source/shotwell/src/Photo.vala"
			_media_metadata_unref0 (metadata);
#line 3686 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 26519 "Photo.c"
		}
#line 3686 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp44_ = _tmp41_;
#line 3686 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp41_ = NULL;
#line 3686 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (pixbuf);
#line 3686 "/home/jens/Source/shotwell/src/Photo.vala"
		pixbuf = _tmp44_;
#line 3684 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp41_);
#line 26531 "Photo.c"
	} else {
		GdkPixbuf* _tmp45_ = NULL;
		Scaling _tmp46_ = {0};
		GdkPixbuf* _tmp47_ = NULL;
		GdkPixbuf* _tmp48_ = NULL;
#line 3690 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp46_ = *scaling;
#line 3690 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp47_ = photo_get_pixbuf_with_options (self, &_tmp46_, PHOTO_EXCEPTION_NONE, BACKING_FETCH_MODE_SOURCE, &_inner_error_);
#line 3690 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp45_ = _tmp47_;
#line 3690 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3690 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 3690 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (pixbuf);
#line 3690 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_adapter_unref0 (writer);
#line 3690 "/home/jens/Source/shotwell/src/Photo.vala"
			_media_metadata_unref0 (metadata);
#line 3690 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 26555 "Photo.c"
		}
#line 3690 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp48_ = _tmp45_;
#line 3690 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp45_ = NULL;
#line 3690 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (pixbuf);
#line 3690 "/home/jens/Source/shotwell/src/Photo.vala"
		pixbuf = _tmp48_;
#line 3684 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp45_);
#line 26567 "Photo.c"
	}
#line 3694 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp49_ = writer;
#line 3694 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp50_ = pixbuf;
#line 3694 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp51_ = quality;
#line 3694 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_file_writer_write (_tmp49_, _tmp50_, _tmp51_, &_inner_error_);
#line 3694 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3694 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3694 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (pixbuf);
#line 3694 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (writer);
#line 3694 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (metadata);
#line 3694 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 26589 "Photo.c"
	}
#line 3696 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp52_ = writer;
#line 3696 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp53_ = photo_file_adapter_get_filepath (G_TYPE_CHECK_INSTANCE_CAST (_tmp52_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 3696 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp54_ = _tmp53_;
#line 3696 "/home/jens/Source/shotwell/src/Photo.vala"
	g_debug ("Photo.vala:3696: Setting EXIF for %s", _tmp54_);
#line 3696 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp54_);
#line 3699 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp55_ = export_metadata;
#line 3699 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp55_) {
#line 26605 "Photo.c"
		PhotoMetadata* _tmp56_ = NULL;
		gchar* _tmp57_ = NULL;
		gchar* _tmp58_ = NULL;
		PhotoMetadata* _tmp59_ = NULL;
		gchar* _tmp60_ = NULL;
		gchar* _tmp61_ = NULL;
		PhotoMetadata* _tmp62_ = NULL;
		time_t _tmp63_ = 0;
		PhotoMetadata* _tmp69_ = NULL;
		PhotoMetadata* _tmp70_ = NULL;
		PhotoMetadata* _tmp71_ = NULL;
		gboolean _tmp72_ = FALSE;
#line 3701 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp56_ = metadata;
#line 3701 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp57_ = media_source_get_title (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 3701 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp58_ = _tmp57_;
#line 3701 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_set_title (_tmp56_, _tmp58_, PHOTO_METADATA_SET_OPTION_ALL_DOMAINS);
#line 3701 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp58_);
#line 3702 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp59_ = metadata;
#line 3702 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp60_ = media_source_get_comment (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 3702 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp61_ = _tmp60_;
#line 3702 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_set_comment (_tmp59_, _tmp61_, PHOTO_METADATA_SET_OPTION_ALL_DOMAINS);
#line 3702 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp61_);
#line 3703 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp62_ = metadata;
#line 3703 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_set_software (_tmp62_, RESOURCES_APP_TITLE, RESOURCES_APP_VERSION);
#line 3705 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp63_ = media_source_get_exposure_time (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 3705 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp63_ != ((time_t) 0)) {
#line 26646 "Photo.c"
			PhotoMetadata* _tmp64_ = NULL;
			time_t _tmp65_ = 0;
			MetadataDateTime* _tmp66_ = NULL;
			MetadataDateTime* _tmp67_ = NULL;
#line 3706 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp64_ = metadata;
#line 3706 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp65_ = media_source_get_exposure_time (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 3706 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp66_ = metadata_date_time_new (_tmp65_);
#line 3706 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp67_ = _tmp66_;
#line 3706 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_metadata_set_exposure_date_time (_tmp64_, _tmp67_, PHOTO_METADATA_SET_OPTION_ALL_DOMAINS);
#line 3706 "/home/jens/Source/shotwell/src/Photo.vala"
			_metadata_date_time_unref0 (_tmp67_);
#line 26663 "Photo.c"
		} else {
			PhotoMetadata* _tmp68_ = NULL;
#line 3708 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp68_ = metadata;
#line 3708 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_metadata_set_exposure_date_time (_tmp68_, NULL, PHOTO_METADATA_SET_OPTION_ALL_DOMAINS);
#line 26670 "Photo.c"
		}
#line 3710 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp69_ = metadata;
#line 3710 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_remove_tag (_tmp69_, "Exif.Iop.RelatedImageWidth");
#line 3711 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp70_ = metadata;
#line 3711 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_remove_tag (_tmp70_, "Exif.Iop.RelatedImageHeight");
#line 3712 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp71_ = metadata;
#line 3712 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_remove_exif_thumbnail (_tmp71_);
#line 3714 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp72_ = photo_has_user_generated_metadata (self);
#line 3714 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp72_) {
#line 26688 "Photo.c"
			PhotoMetadata* _tmp73_ = NULL;
#line 3715 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp73_ = metadata;
#line 3715 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_set_user_metadata_for_export (self, _tmp73_);
#line 26694 "Photo.c"
		}
	} else {
		PhotoMetadata* _tmp74_ = NULL;
#line 3719 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp74_ = metadata;
#line 3719 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_clear (_tmp74_);
#line 26702 "Photo.c"
	}
#line 3726 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp76_ = photo_get_file_format (self);
#line 3726 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp76_ == PHOTO_FILE_FORMAT_JFIF) {
#line 3726 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp75_ = TRUE;
#line 26710 "Photo.c"
	} else {
		PhotoFileFormat _tmp77_ = 0;
#line 3727 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp77_ = photo_get_file_format (self);
#line 3727 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp75_ = _tmp77_ == PHOTO_FILE_FORMAT_RAW;
#line 26717 "Photo.c"
	}
#line 3726 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp75_) {
#line 26721 "Photo.c"
		PhotoMetadata* _tmp78_ = NULL;
		Dimensions _tmp79_ = {0};
		PhotoMetadata* _tmp80_ = NULL;
		Orientation _tmp81_ = 0;
#line 3728 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp78_ = metadata;
#line 3728 "/home/jens/Source/shotwell/src/Photo.vala"
		media_source_get_dimensions (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), PHOTO_EXCEPTION_ORIENTATION, &_tmp79_);
#line 3728 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_set_pixel_dimensions (_tmp78_, &_tmp79_, PHOTO_METADATA_SET_OPTION_ALL_DOMAINS);
#line 3729 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp80_ = metadata;
#line 3729 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp81_ = photo_get_orientation (self);
#line 3729 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_set_orientation (_tmp80_, _tmp81_);
#line 26738 "Photo.c"
	} else {
		PhotoMetadata* _tmp82_ = NULL;
		GdkPixbuf* _tmp83_ = NULL;
		Dimensions _tmp84_ = {0};
		PhotoMetadata* _tmp85_ = NULL;
#line 3732 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp82_ = metadata;
#line 3732 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp83_ = pixbuf;
#line 3732 "/home/jens/Source/shotwell/src/Photo.vala"
		dimensions_for_pixbuf (_tmp83_, &_tmp84_);
#line 3732 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_set_pixel_dimensions (_tmp82_, &_tmp84_, PHOTO_METADATA_SET_OPTION_ALL_DOMAINS);
#line 3733 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp85_ = metadata;
#line 3733 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_set_orientation (_tmp85_, ORIENTATION_TOP_LEFT);
#line 26756 "Photo.c"
	}
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp87_ = export_format;
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp88_ = dest_file;
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp89_ = g_file_get_path (_tmp88_);
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp90_ = _tmp89_;
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp91_ = photo_file_format_create_metadata_writer (_tmp87_, _tmp90_, &_inner_error_);
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp92_ = _tmp91_;
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp90_);
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp86_ = _tmp92_;
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (pixbuf);
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (writer);
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (metadata);
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 26786 "Photo.c"
	}
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp93_ = _tmp86_;
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp86_ = NULL;
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp94_ = _tmp93_;
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp95_ = metadata;
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_file_metadata_writer_write_metadata (_tmp94_, _tmp95_, &_inner_error_);
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (_tmp94_);
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (_tmp86_);
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (pixbuf);
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (writer);
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (metadata);
#line 3736 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 26814 "Photo.c"
	}
#line 3647 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (_tmp86_);
#line 3647 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (pixbuf);
#line 3647 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (writer);
#line 3647 "/home/jens/Source/shotwell/src/Photo.vala"
	_media_metadata_unref0 (metadata);
#line 26824 "Photo.c"
}


static GFile* photo_generate_new_editable_file (Photo* self, PhotoFileFormat* file_format, GError** error) {
	PhotoFileFormat _vala_file_format = 0;
	GFile* result = NULL;
	GFile* backing = NULL;
	PhotoFileFormat _tmp4_ = 0;
	gboolean _tmp5_ = FALSE;
	gchar* name = NULL;
	gchar* ext = NULL;
	gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	gboolean _tmp11_ = FALSE;
	const gchar* _tmp12_ = NULL;
	gchar* editable_basename = NULL;
	const gchar* _tmp22_ = NULL;
	const gchar* _tmp23_ = NULL;
	const gchar* _tmp24_ = NULL;
	gchar* _tmp25_ = NULL;
	gboolean collision = FALSE;
	GFile* _tmp26_ = NULL;
	GFile* _tmp27_ = NULL;
	GFile* _tmp28_ = NULL;
	gboolean _tmp29_ = FALSE;
	GFile* _tmp30_ = NULL;
	GFile* _tmp31_ = NULL;
	GFile* _tmp32_ = NULL;
	GError * _inner_error_ = NULL;
#line 3739 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 26858 "Photo.c"
	{
		PhotoRow* _tmp0_ = NULL;
#line 3741 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->row;
#line 3741 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 26865 "Photo.c"
		{
			PhotoFileFormat _tmp1_ = 0;
			GFile* _tmp2_ = NULL;
#line 3742 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = photo_get_file_format (self);
#line 3742 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_file_format = _tmp1_;
#line 3743 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = media_source_get_file (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 3743 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (backing);
#line 3743 "/home/jens/Source/shotwell/src/Photo.vala"
			backing = _tmp2_;
#line 26879 "Photo.c"
		}
		__finally389:
		{
			PhotoRow* _tmp3_ = NULL;
#line 3741 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = self->row;
#line 3741 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 26888 "Photo.c"
		}
#line 3741 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3741 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 3741 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (backing);
#line 3741 "/home/jens/Source/shotwell/src/Photo.vala"
			return NULL;
#line 26898 "Photo.c"
		}
	}
#line 3746 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = _vala_file_format;
#line 3746 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = photo_file_format_can_write (_tmp4_);
#line 3746 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp5_) {
#line 26907 "Photo.c"
		PhotoFileFormat _tmp6_ = 0;
#line 3747 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = photo_file_format_get_system_default_format ();
#line 3747 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_file_format = _tmp6_;
#line 26913 "Photo.c"
	}
#line 3750 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = g_file_get_basename (backing);
#line 3750 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = _tmp7_;
#line 3750 "/home/jens/Source/shotwell/src/Photo.vala"
	disassemble_filename (_tmp8_, &_tmp9_, &_tmp10_);
#line 3750 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (name);
#line 3750 "/home/jens/Source/shotwell/src/Photo.vala"
	name = _tmp9_;
#line 3750 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (ext);
#line 3750 "/home/jens/Source/shotwell/src/Photo.vala"
	ext = _tmp10_;
#line 3750 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp8_);
#line 3752 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = ext;
#line 3752 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp12_ == NULL) {
#line 3752 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = TRUE;
#line 26937 "Photo.c"
	} else {
		PhotoFileFormat _tmp13_ = 0;
		PhotoFileFormatProperties* _tmp14_ = NULL;
		PhotoFileFormatProperties* _tmp15_ = NULL;
		const gchar* _tmp16_ = NULL;
		gboolean _tmp17_ = FALSE;
#line 3752 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp13_ = _vala_file_format;
#line 3752 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp14_ = photo_file_format_get_properties (_tmp13_);
#line 3752 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp15_ = _tmp14_;
#line 3752 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = ext;
#line 3752 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp17_ = photo_file_format_properties_is_recognized_extension (_tmp15_, _tmp16_);
#line 3752 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = !_tmp17_;
#line 3752 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_format_properties_unref0 (_tmp15_);
#line 26958 "Photo.c"
	}
#line 3752 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp11_) {
#line 26962 "Photo.c"
		PhotoFileFormat _tmp18_ = 0;
		PhotoFileFormatProperties* _tmp19_ = NULL;
		PhotoFileFormatProperties* _tmp20_ = NULL;
		gchar* _tmp21_ = NULL;
#line 3753 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp18_ = _vala_file_format;
#line 3753 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp19_ = photo_file_format_get_properties (_tmp18_);
#line 3753 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = _tmp19_;
#line 3753 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = photo_file_format_properties_get_default_extension (_tmp20_);
#line 3753 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (ext);
#line 3753 "/home/jens/Source/shotwell/src/Photo.vala"
		ext = _tmp21_;
#line 3753 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_format_properties_unref0 (_tmp20_);
#line 26981 "Photo.c"
	}
#line 3755 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_ = name;
#line 3755 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp23_ = _ ("modified");
#line 3755 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp24_ = ext;
#line 3755 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp25_ = g_strdup_printf ("%s_%s.%s", _tmp22_, _tmp23_, _tmp24_);
#line 3755 "/home/jens/Source/shotwell/src/Photo.vala"
	editable_basename = _tmp25_;
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp27_ = g_file_get_parent (backing);
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp28_ = _tmp27_;
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp30_ = generate_unique_file (_tmp28_, editable_basename, &_tmp29_, &_inner_error_);
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
	collision = _tmp29_;
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp31_ = _tmp30_;
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp28_);
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp26_ = _tmp31_;
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (editable_basename);
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (ext);
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (name);
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (backing);
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 27021 "Photo.c"
	}
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp32_ = _tmp26_;
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp26_ = NULL;
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp32_;
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp26_);
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (editable_basename);
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (ext);
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (name);
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (backing);
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
	if (file_format) {
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
		*file_format = _vala_file_format;
#line 27043 "Photo.c"
	}
#line 3758 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 27047 "Photo.c"
}


static void _g_object_unref0_ (gpointer var) {
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
#line 27054 "Photo.c"
}


static void _g_list_free__g_object_unref0_ (GList* self) {
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
	g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
	g_list_free (self);
#line 27063 "Photo.c"
}


static gboolean photo_launch_editor (GFile* file, PhotoFileFormat file_format, GError** error) {
	gboolean result = FALSE;
	gchar* _tmp0_ = NULL;
	PhotoFileFormat _tmp1_ = 0;
	gchar* commandline = NULL;
	gchar* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	gboolean _tmp10_ = FALSE;
	GAppInfo* app = NULL;
	GList* files = NULL;
	GFile* _tmp16_ = NULL;
	GFile* _tmp17_ = NULL;
	GAppInfo* _tmp18_ = NULL;
	gchar** argv = NULL;
	gchar** _tmp24_ = NULL;
	gint argv_length1 = 0;
	gint _argv_size_ = 0;
	gchar** _tmp25_ = NULL;
	gint _tmp25__length1 = 0;
	const gchar* _tmp26_ = NULL;
	gchar* _tmp27_ = NULL;
	gchar* _tmp28_ = NULL;
	gchar** _tmp29_ = NULL;
	gint _tmp29__length1 = 0;
	GFile* _tmp30_ = NULL;
	gchar* _tmp31_ = NULL;
	gchar* _tmp32_ = NULL;
	GPid child_pid = 0;
	gboolean _tmp33_ = FALSE;
	gchar** _tmp34_ = NULL;
	gint _tmp34__length1 = 0;
	GPid _tmp35_ = 0;
	gboolean _tmp36_ = FALSE;
	GError * _inner_error_ = NULL;
#line 3761 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_IS_FILE (file), FALSE);
#line 3762 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = file_format;
#line 3762 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_ == PHOTO_FILE_FORMAT_RAW) {
#line 27107 "Photo.c"
		ConfigFacade* _tmp2_ = NULL;
		ConfigFacade* _tmp3_ = NULL;
		gchar* _tmp4_ = NULL;
#line 3762 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = config_facade_get_instance ();
#line 3762 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = _tmp2_;
#line 3762 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = configuration_facade_get_external_raw_app (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
#line 3762 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp0_);
#line 3762 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = _tmp4_;
#line 3762 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp3_);
#line 27123 "Photo.c"
	} else {
		ConfigFacade* _tmp5_ = NULL;
		ConfigFacade* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
#line 3763 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = config_facade_get_instance ();
#line 3763 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = _tmp5_;
#line 3763 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = configuration_facade_get_external_photo_app (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
#line 3763 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp0_);
#line 3763 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = _tmp7_;
#line 3763 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp6_);
#line 27140 "Photo.c"
	}
#line 3762 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = g_strdup (_tmp0_);
#line 3762 "/home/jens/Source/shotwell/src/Photo.vala"
	commandline = _tmp8_;
#line 3765 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = commandline;
#line 3765 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = is_string_empty (_tmp9_);
#line 3765 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp10_) {
#line 3766 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 3766 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (commandline);
#line 3766 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp0_);
#line 3766 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 27160 "Photo.c"
	}
	{
		GAppInfo* _tmp11_ = NULL;
		const gchar* _tmp12_ = NULL;
		GAppInfo* _tmp13_ = NULL;
		GAppInfo* _tmp14_ = NULL;
#line 3770 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = commandline;
#line 3770 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp13_ = g_app_info_create_from_commandline (_tmp12_, "", G_APP_INFO_CREATE_NONE, &_inner_error_);
#line 3770 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = _tmp13_;
#line 3770 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 27175 "Photo.c"
			goto __catch390_g_error;
		}
#line 3770 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp14_ = _tmp11_;
#line 3770 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = NULL;
#line 3770 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (app);
#line 3770 "/home/jens/Source/shotwell/src/Photo.vala"
		app = _tmp14_;
#line 3769 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp11_);
#line 27188 "Photo.c"
	}
	goto __finally390;
	__catch390_g_error:
	{
		GError* er = NULL;
#line 3769 "/home/jens/Source/shotwell/src/Photo.vala"
		er = _inner_error_;
#line 3769 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 3773 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (app);
#line 3773 "/home/jens/Source/shotwell/src/Photo.vala"
		app = NULL;
#line 3769 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (er);
#line 27204 "Photo.c"
	}
	__finally390:
#line 3769 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 27209 "Photo.c"
		gboolean _tmp15_ = FALSE;
#line 3769 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3769 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (app);
#line 3769 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (commandline);
#line 3769 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp0_);
#line 3769 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp15_;
#line 27221 "Photo.c"
	}
#line 3776 "/home/jens/Source/shotwell/src/Photo.vala"
	files = NULL;
#line 3777 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_ = file;
#line 3777 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = _g_object_ref0 (_tmp16_);
#line 3777 "/home/jens/Source/shotwell/src/Photo.vala"
	files = g_list_insert (files, _tmp17_, -1);
#line 3779 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp18_ = app;
#line 3779 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp18_ != NULL) {
#line 27235 "Photo.c"
		gboolean _tmp19_ = FALSE;
		GAppInfo* _tmp20_ = NULL;
		GList* _tmp21_ = NULL;
		gboolean _tmp22_ = FALSE;
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = app;
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = files;
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp22_ = g_app_info_launch (_tmp20_, _tmp21_, NULL, &_inner_error_);
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp19_ = _tmp22_;
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 27250 "Photo.c"
			gboolean _tmp23_ = FALSE;
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
			__g_list_free__g_object_unref0_0 (files);
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (app);
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (commandline);
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (_tmp0_);
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
			return _tmp23_;
#line 27264 "Photo.c"
		}
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
		result = _tmp19_;
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
		__g_list_free__g_object_unref0_0 (files);
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (app);
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (commandline);
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp0_);
#line 3780 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 27278 "Photo.c"
	}
#line 3782 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp24_ = g_new0 (gchar*, 2 + 1);
#line 3782 "/home/jens/Source/shotwell/src/Photo.vala"
	argv = _tmp24_;
#line 3782 "/home/jens/Source/shotwell/src/Photo.vala"
	argv_length1 = 2;
#line 3782 "/home/jens/Source/shotwell/src/Photo.vala"
	_argv_size_ = argv_length1;
#line 3783 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp25_ = argv;
#line 3783 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp25__length1 = argv_length1;
#line 3783 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp26_ = commandline;
#line 3783 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp27_ = g_strdup (_tmp26_);
#line 3783 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp25_[0]);
#line 3783 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp25_[0] = _tmp27_;
#line 3783 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp28_ = _tmp25_[0];
#line 3784 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp29_ = argv;
#line 3784 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp29__length1 = argv_length1;
#line 3784 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp30_ = file;
#line 3784 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp31_ = g_file_get_path (_tmp30_);
#line 3784 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp29_[1]);
#line 3784 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp29_[1] = _tmp31_;
#line 3784 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp32_ = _tmp29_[1];
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp34_ = argv;
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp34__length1 = argv_length1;
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp36_ = g_spawn_async ("/", _tmp34_, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &_tmp35_, &_inner_error_);
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
	child_pid = _tmp35_;
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp33_ = _tmp36_;
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 27328 "Photo.c"
		gboolean _tmp37_ = FALSE;
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
		argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
		__g_list_free__g_object_unref0_0 (files);
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (app);
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (commandline);
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp0_);
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp37_;
#line 27344 "Photo.c"
	}
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp33_;
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
	argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
	__g_list_free__g_object_unref0_0 (files);
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (app);
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (commandline);
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp0_);
#line 3788 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 27360 "Photo.c"
}


void photo_open_with_raw_external_editor (Photo* self, GError** error) {
	GFile* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	PhotoFileFormat _tmp2_ = 0;
	GError * _inner_error_ = NULL;
#line 3798 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 3799 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = media_source_get_master_file (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 3799 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 3799 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_get_master_file_format (self);
#line 3799 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_launch_editor (_tmp1_, _tmp2_, &_inner_error_);
#line 3799 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp1_);
#line 3799 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3799 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3799 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 27387 "Photo.c"
	}
}


void photo_open_with_external_editor (Photo* self, GError** error) {
	GFile* current_editable_file = NULL;
	GFile* create_editable_file = NULL;
	PhotoFileFormat editable_file_format = 0;
	gboolean _tmp15_ = FALSE;
	gboolean _tmp16_ = FALSE;
	GFile* _tmp17_ = NULL;
	gboolean _tmp25_ = FALSE;
	GFile* _tmp26_ = NULL;
	GFile* _tmp44_ = NULL;
	GFileMonitor* _tmp45_ = NULL;
	GFile* _tmp47_ = NULL;
	PhotoFileFormat _tmp48_ = 0;
	GError * _inner_error_ = NULL;
#line 3803 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 3804 "/home/jens/Source/shotwell/src/Photo.vala"
	current_editable_file = NULL;
#line 3805 "/home/jens/Source/shotwell/src/Photo.vala"
	create_editable_file = NULL;
#line 27412 "Photo.c"
	{
		PhotoBackingReaders* _tmp0_ = NULL;
#line 3807 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->readers;
#line 3807 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_readers);
#line 27419 "Photo.c"
		{
			PhotoBackingReaders* _tmp1_ = NULL;
			PhotoFileReader* _tmp2_ = NULL;
			GFile* _tmp6_ = NULL;
#line 3808 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->readers;
#line 3808 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->editable;
#line 3808 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp2_ != NULL) {
#line 27430 "Photo.c"
				PhotoBackingReaders* _tmp3_ = NULL;
				PhotoFileReader* _tmp4_ = NULL;
				GFile* _tmp5_ = NULL;
#line 3809 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->priv->readers;
#line 3809 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = _tmp3_->editable;
#line 3809 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 3809 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (current_editable_file);
#line 3809 "/home/jens/Source/shotwell/src/Photo.vala"
				current_editable_file = _tmp5_;
#line 27444 "Photo.c"
			}
#line 3811 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = current_editable_file;
#line 3811 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp6_ == NULL) {
#line 27450 "Photo.c"
				GFile* _tmp7_ = NULL;
				PhotoFileFormat _tmp8_ = 0;
				GFile* _tmp9_ = NULL;
				GFile* _tmp10_ = NULL;
#line 3812 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = photo_generate_new_editable_file (self, &_tmp8_, &_inner_error_);
#line 3812 "/home/jens/Source/shotwell/src/Photo.vala"
				editable_file_format = _tmp8_;
#line 3812 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = _tmp9_;
#line 3812 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 27463 "Photo.c"
					goto __finally391;
				}
#line 3812 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = _tmp7_;
#line 3812 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = NULL;
#line 3812 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (create_editable_file);
#line 3812 "/home/jens/Source/shotwell/src/Photo.vala"
				create_editable_file = _tmp10_;
#line 3811 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (_tmp7_);
#line 27476 "Photo.c"
			} else {
				PhotoBackingReaders* _tmp11_ = NULL;
				PhotoFileReader* _tmp12_ = NULL;
				PhotoFileFormat _tmp13_ = 0;
#line 3814 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = self->priv->readers;
#line 3814 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = _tmp11_->editable;
#line 3814 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = photo_file_adapter_get_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 3814 "/home/jens/Source/shotwell/src/Photo.vala"
				editable_file_format = _tmp13_;
#line 27489 "Photo.c"
			}
		}
		__finally391:
		{
			PhotoBackingReaders* _tmp14_ = NULL;
#line 3807 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp14_ = self->priv->readers;
#line 3807 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 27499 "Photo.c"
		}
#line 3807 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3807 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 3807 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (create_editable_file);
#line 3807 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (current_editable_file);
#line 3807 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 27511 "Photo.c"
		}
	}
#line 3819 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = create_editable_file;
#line 3819 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp17_ == NULL) {
#line 27518 "Photo.c"
		GFile* _tmp18_ = NULL;
#line 3819 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp18_ = current_editable_file;
#line 3819 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = _tmp18_ != NULL;
#line 27524 "Photo.c"
	} else {
#line 3819 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = FALSE;
#line 27528 "Photo.c"
	}
#line 3819 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp16_) {
#line 27532 "Photo.c"
		gboolean _tmp19_ = FALSE;
		GFile* _tmp20_ = NULL;
		gboolean _tmp21_ = FALSE;
#line 3820 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = current_editable_file;
#line 3820 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = g_file_query_exists (_tmp20_, NULL);
#line 3820 "/home/jens/Source/shotwell/src/Photo.vala"
		if (!_tmp21_) {
#line 3820 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp19_ = TRUE;
#line 27544 "Photo.c"
		} else {
			gboolean _tmp22_ = FALSE;
#line 3820 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp22_ = photo_has_transformations (self);
#line 3820 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp19_ = _tmp22_;
#line 27551 "Photo.c"
		}
#line 3820 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp15_ = _tmp19_;
#line 27555 "Photo.c"
	} else {
#line 3819 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp15_ = FALSE;
#line 27559 "Photo.c"
	}
#line 3819 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp15_) {
#line 27563 "Photo.c"
		GFile* _tmp23_ = NULL;
		GFile* _tmp24_ = NULL;
#line 3821 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp23_ = current_editable_file;
#line 3821 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp24_ = _g_object_ref0 (_tmp23_);
#line 3821 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (create_editable_file);
#line 3821 "/home/jens/Source/shotwell/src/Photo.vala"
		create_editable_file = _tmp24_;
#line 27574 "Photo.c"
	}
#line 3824 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp26_ = create_editable_file;
#line 3824 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp26_ != NULL) {
#line 27580 "Photo.c"
		PhotoFileFormat _tmp27_ = 0;
		gboolean _tmp28_ = FALSE;
#line 3824 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp27_ = editable_file_format;
#line 3824 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp28_ = photo_file_format_can_write (_tmp27_);
#line 3824 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp25_ = _tmp28_;
#line 27589 "Photo.c"
	} else {
#line 3824 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp25_ = FALSE;
#line 27593 "Photo.c"
	}
#line 3824 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp25_) {
#line 27597 "Photo.c"
		PhotoFileFormat _tmp40_ = 0;
		GFile* _tmp41_ = NULL;
		GFile* _tmp42_ = NULL;
		GFile* _tmp43_ = NULL;
#line 3825 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_halt_monitoring_editable (self);
#line 27604 "Photo.c"
		{
			GFile* _tmp29_ = NULL;
			Scaling _tmp30_ = {0};
			PhotoFileFormat _tmp31_ = 0;
#line 3828 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp29_ = create_editable_file;
#line 3828 "/home/jens/Source/shotwell/src/Photo.vala"
			scaling_for_original (&_tmp30_);
#line 3828 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp31_ = editable_file_format;
#line 3828 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_export (self, _tmp29_, &_tmp30_, JPEG_QUALITY_MAXIMUM, _tmp31_, FALSE, TRUE, &_inner_error_);
#line 3828 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 27619 "Photo.c"
				goto __catch392_g_error;
			}
		}
		goto __finally392;
		__catch392_g_error:
		{
			GError* err = NULL;
			GError* _tmp38_ = NULL;
			GError* _tmp39_ = NULL;
#line 3827 "/home/jens/Source/shotwell/src/Photo.vala"
			err = _inner_error_;
#line 3827 "/home/jens/Source/shotwell/src/Photo.vala"
			_inner_error_ = NULL;
#line 27633 "Photo.c"
			{
				GFile* _tmp32_ = NULL;
#line 3833 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp32_ = create_editable_file;
#line 3833 "/home/jens/Source/shotwell/src/Photo.vala"
				g_file_delete (_tmp32_, NULL, &_inner_error_);
#line 3833 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 27642 "Photo.c"
					goto __catch393_g_error;
				}
			}
			goto __finally393;
			__catch393_g_error:
			{
				GError* delete_err = NULL;
				GFile* _tmp33_ = NULL;
				gchar* _tmp34_ = NULL;
				gchar* _tmp35_ = NULL;
				GError* _tmp36_ = NULL;
				const gchar* _tmp37_ = NULL;
#line 3832 "/home/jens/Source/shotwell/src/Photo.vala"
				delete_err = _inner_error_;
#line 3832 "/home/jens/Source/shotwell/src/Photo.vala"
				_inner_error_ = NULL;
#line 3836 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp33_ = create_editable_file;
#line 3836 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp34_ = g_file_get_path (_tmp33_);
#line 3836 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp35_ = _tmp34_;
#line 3836 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp36_ = delete_err;
#line 3836 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp37_ = _tmp36_->message;
#line 3836 "/home/jens/Source/shotwell/src/Photo.vala"
				g_warning ("Photo.vala:3836: Unable to delete editable file %s after export error:" \
" %s", _tmp35_, _tmp37_);
#line 3836 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (_tmp35_);
#line 3832 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_error_free0 (delete_err);
#line 27675 "Photo.c"
			}
			__finally393:
#line 3832 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3832 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_error_free0 (err);
#line 3832 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_error_free0 (err);
#line 3832 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (create_editable_file);
#line 3832 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (current_editable_file);
#line 3832 "/home/jens/Source/shotwell/src/Photo.vala"
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 3832 "/home/jens/Source/shotwell/src/Photo.vala"
				g_clear_error (&_inner_error_);
#line 3832 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 27694 "Photo.c"
			}
#line 3840 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp38_ = err;
#line 3840 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp39_ = _g_error_copy0 (_tmp38_);
#line 3840 "/home/jens/Source/shotwell/src/Photo.vala"
			_inner_error_ = _tmp39_;
#line 3840 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_error_free0 (err);
#line 27704 "Photo.c"
			goto __finally392;
		}
		__finally392:
#line 3827 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3827 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 3827 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (create_editable_file);
#line 3827 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (current_editable_file);
#line 3827 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 27718 "Photo.c"
		}
#line 3844 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp40_ = editable_file_format;
#line 3844 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp41_ = create_editable_file;
#line 3844 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_attach_editable (self, _tmp40_, _tmp41_, &_inner_error_);
#line 3844 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3844 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 3844 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (create_editable_file);
#line 3844 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (current_editable_file);
#line 3844 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 27736 "Photo.c"
		}
#line 3846 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp42_ = create_editable_file;
#line 3846 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp43_ = _g_object_ref0 (_tmp42_);
#line 3846 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (current_editable_file);
#line 3846 "/home/jens/Source/shotwell/src/Photo.vala"
		current_editable_file = _tmp43_;
#line 27746 "Photo.c"
	}
#line 3849 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp44_ = current_editable_file;
#line 3849 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_assert (_tmp44_ != NULL, "current_editable_file != null");
#line 3852 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp45_ = self->priv->editable_monitor;
#line 3852 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp45_ == NULL) {
#line 27756 "Photo.c"
		GFile* _tmp46_ = NULL;
#line 3853 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp46_ = current_editable_file;
#line 3853 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_start_monitoring_editable (self, _tmp46_, &_inner_error_);
#line 3853 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3853 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 3853 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (create_editable_file);
#line 3853 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (current_editable_file);
#line 3853 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 27772 "Photo.c"
		}
	}
#line 3855 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp47_ = current_editable_file;
#line 3855 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp48_ = photo_get_file_format (self);
#line 3855 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_launch_editor (_tmp47_, _tmp48_, &_inner_error_);
#line 3855 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3855 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3855 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (create_editable_file);
#line 3855 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (current_editable_file);
#line 3855 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 27791 "Photo.c"
	}
#line 3803 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (create_editable_file);
#line 3803 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (current_editable_file);
#line 27797 "Photo.c"
}


void photo_revert_to_master (Photo* self, gboolean notify) {
	gboolean _tmp0_ = FALSE;
#line 3858 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 3859 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = notify;
#line 3859 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_detach_editable (self, TRUE, TRUE, _tmp0_);
#line 27809 "Photo.c"
}


static void _photo_on_editable_file_changed_g_file_monitor_changed (GFileMonitor* _sender, GFile* file, GFile* other_file, GFileMonitorEvent event_type, gpointer self) {
#line 3869 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_on_editable_file_changed ((Photo*) self, file, other_file, event_type);
#line 27816 "Photo.c"
}


static void photo_start_monitoring_editable (Photo* self, GFile* file, GError** error) {
	GFile* _tmp0_ = NULL;
	GFileMonitor* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	GFileMonitor* _tmp3_ = NULL;
	GFileMonitor* _tmp4_ = NULL;
	GFileMonitor* _tmp5_ = NULL;
	GError * _inner_error_ = NULL;
#line 3862 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 3862 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_IS_FILE (file));
#line 3863 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_halt_monitoring_editable (self);
#line 3866 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = file;
#line 3866 "/home/jens/Source/shotwell/src/Photo.vala"
	library_monitor_blacklist_file (_tmp0_, "Photo.start_monitoring_editable");
#line 3868 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = file;
#line 3868 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = g_file_monitor (_tmp2_, G_FILE_MONITOR_NONE, NULL, &_inner_error_);
#line 3868 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp3_;
#line 3868 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3868 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3868 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 27850 "Photo.c"
	}
#line 3868 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = _tmp1_;
#line 3868 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = NULL;
#line 3868 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->editable_monitor);
#line 3868 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->editable_monitor = _tmp4_;
#line 3869 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = self->priv->editable_monitor;
#line 3869 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_connect_object (_tmp5_, "changed", (GCallback) _photo_on_editable_file_changed_g_file_monitor_changed, self, 0);
#line 3862 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp1_);
#line 27866 "Photo.c"
}


static void photo_halt_monitoring_editable (Photo* self) {
	GFileMonitor* _tmp0_ = NULL;
	GFile* file = NULL;
	GFile* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	GFileMonitor* _tmp4_ = NULL;
	guint _tmp5_ = 0U;
	GFileMonitor* _tmp6_ = NULL;
#line 3872 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 3873 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = self->priv->editable_monitor;
#line 3873 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp0_ == NULL) {
#line 3874 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 27886 "Photo.c"
	}
#line 3877 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = photo_get_editable_file (self);
#line 3877 "/home/jens/Source/shotwell/src/Photo.vala"
	file = _tmp1_;
#line 3878 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = file;
#line 3878 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp2_ != NULL) {
#line 27896 "Photo.c"
		GFile* _tmp3_ = NULL;
#line 3879 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = file;
#line 3879 "/home/jens/Source/shotwell/src/Photo.vala"
		library_monitor_unblacklist_file (_tmp3_);
#line 27902 "Photo.c"
	}
#line 3881 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = self->priv->editable_monitor;
#line 3881 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_parse_name ("changed", g_file_monitor_get_type (), &_tmp5_, NULL, FALSE);
#line 3881 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_handlers_disconnect_matched (_tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _photo_on_editable_file_changed_g_file_monitor_changed, self);
#line 3882 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = self->priv->editable_monitor;
#line 3882 "/home/jens/Source/shotwell/src/Photo.vala"
	g_file_monitor_cancel (_tmp6_);
#line 3883 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->editable_monitor);
#line 3883 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->editable_monitor = NULL;
#line 3872 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (file);
#line 27920 "Photo.c"
}


static void photo_attach_editable (Photo* self, PhotoFileFormat file_format, GFile* file, GError** error) {
	PhotoFileFormat _tmp0_ = 0;
	GFile* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	PhotoFileReader* _tmp4_ = NULL;
	PhotoFileReader* _tmp5_ = NULL;
	GError * _inner_error_ = NULL;
#line 3886 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 3886 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_IS_FILE (file));
#line 3891 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_internal_remove_all_transformations (self, FALSE);
#line 3892 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = file_format;
#line 3892 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = file;
#line 3892 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = g_file_get_path (_tmp1_);
#line 3892 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp2_;
#line 3892 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = photo_file_format_create_reader (_tmp0_, _tmp3_);
#line 3892 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = _tmp4_;
#line 3892 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_update_editable (self, FALSE, _tmp5_, &_inner_error_);
#line 3892 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (_tmp5_);
#line 3892 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp3_);
#line 3892 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3892 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3892 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 27962 "Photo.c"
	}
}


static void photo_update_editable_attributes (Photo* self, GError** error) {
	GError * _inner_error_ = NULL;
#line 3895 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 3896 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_update_editable (self, TRUE, NULL, &_inner_error_);
#line 3896 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3896 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3896 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 27979 "Photo.c"
	}
}


void photo_reimport_editable (Photo* self, GError** error) {
	GError * _inner_error_ = NULL;
#line 3899 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 3900 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_update_editable (self, FALSE, NULL, &_inner_error_);
#line 3900 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3900 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3900 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 27996 "Photo.c"
	}
}


static void _vala_array_add104 (gchar*** array, int* length, int* size, gchar* value) {
#line 4007 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 4007 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 4007 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 28008 "Photo.c"
	}
#line 4007 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 4007 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 28014 "Photo.c"
}


static void _vala_array_add105 (gchar*** array, int* length, int* size, gchar* value) {
#line 4008 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 4008 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 4008 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 28025 "Photo.c"
	}
#line 4008 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 4008 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 28031 "Photo.c"
}


static void _vala_array_add106 (gchar*** array, int* length, int* size, gchar* value) {
#line 4011 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 4011 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 4011 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 28042 "Photo.c"
	}
#line 4011 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 4011 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 28048 "Photo.c"
}


static void _vala_array_add107 (gchar*** array, int* length, int* size, gchar* value) {
#line 4015 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 4015 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 4015 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 28059 "Photo.c"
	}
#line 4015 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 4015 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 28065 "Photo.c"
}


static void _vala_array_add108 (gchar*** array, int* length, int* size, gchar* value) {
#line 4016 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 4016 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 4016 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 28076 "Photo.c"
	}
#line 4016 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 4016 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 28082 "Photo.c"
}


static void _vala_array_add109 (gchar*** array, int* length, int* size, gchar* value) {
#line 4019 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((*length) == (*size)) {
#line 4019 "/home/jens/Source/shotwell/src/Photo.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 4019 "/home/jens/Source/shotwell/src/Photo.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 28093 "Photo.c"
	}
#line 4019 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[(*length)++] = value;
#line 4019 "/home/jens/Source/shotwell/src/Photo.vala"
	(*array)[*length] = NULL;
#line 28099 "Photo.c"
}


static void photo_update_editable (Photo* self, gboolean only_attributes, PhotoFileReader* new_reader, GError** error) {
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	PhotoFileReader* old_reader = NULL;
	PhotoFileReader* _tmp5_ = NULL;
	PhotoFileReader* _tmp6_ = NULL;
	PhotoFileReader* _tmp7_ = NULL;
	PhotoFileReader* reader = NULL;
	PhotoFileReader* _tmp9_ = NULL;
	PhotoFileReader* _tmp10_ = NULL;
	gboolean timestamp_changed = FALSE;
	gboolean filesize_changed = FALSE;
	gboolean is_new_editable = FALSE;
	BackingPhotoID editable_id = {0};
	BackingPhotoID _tmp11_ = {0};
	GFile* file = NULL;
	PhotoFileReader* _tmp12_ = NULL;
	GFile* _tmp13_ = NULL;
	DetectedPhotoInformation* detected = NULL;
	BackingPhotoRow* backing = NULL;
	GFile* _tmp14_ = NULL;
	DetectedPhotoInformation* _tmp15_ = NULL;
	BackingPhotoRow* _tmp16_ = NULL;
	gboolean _tmp17_ = FALSE;
	gboolean _tmp35_ = FALSE;
	PhotoFileReader* _tmp94_ = NULL;
	gboolean _tmp100_ = FALSE;
	gboolean _tmp101_ = FALSE;
	gchar** alteration_list = NULL;
	gchar** _tmp112_ = NULL;
	gint alteration_list_length1 = 0;
	gint _alteration_list_size_ = 0;
	gboolean _tmp113_ = FALSE;
	gboolean _tmp121_ = FALSE;
	gboolean _tmp122_ = FALSE;
	gchar** _tmp131_ = NULL;
	gint _tmp131__length1 = 0;
	GError * _inner_error_ = NULL;
#line 3905 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 3905 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((new_reader == NULL) || IS_PHOTO_FILE_READER (new_reader));
#line 3907 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = only_attributes;
#line 3907 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp2_) {
#line 28150 "Photo.c"
		PhotoFileReader* _tmp3_ = NULL;
#line 3907 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = new_reader;
#line 3907 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = _tmp3_ == NULL;
#line 28156 "Photo.c"
	} else {
#line 3907 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = FALSE;
#line 28160 "Photo.c"
	}
#line 3907 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_) {
#line 3907 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = TRUE;
#line 28166 "Photo.c"
	} else {
		gboolean _tmp4_ = FALSE;
#line 3907 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = only_attributes;
#line 3907 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = !_tmp4_;
#line 28173 "Photo.c"
	}
#line 3907 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_assert (_tmp0_, "(only_attributes && new_reader == null) || (!only_attributes)");
#line 3909 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = photo_get_editable_reader (self);
#line 3909 "/home/jens/Source/shotwell/src/Photo.vala"
	old_reader = _tmp5_;
#line 3911 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = new_reader;
#line 3911 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = _tmp7_;
#line 3911 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp6_ == NULL) {
#line 28187 "Photo.c"
		PhotoFileReader* _tmp8_ = NULL;
#line 3911 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = old_reader;
#line 3911 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = _tmp8_;
#line 28193 "Photo.c"
	}
#line 3911 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = _photo_file_adapter_ref0 (_tmp6_);
#line 3911 "/home/jens/Source/shotwell/src/Photo.vala"
	reader = _tmp9_;
#line 3912 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = reader;
#line 3912 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp10_ == NULL) {
#line 3913 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_detach_editable (self, FALSE, TRUE, TRUE);
#line 3915 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (reader);
#line 3915 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (old_reader);
#line 3915 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 28211 "Photo.c"
	}
#line 3918 "/home/jens/Source/shotwell/src/Photo.vala"
	timestamp_changed = FALSE;
#line 3919 "/home/jens/Source/shotwell/src/Photo.vala"
	filesize_changed = FALSE;
#line 3920 "/home/jens/Source/shotwell/src/Photo.vala"
	is_new_editable = FALSE;
#line 3922 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_get_editable_id (self, &_tmp11_);
#line 3922 "/home/jens/Source/shotwell/src/Photo.vala"
	editable_id = _tmp11_;
#line 3923 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = reader;
#line 3923 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 3923 "/home/jens/Source/shotwell/src/Photo.vala"
	file = _tmp13_;
#line 3926 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = file;
#line 3926 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_ = photo_query_backing_photo_row (self, _tmp14_, PHOTO_FILE_SNIFFER_OPTIONS_NO_MD5, &_tmp15_, &_inner_error_);
#line 3926 "/home/jens/Source/shotwell/src/Photo.vala"
	_detected_photo_information_unref0 (detected);
#line 3926 "/home/jens/Source/shotwell/src/Photo.vala"
	detected = _tmp15_;
#line 3926 "/home/jens/Source/shotwell/src/Photo.vala"
	backing = _tmp16_;
#line 3926 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3926 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 3926 "/home/jens/Source/shotwell/src/Photo.vala"
		_detected_photo_information_unref0 (detected);
#line 3926 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 3926 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (reader);
#line 3926 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (old_reader);
#line 3926 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 28253 "Photo.c"
	}
#line 3930 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = backing_photo_id_is_invalid (&editable_id);
#line 3930 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp17_) {
#line 28259 "Photo.c"
		BackingPhotoRow* _tmp18_ = NULL;
#line 3932 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp18_ = backing;
#line 3932 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp18_ != NULL) {
#line 28265 "Photo.c"
			BackingPhotoTable* _tmp19_ = NULL;
			BackingPhotoTable* _tmp20_ = NULL;
			BackingPhotoRow* _tmp21_ = NULL;
#line 3933 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp19_ = backing_photo_table_get_instance ();
#line 3933 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp20_ = _tmp19_;
#line 3933 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp21_ = backing;
#line 3933 "/home/jens/Source/shotwell/src/Photo.vala"
			backing_photo_table_add (_tmp20_, _tmp21_, &_inner_error_);
#line 3933 "/home/jens/Source/shotwell/src/Photo.vala"
			_database_table_unref0 (_tmp20_);
#line 3933 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3933 "/home/jens/Source/shotwell/src/Photo.vala"
				g_propagate_error (error, _inner_error_);
#line 3933 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (backing);
#line 3933 "/home/jens/Source/shotwell/src/Photo.vala"
				_detected_photo_information_unref0 (detected);
#line 3933 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (file);
#line 3933 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_file_adapter_unref0 (reader);
#line 3933 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_file_adapter_unref0 (old_reader);
#line 3933 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 28295 "Photo.c"
			}
			{
				PhotoRow* _tmp22_ = NULL;
#line 3934 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp22_ = self->row;
#line 3934 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_lock (&self->priv->__lock_row);
#line 28303 "Photo.c"
				{
					PhotoTable* _tmp23_ = NULL;
					PhotoTable* _tmp24_ = NULL;
					PhotoRow* _tmp25_ = NULL;
					BackingPhotoRow* _tmp26_ = NULL;
					BackingPhotoID _tmp27_ = {0};
					BackingPhotoRow* _tmp28_ = NULL;
					BackingPhotoRow* _tmp29_ = NULL;
					BackingPhotoRow* _tmp30_ = NULL;
					BackingPhotoRow* _tmp31_ = NULL;
					BackingPhotoRow* _tmp32_ = NULL;
					Orientation _tmp33_ = 0;
#line 3935 "/home/jens/Source/shotwell/src/Photo.vala"
					timestamp_changed = TRUE;
#line 3936 "/home/jens/Source/shotwell/src/Photo.vala"
					filesize_changed = TRUE;
#line 3938 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp23_ = photo_table_get_instance ();
#line 3938 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp24_ = _tmp23_;
#line 3938 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp25_ = self->row;
#line 3938 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp26_ = backing;
#line 3938 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp27_ = _tmp26_->id;
#line 3938 "/home/jens/Source/shotwell/src/Photo.vala"
					photo_table_attach_editable (_tmp24_, _tmp25_, &_tmp27_, &_inner_error_);
#line 3938 "/home/jens/Source/shotwell/src/Photo.vala"
					_database_table_unref0 (_tmp24_);
#line 3938 "/home/jens/Source/shotwell/src/Photo.vala"
					if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 28336 "Photo.c"
						goto __finally394;
					}
#line 3939 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp28_ = backing;
#line 3939 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp29_ = _backing_photo_row_ref0 (_tmp28_);
#line 3939 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (self->priv->editable);
#line 3939 "/home/jens/Source/shotwell/src/Photo.vala"
					self->priv->editable = _tmp29_;
#line 3940 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp30_ = self->priv->editable;
#line 3940 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp31_ = _backing_photo_row_ref0 (_tmp30_);
#line 3940 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (self->backing_photo_row);
#line 3940 "/home/jens/Source/shotwell/src/Photo.vala"
					self->backing_photo_row = _tmp31_;
#line 3941 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp32_ = self->backing_photo_row;
#line 3941 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp33_ = _tmp32_->original_orientation;
#line 3941 "/home/jens/Source/shotwell/src/Photo.vala"
					photo_set_orientation (self, _tmp33_);
#line 28361 "Photo.c"
				}
				__finally394:
				{
					PhotoRow* _tmp34_ = NULL;
#line 3934 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp34_ = self->row;
#line 3934 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_row);
#line 28370 "Photo.c"
				}
#line 3934 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3934 "/home/jens/Source/shotwell/src/Photo.vala"
					g_propagate_error (error, _inner_error_);
#line 3934 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (backing);
#line 3934 "/home/jens/Source/shotwell/src/Photo.vala"
					_detected_photo_information_unref0 (detected);
#line 3934 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (file);
#line 3934 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_file_adapter_unref0 (reader);
#line 3934 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_file_adapter_unref0 (old_reader);
#line 3934 "/home/jens/Source/shotwell/src/Photo.vala"
					return;
#line 28388 "Photo.c"
				}
			}
		}
#line 3944 "/home/jens/Source/shotwell/src/Photo.vala"
		is_new_editable = TRUE;
#line 28394 "Photo.c"
	}
#line 3947 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp35_ = only_attributes;
#line 3947 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp35_) {
#line 28400 "Photo.c"
		gboolean _tmp36_ = FALSE;
		GFileInfo* info = NULL;
		GTimeVal timestamp = {0};
		GFileInfo* _tmp45_ = NULL;
		GTimeVal _tmp46_ = {0};
		BackingPhotoTable* _tmp47_ = NULL;
		BackingPhotoTable* _tmp48_ = NULL;
		BackingPhotoID _tmp49_ = {0};
		GTimeVal _tmp50_ = {0};
		glong _tmp51_ = 0L;
		GFileInfo* _tmp52_ = NULL;
		gint64 _tmp53_ = 0LL;
#line 3949 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp36_ = backing_photo_id_is_valid (&editable_id);
#line 3949 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_assert (_tmp36_, "editable_id.is_valid()");
#line 28417 "Photo.c"
		{
			GFileInfo* _tmp37_ = NULL;
			GFile* _tmp38_ = NULL;
			GFileInfo* _tmp39_ = NULL;
			GFileInfo* _tmp40_ = NULL;
#line 3953 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp38_ = file;
#line 3953 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp39_ = g_file_query_filesystem_info (_tmp38_, DIRECTORY_MONITOR_SUPPLIED_ATTRIBUTES, NULL, &_inner_error_);
#line 3953 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp37_ = _tmp39_;
#line 3953 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 28431 "Photo.c"
				goto __catch395_g_error;
			}
#line 3953 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp40_ = _tmp37_;
#line 3953 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp37_ = NULL;
#line 3953 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (info);
#line 3953 "/home/jens/Source/shotwell/src/Photo.vala"
			info = _tmp40_;
#line 3952 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tmp37_);
#line 28444 "Photo.c"
		}
		goto __finally395;
		__catch395_g_error:
		{
			GError* err = NULL;
			gchar* _tmp41_ = NULL;
			gchar* _tmp42_ = NULL;
			GError* _tmp43_ = NULL;
			const gchar* _tmp44_ = NULL;
#line 3952 "/home/jens/Source/shotwell/src/Photo.vala"
			err = _inner_error_;
#line 3952 "/home/jens/Source/shotwell/src/Photo.vala"
			_inner_error_ = NULL;
#line 3955 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp41_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 3955 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp42_ = _tmp41_;
#line 3955 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp43_ = err;
#line 3955 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp44_ = _tmp43_->message;
#line 3955 "/home/jens/Source/shotwell/src/Photo.vala"
			g_warning ("Photo.vala:3955: Unable to read editable filesystem info for %s: %s", _tmp42_, _tmp44_);
#line 3955 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (_tmp42_);
#line 3956 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_detach_editable (self, FALSE, TRUE, TRUE);
#line 3958 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_error_free0 (err);
#line 3958 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (info);
#line 3958 "/home/jens/Source/shotwell/src/Photo.vala"
			_backing_photo_row_unref0 (backing);
#line 3958 "/home/jens/Source/shotwell/src/Photo.vala"
			_detected_photo_information_unref0 (detected);
#line 3958 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (file);
#line 3958 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_adapter_unref0 (reader);
#line 3958 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_adapter_unref0 (old_reader);
#line 3958 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 28488 "Photo.c"
		}
		__finally395:
#line 3952 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3952 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 3952 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (info);
#line 3952 "/home/jens/Source/shotwell/src/Photo.vala"
			_backing_photo_row_unref0 (backing);
#line 3952 "/home/jens/Source/shotwell/src/Photo.vala"
			_detected_photo_information_unref0 (detected);
#line 3952 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (file);
#line 3952 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_adapter_unref0 (reader);
#line 3952 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_adapter_unref0 (old_reader);
#line 3952 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 28509 "Photo.c"
		}
#line 3961 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp45_ = info;
#line 3961 "/home/jens/Source/shotwell/src/Photo.vala"
		g_file_info_get_modification_time (_tmp45_, &_tmp46_);
#line 3961 "/home/jens/Source/shotwell/src/Photo.vala"
		timestamp = _tmp46_;
#line 3963 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp47_ = backing_photo_table_get_instance ();
#line 3963 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp48_ = _tmp47_;
#line 3963 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp49_ = editable_id;
#line 3963 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp50_ = timestamp;
#line 3963 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp51_ = _tmp50_.tv_sec;
#line 3963 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp52_ = info;
#line 3963 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp53_ = g_file_info_get_size (_tmp52_);
#line 3963 "/home/jens/Source/shotwell/src/Photo.vala"
		backing_photo_table_update_attributes (_tmp48_, &_tmp49_, (time_t) _tmp51_, _tmp53_, &_inner_error_);
#line 3963 "/home/jens/Source/shotwell/src/Photo.vala"
		_database_table_unref0 (_tmp48_);
#line 3963 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3963 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 3963 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (info);
#line 3963 "/home/jens/Source/shotwell/src/Photo.vala"
			_backing_photo_row_unref0 (backing);
#line 3963 "/home/jens/Source/shotwell/src/Photo.vala"
			_detected_photo_information_unref0 (detected);
#line 3963 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (file);
#line 3963 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_adapter_unref0 (reader);
#line 3963 "/home/jens/Source/shotwell/src/Photo.vala"
			_photo_file_adapter_unref0 (old_reader);
#line 3963 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 28553 "Photo.c"
		}
		{
			PhotoRow* _tmp54_ = NULL;
#line 3965 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp54_ = self->row;
#line 3965 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_lock (&self->priv->__lock_row);
#line 28561 "Photo.c"
			{
				BackingPhotoRow* _tmp55_ = NULL;
				time_t _tmp56_ = 0;
				GTimeVal _tmp57_ = {0};
				glong _tmp58_ = 0L;
				BackingPhotoRow* _tmp59_ = NULL;
				gint64 _tmp60_ = 0LL;
				GFileInfo* _tmp61_ = NULL;
				gint64 _tmp62_ = 0LL;
				BackingPhotoRow* _tmp63_ = NULL;
				GTimeVal _tmp64_ = {0};
				glong _tmp65_ = 0L;
				BackingPhotoRow* _tmp66_ = NULL;
				GFileInfo* _tmp67_ = NULL;
				gint64 _tmp68_ = 0LL;
#line 3966 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp55_ = self->priv->editable;
#line 3966 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp56_ = _tmp55_->timestamp;
#line 3966 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp57_ = timestamp;
#line 3966 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp58_ = _tmp57_.tv_sec;
#line 3966 "/home/jens/Source/shotwell/src/Photo.vala"
				timestamp_changed = _tmp56_ != ((time_t) _tmp58_);
#line 3967 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp59_ = self->priv->editable;
#line 3967 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp60_ = _tmp59_->filesize;
#line 3967 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp61_ = info;
#line 3967 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp62_ = g_file_info_get_size (_tmp61_);
#line 3967 "/home/jens/Source/shotwell/src/Photo.vala"
				filesize_changed = _tmp60_ != _tmp62_;
#line 3969 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp63_ = self->priv->editable;
#line 3969 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp64_ = timestamp;
#line 3969 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp65_ = _tmp64_.tv_sec;
#line 3969 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp63_->timestamp = (time_t) _tmp65_;
#line 3970 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp66_ = self->priv->editable;
#line 3970 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp67_ = info;
#line 3970 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp68_ = g_file_info_get_size (_tmp67_);
#line 3970 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp66_->filesize = _tmp68_;
#line 28613 "Photo.c"
			}
			__finally396:
			{
				PhotoRow* _tmp69_ = NULL;
#line 3965 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp69_ = self->row;
#line 3965 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_row);
#line 28622 "Photo.c"
			}
#line 3965 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3965 "/home/jens/Source/shotwell/src/Photo.vala"
				g_propagate_error (error, _inner_error_);
#line 3965 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (info);
#line 3965 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (backing);
#line 3965 "/home/jens/Source/shotwell/src/Photo.vala"
				_detected_photo_information_unref0 (detected);
#line 3965 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (file);
#line 3965 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_file_adapter_unref0 (reader);
#line 3965 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_file_adapter_unref0 (old_reader);
#line 3965 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 28642 "Photo.c"
			}
		}
#line 3947 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (info);
#line 28647 "Photo.c"
	} else {
		gboolean _tmp70_ = FALSE;
		gboolean _tmp71_ = FALSE;
#line 3974 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp71_ = backing_photo_id_is_valid (&editable_id);
#line 3974 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp71_) {
#line 28655 "Photo.c"
			gboolean _tmp72_ = FALSE;
#line 3974 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp72_ = is_new_editable;
#line 3974 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp70_ = !_tmp72_;
#line 28661 "Photo.c"
		} else {
#line 3974 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp70_ = FALSE;
#line 28665 "Photo.c"
		}
#line 3974 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp70_) {
#line 28669 "Photo.c"
			BackingPhotoRow* _tmp73_ = NULL;
			BackingPhotoID _tmp74_ = {0};
			BackingPhotoTable* _tmp75_ = NULL;
			BackingPhotoTable* _tmp76_ = NULL;
			BackingPhotoRow* _tmp77_ = NULL;
#line 3979 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp73_ = backing;
#line 3979 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp74_ = editable_id;
#line 3979 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp73_->id = _tmp74_;
#line 3980 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp75_ = backing_photo_table_get_instance ();
#line 3980 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp76_ = _tmp75_;
#line 3980 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp77_ = backing;
#line 3980 "/home/jens/Source/shotwell/src/Photo.vala"
			backing_photo_table_update (_tmp76_, _tmp77_, &_inner_error_);
#line 3980 "/home/jens/Source/shotwell/src/Photo.vala"
			_database_table_unref0 (_tmp76_);
#line 3980 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3980 "/home/jens/Source/shotwell/src/Photo.vala"
				g_propagate_error (error, _inner_error_);
#line 3980 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (backing);
#line 3980 "/home/jens/Source/shotwell/src/Photo.vala"
				_detected_photo_information_unref0 (detected);
#line 3980 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (file);
#line 3980 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_file_adapter_unref0 (reader);
#line 3980 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_file_adapter_unref0 (old_reader);
#line 3980 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 28707 "Photo.c"
			}
			{
				PhotoRow* _tmp78_ = NULL;
#line 3981 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp78_ = self->row;
#line 3981 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_lock (&self->priv->__lock_row);
#line 28715 "Photo.c"
				{
					BackingPhotoRow* _tmp79_ = NULL;
					time_t _tmp80_ = 0;
					BackingPhotoRow* _tmp81_ = NULL;
					time_t _tmp82_ = 0;
					BackingPhotoRow* _tmp83_ = NULL;
					gint64 _tmp84_ = 0LL;
					BackingPhotoRow* _tmp85_ = NULL;
					gint64 _tmp86_ = 0LL;
					BackingPhotoRow* _tmp87_ = NULL;
					BackingPhotoRow* _tmp88_ = NULL;
					BackingPhotoRow* _tmp89_ = NULL;
					BackingPhotoRow* _tmp90_ = NULL;
					BackingPhotoRow* _tmp91_ = NULL;
					Orientation _tmp92_ = 0;
#line 3982 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp79_ = self->priv->editable;
#line 3982 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp80_ = _tmp79_->timestamp;
#line 3982 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp81_ = backing;
#line 3982 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp82_ = _tmp81_->timestamp;
#line 3982 "/home/jens/Source/shotwell/src/Photo.vala"
					timestamp_changed = _tmp80_ != _tmp82_;
#line 3983 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp83_ = self->priv->editable;
#line 3983 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp84_ = _tmp83_->filesize;
#line 3983 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp85_ = backing;
#line 3983 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp86_ = _tmp85_->filesize;
#line 3983 "/home/jens/Source/shotwell/src/Photo.vala"
					filesize_changed = _tmp84_ != _tmp86_;
#line 3985 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp87_ = backing;
#line 3985 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp88_ = _backing_photo_row_ref0 (_tmp87_);
#line 3985 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (self->priv->editable);
#line 3985 "/home/jens/Source/shotwell/src/Photo.vala"
					self->priv->editable = _tmp88_;
#line 3986 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp89_ = self->priv->editable;
#line 3986 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp90_ = _backing_photo_row_ref0 (_tmp89_);
#line 3986 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (self->backing_photo_row);
#line 3986 "/home/jens/Source/shotwell/src/Photo.vala"
					self->backing_photo_row = _tmp90_;
#line 3987 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp91_ = self->backing_photo_row;
#line 3987 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp92_ = _tmp91_->original_orientation;
#line 3987 "/home/jens/Source/shotwell/src/Photo.vala"
					photo_set_orientation (self, _tmp92_);
#line 28773 "Photo.c"
				}
				__finally397:
				{
					PhotoRow* _tmp93_ = NULL;
#line 3981 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp93_ = self->row;
#line 3981 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_row);
#line 28782 "Photo.c"
				}
#line 3981 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3981 "/home/jens/Source/shotwell/src/Photo.vala"
					g_propagate_error (error, _inner_error_);
#line 3981 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (backing);
#line 3981 "/home/jens/Source/shotwell/src/Photo.vala"
					_detected_photo_information_unref0 (detected);
#line 3981 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (file);
#line 3981 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_file_adapter_unref0 (reader);
#line 3981 "/home/jens/Source/shotwell/src/Photo.vala"
					_photo_file_adapter_unref0 (old_reader);
#line 3981 "/home/jens/Source/shotwell/src/Photo.vala"
					return;
#line 28800 "Photo.c"
				}
			}
		}
	}
#line 3993 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp94_ = new_reader;
#line 3993 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp94_ != NULL) {
#line 28809 "Photo.c"
		{
			PhotoBackingReaders* _tmp95_ = NULL;
#line 3994 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp95_ = self->priv->readers;
#line 3994 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_lock (&self->priv->__lock_readers);
#line 28816 "Photo.c"
			{
				PhotoBackingReaders* _tmp96_ = NULL;
				PhotoFileReader* _tmp97_ = NULL;
				PhotoFileReader* _tmp98_ = NULL;
#line 3995 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp96_ = self->priv->readers;
#line 3995 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp97_ = new_reader;
#line 3995 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp98_ = _photo_file_adapter_ref0 (_tmp97_);
#line 3995 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_file_adapter_unref0 (_tmp96_->editable);
#line 3995 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp96_->editable = _tmp98_;
#line 28831 "Photo.c"
			}
			__finally398:
			{
				PhotoBackingReaders* _tmp99_ = NULL;
#line 3994 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp99_ = self->priv->readers;
#line 3994 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 28840 "Photo.c"
			}
#line 3994 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 3994 "/home/jens/Source/shotwell/src/Photo.vala"
				g_propagate_error (error, _inner_error_);
#line 3994 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (backing);
#line 3994 "/home/jens/Source/shotwell/src/Photo.vala"
				_detected_photo_information_unref0 (detected);
#line 3994 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (file);
#line 3994 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_file_adapter_unref0 (reader);
#line 3994 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_file_adapter_unref0 (old_reader);
#line 3994 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 28858 "Photo.c"
			}
		}
	}
#line 3999 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp101_ = only_attributes;
#line 3999 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp101_) {
#line 28866 "Photo.c"
		PhotoFileReader* _tmp102_ = NULL;
		PhotoFileReader* _tmp103_ = NULL;
#line 3999 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp102_ = reader;
#line 3999 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp103_ = old_reader;
#line 3999 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp100_ = _tmp102_ != _tmp103_;
#line 28875 "Photo.c"
	} else {
#line 3999 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp100_ = FALSE;
#line 28879 "Photo.c"
	}
#line 3999 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp100_) {
#line 28883 "Photo.c"
		GFile* _tmp104_ = NULL;
		PhotoFileReader* _tmp105_ = NULL;
		GFile* _tmp108_ = NULL;
		PhotoFileReader* _tmp109_ = NULL;
#line 4000 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_notify_baseline_replaced (self);
#line 4001 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp105_ = old_reader;
#line 4001 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp105_ != NULL) {
#line 28894 "Photo.c"
			PhotoFileReader* _tmp106_ = NULL;
			GFile* _tmp107_ = NULL;
#line 4001 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp106_ = old_reader;
#line 4001 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp107_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp106_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 4001 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tmp104_);
#line 4001 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp104_ = _tmp107_;
#line 28905 "Photo.c"
		} else {
#line 4001 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tmp104_);
#line 4001 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp104_ = NULL;
#line 28911 "Photo.c"
		}
#line 4002 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp109_ = new_reader;
#line 4002 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp109_ != NULL) {
#line 28917 "Photo.c"
			PhotoFileReader* _tmp110_ = NULL;
			GFile* _tmp111_ = NULL;
#line 4002 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp110_ = new_reader;
#line 4002 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp111_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp110_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 4002 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tmp108_);
#line 4002 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp108_ = _tmp111_;
#line 28928 "Photo.c"
		} else {
#line 4002 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tmp108_);
#line 4002 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp108_ = NULL;
#line 28934 "Photo.c"
		}
#line 4001 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_notify_editable_replaced (self, _tmp104_, _tmp108_);
#line 3999 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp108_);
#line 3999 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp104_);
#line 28942 "Photo.c"
	}
#line 4005 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp112_ = g_new0 (gchar*, 0 + 1);
#line 4005 "/home/jens/Source/shotwell/src/Photo.vala"
	alteration_list = _tmp112_;
#line 4005 "/home/jens/Source/shotwell/src/Photo.vala"
	alteration_list_length1 = 0;
#line 4005 "/home/jens/Source/shotwell/src/Photo.vala"
	_alteration_list_size_ = alteration_list_length1;
#line 4006 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp113_ = timestamp_changed;
#line 4006 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp113_) {
#line 28956 "Photo.c"
		gchar** _tmp114_ = NULL;
		gint _tmp114__length1 = 0;
		gchar* _tmp115_ = NULL;
		gchar** _tmp116_ = NULL;
		gint _tmp116__length1 = 0;
		gchar* _tmp117_ = NULL;
		gboolean _tmp118_ = FALSE;
#line 4007 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp114_ = alteration_list;
#line 4007 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp114__length1 = alteration_list_length1;
#line 4007 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp115_ = g_strdup ("metadata:editable-timestamp");
#line 4007 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_array_add104 (&alteration_list, &alteration_list_length1, &_alteration_list_size_, _tmp115_);
#line 4008 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp116_ = alteration_list;
#line 4008 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp116__length1 = alteration_list_length1;
#line 4008 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp117_ = g_strdup ("metadata:baseline-timestamp");
#line 4008 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_array_add105 (&alteration_list, &alteration_list_length1, &_alteration_list_size_, _tmp117_);
#line 4010 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp118_ = photo_is_editable_source (self);
#line 4010 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp118_) {
#line 28984 "Photo.c"
			gchar** _tmp119_ = NULL;
			gint _tmp119__length1 = 0;
			gchar* _tmp120_ = NULL;
#line 4011 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp119_ = alteration_list;
#line 4011 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp119__length1 = alteration_list_length1;
#line 4011 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp120_ = g_strdup ("metadata:source-timestamp");
#line 4011 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_array_add106 (&alteration_list, &alteration_list_length1, &_alteration_list_size_, _tmp120_);
#line 28996 "Photo.c"
		}
	}
#line 4014 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp122_ = filesize_changed;
#line 4014 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp122_) {
#line 4014 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp121_ = TRUE;
#line 29005 "Photo.c"
	} else {
		PhotoFileReader* _tmp123_ = NULL;
#line 4014 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp123_ = new_reader;
#line 4014 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp121_ = _tmp123_ != NULL;
#line 29012 "Photo.c"
	}
#line 4014 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp121_) {
#line 29016 "Photo.c"
		gchar** _tmp124_ = NULL;
		gint _tmp124__length1 = 0;
		gchar* _tmp125_ = NULL;
		gchar** _tmp126_ = NULL;
		gint _tmp126__length1 = 0;
		gchar* _tmp127_ = NULL;
		gboolean _tmp128_ = FALSE;
#line 4015 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp124_ = alteration_list;
#line 4015 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp124__length1 = alteration_list_length1;
#line 4015 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp125_ = g_strdup ("image:editable");
#line 4015 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_array_add107 (&alteration_list, &alteration_list_length1, &_alteration_list_size_, _tmp125_);
#line 4016 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp126_ = alteration_list;
#line 4016 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp126__length1 = alteration_list_length1;
#line 4016 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp127_ = g_strdup ("image:baseline");
#line 4016 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_array_add108 (&alteration_list, &alteration_list_length1, &_alteration_list_size_, _tmp127_);
#line 4018 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp128_ = photo_is_editable_source (self);
#line 4018 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp128_) {
#line 29044 "Photo.c"
			gchar** _tmp129_ = NULL;
			gint _tmp129__length1 = 0;
			gchar* _tmp130_ = NULL;
#line 4019 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp129_ = alteration_list;
#line 4019 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp129__length1 = alteration_list_length1;
#line 4019 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp130_ = g_strdup ("image:source");
#line 4019 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_array_add109 (&alteration_list, &alteration_list_length1, &_alteration_list_size_, _tmp130_);
#line 29056 "Photo.c"
		}
	}
#line 4022 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp131_ = alteration_list;
#line 4022 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp131__length1 = alteration_list_length1;
#line 4022 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp131__length1 > 0) {
#line 29065 "Photo.c"
		gchar** _tmp132_ = NULL;
		gint _tmp132__length1 = 0;
		Alteration* _tmp133_ = NULL;
		Alteration* _tmp134_ = NULL;
#line 4023 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp132_ = alteration_list;
#line 4023 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp132__length1 = alteration_list_length1;
#line 4023 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp133_ = alteration_new_from_array (_tmp132_, _tmp132__length1);
#line 4023 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp134_ = _tmp133_;
#line 4023 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp134_);
#line 4023 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp134_);
#line 29082 "Photo.c"
	}
#line 3905 "/home/jens/Source/shotwell/src/Photo.vala"
	alteration_list = (_vala_array_free (alteration_list, alteration_list_length1, (GDestroyNotify) g_free), NULL);
#line 3905 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (backing);
#line 3905 "/home/jens/Source/shotwell/src/Photo.vala"
	_detected_photo_information_unref0 (detected);
#line 3905 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (file);
#line 3905 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (reader);
#line 3905 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (old_reader);
#line 29096 "Photo.c"
}


static void photo_detach_editable (Photo* self, gboolean delete_editable, gboolean remove_transformations, gboolean notify) {
	gboolean has_editable = FALSE;
	GFile* editable_file = NULL;
	gboolean _tmp8_ = FALSE;
	gboolean _tmp28_ = FALSE;
	gboolean _tmp29_ = FALSE;
	gboolean _tmp31_ = FALSE;
	gboolean _tmp32_ = FALSE;
	gboolean _tmp42_ = FALSE;
	gboolean _tmp43_ = FALSE;
	gboolean _tmp44_ = FALSE;
	GError * _inner_error_ = NULL;
#line 4026 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 4027 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_halt_monitoring_editable (self);
#line 4029 "/home/jens/Source/shotwell/src/Photo.vala"
	has_editable = FALSE;
#line 4030 "/home/jens/Source/shotwell/src/Photo.vala"
	editable_file = NULL;
#line 29120 "Photo.c"
	{
		PhotoBackingReaders* _tmp0_ = NULL;
#line 4031 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->readers;
#line 4031 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_readers);
#line 29127 "Photo.c"
		{
			PhotoBackingReaders* _tmp1_ = NULL;
			PhotoFileReader* _tmp2_ = NULL;
#line 4032 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->readers;
#line 4032 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->editable;
#line 4032 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp2_ != NULL) {
#line 29137 "Photo.c"
				PhotoBackingReaders* _tmp3_ = NULL;
				PhotoFileReader* _tmp4_ = NULL;
				GFile* _tmp5_ = NULL;
				PhotoBackingReaders* _tmp6_ = NULL;
#line 4033 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = self->priv->readers;
#line 4033 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = _tmp3_->editable;
#line 4033 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 4033 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (editable_file);
#line 4033 "/home/jens/Source/shotwell/src/Photo.vala"
				editable_file = _tmp5_;
#line 4034 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = self->priv->readers;
#line 4034 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_file_adapter_unref0 (_tmp6_->editable);
#line 4034 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_->editable = NULL;
#line 4035 "/home/jens/Source/shotwell/src/Photo.vala"
				has_editable = TRUE;
#line 29160 "Photo.c"
			}
		}
		__finally399:
		{
			PhotoBackingReaders* _tmp7_ = NULL;
#line 4031 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = self->priv->readers;
#line 4031 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 29170 "Photo.c"
		}
#line 4031 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 4031 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (editable_file);
#line 4031 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 4031 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 4031 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 29182 "Photo.c"
		}
	}
#line 4039 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = has_editable;
#line 4039 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp8_) {
#line 29189 "Photo.c"
		BackingPhotoID editable_id = {0};
#line 4040 "/home/jens/Source/shotwell/src/Photo.vala"
		backing_photo_id_init (&editable_id, BACKING_PHOTO_ID_INVALID);
#line 29193 "Photo.c"
		{
			{
				PhotoRow* _tmp9_ = NULL;
#line 4042 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = self->row;
#line 4042 "/home/jens/Source/shotwell/src/Photo.vala"
				g_rec_mutex_lock (&self->priv->__lock_row);
#line 29201 "Photo.c"
				{
					PhotoRow* _tmp10_ = NULL;
					BackingPhotoID _tmp11_ = {0};
					gboolean _tmp12_ = FALSE;
					PhotoRow* _tmp16_ = NULL;
					BackingPhotoRow* _tmp17_ = NULL;
					BackingPhotoRow* _tmp18_ = NULL;
#line 4043 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp10_ = self->row;
#line 4043 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp11_ = _tmp10_->editable_id;
#line 4043 "/home/jens/Source/shotwell/src/Photo.vala"
					editable_id = _tmp11_;
#line 4044 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp12_ = backing_photo_id_is_valid (&editable_id);
#line 4044 "/home/jens/Source/shotwell/src/Photo.vala"
					if (_tmp12_) {
#line 29219 "Photo.c"
						PhotoTable* _tmp13_ = NULL;
						PhotoTable* _tmp14_ = NULL;
						PhotoRow* _tmp15_ = NULL;
#line 4045 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp13_ = photo_table_get_instance ();
#line 4045 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp14_ = _tmp13_;
#line 4045 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp15_ = self->row;
#line 4045 "/home/jens/Source/shotwell/src/Photo.vala"
						photo_table_detach_editable (_tmp14_, _tmp15_, &_inner_error_);
#line 4045 "/home/jens/Source/shotwell/src/Photo.vala"
						_database_table_unref0 (_tmp14_);
#line 4045 "/home/jens/Source/shotwell/src/Photo.vala"
						if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 29235 "Photo.c"
							goto __finally401;
						}
					}
#line 4046 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp16_ = self->row;
#line 4046 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp17_ = _tmp16_->master;
#line 4046 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp18_ = _backing_photo_row_ref0 (_tmp17_);
#line 4046 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (self->backing_photo_row);
#line 4046 "/home/jens/Source/shotwell/src/Photo.vala"
					self->backing_photo_row = _tmp18_;
#line 29249 "Photo.c"
				}
				__finally401:
				{
					PhotoRow* _tmp19_ = NULL;
#line 4042 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp19_ = self->row;
#line 4042 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_row);
#line 29258 "Photo.c"
				}
#line 4042 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 4042 "/home/jens/Source/shotwell/src/Photo.vala"
					if (_inner_error_->domain == DATABASE_ERROR) {
#line 29264 "Photo.c"
						goto __catch400_database_error;
					}
#line 4042 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (editable_file);
#line 4042 "/home/jens/Source/shotwell/src/Photo.vala"
					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 4042 "/home/jens/Source/shotwell/src/Photo.vala"
					g_clear_error (&_inner_error_);
#line 4042 "/home/jens/Source/shotwell/src/Photo.vala"
					return;
#line 29275 "Photo.c"
				}
			}
		}
		goto __finally400;
		__catch400_database_error:
		{
			GError* err = NULL;
			GError* _tmp20_ = NULL;
			const gchar* _tmp21_ = NULL;
#line 4041 "/home/jens/Source/shotwell/src/Photo.vala"
			err = _inner_error_;
#line 4041 "/home/jens/Source/shotwell/src/Photo.vala"
			_inner_error_ = NULL;
#line 4049 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp20_ = err;
#line 4049 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp21_ = _tmp20_->message;
#line 4049 "/home/jens/Source/shotwell/src/Photo.vala"
			g_warning ("Photo.vala:4049: Unable to remove editable from PhotoTable: %s", _tmp21_);
#line 4041 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_error_free0 (err);
#line 29297 "Photo.c"
		}
		__finally400:
#line 4041 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 4041 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (editable_file);
#line 4041 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 4041 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 4041 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 29310 "Photo.c"
		}
		{
			gboolean _tmp22_ = FALSE;
#line 4053 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp22_ = backing_photo_id_is_valid (&editable_id);
#line 4053 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp22_) {
#line 29318 "Photo.c"
				BackingPhotoTable* _tmp23_ = NULL;
				BackingPhotoTable* _tmp24_ = NULL;
				BackingPhotoID _tmp25_ = {0};
#line 4054 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp23_ = backing_photo_table_get_instance ();
#line 4054 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp24_ = _tmp23_;
#line 4054 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp25_ = editable_id;
#line 4054 "/home/jens/Source/shotwell/src/Photo.vala"
				backing_photo_table_remove (_tmp24_, &_tmp25_, &_inner_error_);
#line 4054 "/home/jens/Source/shotwell/src/Photo.vala"
				_database_table_unref0 (_tmp24_);
#line 4054 "/home/jens/Source/shotwell/src/Photo.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 4054 "/home/jens/Source/shotwell/src/Photo.vala"
					if (_inner_error_->domain == DATABASE_ERROR) {
#line 29336 "Photo.c"
						goto __catch402_database_error;
					}
#line 4054 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (editable_file);
#line 4054 "/home/jens/Source/shotwell/src/Photo.vala"
					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 4054 "/home/jens/Source/shotwell/src/Photo.vala"
					g_clear_error (&_inner_error_);
#line 4054 "/home/jens/Source/shotwell/src/Photo.vala"
					return;
#line 29347 "Photo.c"
				}
			}
		}
		goto __finally402;
		__catch402_database_error:
		{
			GError* err = NULL;
			GError* _tmp26_ = NULL;
			const gchar* _tmp27_ = NULL;
#line 4052 "/home/jens/Source/shotwell/src/Photo.vala"
			err = _inner_error_;
#line 4052 "/home/jens/Source/shotwell/src/Photo.vala"
			_inner_error_ = NULL;
#line 4056 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp26_ = err;
#line 4056 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp27_ = _tmp26_->message;
#line 4056 "/home/jens/Source/shotwell/src/Photo.vala"
			g_warning ("Photo.vala:4056: Unable to remove editable from BackingPhotoTable: %s", _tmp27_);
#line 4052 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_error_free0 (err);
#line 29369 "Photo.c"
		}
		__finally402:
#line 4052 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 4052 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (editable_file);
#line 4052 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 4052 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 4052 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 29382 "Photo.c"
		}
	}
#line 4060 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp28_ = remove_transformations;
#line 4060 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp28_) {
#line 4061 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_internal_remove_all_transformations (self, FALSE);
#line 29391 "Photo.c"
	}
#line 4063 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp29_ = has_editable;
#line 4063 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp29_) {
#line 29397 "Photo.c"
		GFile* _tmp30_ = NULL;
#line 4064 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_notify_baseline_replaced (self);
#line 4065 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp30_ = editable_file;
#line 4065 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_notify_editable_replaced (self, _tmp30_, NULL);
#line 29405 "Photo.c"
	}
#line 4068 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp32_ = delete_editable;
#line 4068 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp32_) {
#line 29411 "Photo.c"
		GFile* _tmp33_ = NULL;
#line 4068 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp33_ = editable_file;
#line 4068 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp31_ = _tmp33_ != NULL;
#line 29417 "Photo.c"
	} else {
#line 4068 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp31_ = FALSE;
#line 29421 "Photo.c"
	}
#line 4068 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp31_) {
#line 29425 "Photo.c"
		{
			GFile* _tmp34_ = NULL;
#line 4070 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp34_ = editable_file;
#line 4070 "/home/jens/Source/shotwell/src/Photo.vala"
			g_file_trash (_tmp34_, NULL, &_inner_error_);
#line 4070 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 29434 "Photo.c"
				goto __catch403_g_error;
			}
		}
		goto __finally403;
		__catch403_g_error:
		{
			GError* err = NULL;
			GFile* _tmp35_ = NULL;
			gchar* _tmp36_ = NULL;
			gchar* _tmp37_ = NULL;
			gchar* _tmp38_ = NULL;
			gchar* _tmp39_ = NULL;
			GError* _tmp40_ = NULL;
			const gchar* _tmp41_ = NULL;
#line 4069 "/home/jens/Source/shotwell/src/Photo.vala"
			err = _inner_error_;
#line 4069 "/home/jens/Source/shotwell/src/Photo.vala"
			_inner_error_ = NULL;
#line 4072 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp35_ = editable_file;
#line 4072 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp36_ = g_file_get_path (_tmp35_);
#line 4072 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp37_ = _tmp36_;
#line 4072 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp38_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 4072 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp39_ = _tmp38_;
#line 4072 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp40_ = err;
#line 4072 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp41_ = _tmp40_->message;
#line 4072 "/home/jens/Source/shotwell/src/Photo.vala"
			g_warning ("Photo.vala:4072: Unable to trash editable %s for %s: %s", _tmp37_, _tmp39_, _tmp41_);
#line 4072 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (_tmp39_);
#line 4072 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (_tmp37_);
#line 4069 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_error_free0 (err);
#line 29475 "Photo.c"
		}
		__finally403:
#line 4069 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 4069 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (editable_file);
#line 4069 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 4069 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 4069 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 29488 "Photo.c"
		}
	}
#line 4077 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp44_ = has_editable;
#line 4077 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp44_) {
#line 4077 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp43_ = TRUE;
#line 29497 "Photo.c"
	} else {
		gboolean _tmp45_ = FALSE;
#line 4077 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp45_ = remove_transformations;
#line 4077 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp43_ = _tmp45_;
#line 29504 "Photo.c"
	}
#line 4077 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp43_) {
#line 29508 "Photo.c"
		gboolean _tmp46_ = FALSE;
#line 4077 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp46_ = notify;
#line 4077 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp42_ = _tmp46_;
#line 29514 "Photo.c"
	} else {
#line 4077 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp42_ = FALSE;
#line 29518 "Photo.c"
	}
#line 4077 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp42_) {
#line 29522 "Photo.c"
		Alteration* _tmp47_ = NULL;
		Alteration* _tmp48_ = NULL;
#line 4078 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp47_ = alteration_new ("image", "revert");
#line 4078 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp48_ = _tmp47_;
#line 4078 "/home/jens/Source/shotwell/src/Photo.vala"
		data_object_notify_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject), _tmp48_);
#line 4078 "/home/jens/Source/shotwell/src/Photo.vala"
		_alteration_unref0 (_tmp48_);
#line 29533 "Photo.c"
	}
#line 4026 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (editable_file);
#line 29537 "Photo.c"
}


static void _photo_on_reimport_editable_one_shot_callback (gpointer self) {
#line 4100 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_on_reimport_editable ((Photo*) self);
#line 29544 "Photo.c"
}


static void _photo_on_update_editable_attributes_one_shot_callback (gpointer self) {
#line 4109 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_on_update_editable_attributes ((Photo*) self);
#line 29551 "Photo.c"
}


static void _photo_on_remove_editable_one_shot_callback (gpointer self) {
#line 4118 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_on_remove_editable ((Photo*) self);
#line 29558 "Photo.c"
}


static void photo_on_editable_file_changed (Photo* self, GFile* file, GFile* other_file, GFileMonitorEvent event) {
	GFileMonitorEvent _tmp12_ = 0;
	GEnumValue* _tmp13_;
	GFile* _tmp14_ = NULL;
	gchar* _tmp15_ = NULL;
	gchar* _tmp16_ = NULL;
	GFileMonitorEvent _tmp17_ = 0;
	GError * _inner_error_ = NULL;
#line 4081 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 4081 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_IS_FILE (file));
#line 4081 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((other_file == NULL) || G_IS_FILE (other_file));
#line 29576 "Photo.c"
	{
		PhotoBackingReaders* _tmp0_ = NULL;
#line 4083 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->readers;
#line 4083 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_readers);
#line 29583 "Photo.c"
		{
			PhotoBackingReaders* _tmp1_ = NULL;
			PhotoFileReader* _tmp2_ = NULL;
			GFile* _tmp3_ = NULL;
			PhotoBackingReaders* _tmp4_ = NULL;
			PhotoFileReader* _tmp5_ = NULL;
			GFile* _tmp6_ = NULL;
			GFile* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			gboolean _tmp9_ = FALSE;
#line 4084 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = self->priv->readers;
#line 4084 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = _tmp1_->editable;
#line 4084 "/home/jens/Source/shotwell/src/Photo.vala"
			_vala_assert (_tmp2_ != NULL, "readers.editable != null");
#line 4086 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = file;
#line 4086 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->priv->readers;
#line 4086 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = _tmp4_->editable;
#line 4086 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 4086 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = _tmp6_;
#line 4086 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = g_file_equal (_tmp3_, _tmp7_);
#line 4086 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = !_tmp8_;
#line 4086 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tmp7_);
#line 4086 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp9_) {
#line 29618 "Photo.c"
				{
					PhotoBackingReaders* _tmp10_ = NULL;
#line 4083 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp10_ = self->priv->readers;
#line 4083 "/home/jens/Source/shotwell/src/Photo.vala"
					g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 29625 "Photo.c"
				}
#line 4090 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 29629 "Photo.c"
			}
		}
		__finally404:
		{
			PhotoBackingReaders* _tmp11_ = NULL;
#line 4083 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = self->priv->readers;
#line 4083 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_readers);
#line 29639 "Photo.c"
		}
#line 4083 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 4083 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 4083 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 4083 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 29649 "Photo.c"
		}
	}
#line 4094 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = event;
#line 4094 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = g_enum_get_value (g_type_class_ref (g_file_monitor_event_get_type ()), _tmp12_);
#line 4094 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = file;
#line 4094 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = g_file_get_path (_tmp14_);
#line 4094 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_ = _tmp15_;
#line 4094 "/home/jens/Source/shotwell/src/Photo.vala"
	g_debug ("Photo.vala:4094: EDITABLE %s: %s", (_tmp13_ != NULL) ? _tmp13_->value_name : NULL, _tmp16_);
#line 4094 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp16_);
#line 4096 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = event;
#line 4096 "/home/jens/Source/shotwell/src/Photo.vala"
	switch (_tmp17_) {
#line 4096 "/home/jens/Source/shotwell/src/Photo.vala"
		case G_FILE_MONITOR_EVENT_CHANGED:
#line 4096 "/home/jens/Source/shotwell/src/Photo.vala"
		case G_FILE_MONITOR_EVENT_CREATED:
#line 29674 "Photo.c"
		{
			OneShotScheduler* _tmp18_ = NULL;
			OneShotScheduler* _tmp20_ = NULL;
#line 4099 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp18_ = self->priv->reimport_editable_scheduler;
#line 4099 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp18_ == NULL) {
#line 29682 "Photo.c"
				OneShotScheduler* _tmp19_ = NULL;
#line 4100 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp19_ = one_shot_scheduler_new ("Photo.reimport_editable", _photo_on_reimport_editable_one_shot_callback, self);
#line 4100 "/home/jens/Source/shotwell/src/Photo.vala"
				_one_shot_scheduler_unref0 (self->priv->reimport_editable_scheduler);
#line 4100 "/home/jens/Source/shotwell/src/Photo.vala"
				self->priv->reimport_editable_scheduler = _tmp19_;
#line 29690 "Photo.c"
			}
#line 4104 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp20_ = self->priv->reimport_editable_scheduler;
#line 4104 "/home/jens/Source/shotwell/src/Photo.vala"
			one_shot_scheduler_after_timeout (_tmp20_, (guint) 1000, TRUE);
#line 4105 "/home/jens/Source/shotwell/src/Photo.vala"
			break;
#line 29698 "Photo.c"
		}
#line 4096 "/home/jens/Source/shotwell/src/Photo.vala"
		case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED:
#line 29702 "Photo.c"
		{
			OneShotScheduler* _tmp21_ = NULL;
			OneShotScheduler* _tmp23_ = NULL;
#line 4108 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp21_ = self->priv->update_editable_attributes_scheduler;
#line 4108 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp21_ == NULL) {
#line 29710 "Photo.c"
				OneShotScheduler* _tmp22_ = NULL;
#line 4109 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp22_ = one_shot_scheduler_new ("Photo.update_editable_attributes", _photo_on_update_editable_attributes_one_shot_callback, self);
#line 4109 "/home/jens/Source/shotwell/src/Photo.vala"
				_one_shot_scheduler_unref0 (self->priv->update_editable_attributes_scheduler);
#line 4109 "/home/jens/Source/shotwell/src/Photo.vala"
				self->priv->update_editable_attributes_scheduler = _tmp22_;
#line 29718 "Photo.c"
			}
#line 4113 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp23_ = self->priv->update_editable_attributes_scheduler;
#line 4113 "/home/jens/Source/shotwell/src/Photo.vala"
			one_shot_scheduler_after_timeout (_tmp23_, (guint) 1000, TRUE);
#line 4114 "/home/jens/Source/shotwell/src/Photo.vala"
			break;
#line 29726 "Photo.c"
		}
#line 4096 "/home/jens/Source/shotwell/src/Photo.vala"
		case G_FILE_MONITOR_EVENT_DELETED:
#line 29730 "Photo.c"
		{
			OneShotScheduler* _tmp24_ = NULL;
			OneShotScheduler* _tmp26_ = NULL;
#line 4117 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp24_ = self->priv->remove_editable_scheduler;
#line 4117 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp24_ == NULL) {
#line 29738 "Photo.c"
				OneShotScheduler* _tmp25_ = NULL;
#line 4118 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp25_ = one_shot_scheduler_new ("Photo.remove_editable", _photo_on_remove_editable_one_shot_callback, self);
#line 4118 "/home/jens/Source/shotwell/src/Photo.vala"
				_one_shot_scheduler_unref0 (self->priv->remove_editable_scheduler);
#line 4118 "/home/jens/Source/shotwell/src/Photo.vala"
				self->priv->remove_editable_scheduler = _tmp25_;
#line 29746 "Photo.c"
			}
#line 4122 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp26_ = self->priv->remove_editable_scheduler;
#line 4122 "/home/jens/Source/shotwell/src/Photo.vala"
			one_shot_scheduler_after_timeout (_tmp26_, (guint) 3000, TRUE);
#line 4123 "/home/jens/Source/shotwell/src/Photo.vala"
			break;
#line 29754 "Photo.c"
		}
		default:
#line 4096 "/home/jens/Source/shotwell/src/Photo.vala"
		case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
#line 29759 "Photo.c"
		{
#line 4128 "/home/jens/Source/shotwell/src/Photo.vala"
			break;
#line 29763 "Photo.c"
		}
	}
#line 4133 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_discard_prefetched (self);
#line 29768 "Photo.c"
}


static void photo_on_reimport_editable (Photo* self) {
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	GError * _inner_error_ = NULL;
#line 4136 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 4138 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_discard_prefetched (self);
#line 4140 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 4140 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 4140 "/home/jens/Source/shotwell/src/Photo.vala"
	g_debug ("Photo.vala:4140: Reimporting editable for %s", _tmp1_);
#line 4140 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp1_);
#line 29788 "Photo.c"
	{
#line 4142 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_reimport_editable (self, &_inner_error_);
#line 4142 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 29794 "Photo.c"
			goto __catch405_g_error;
		}
	}
	goto __finally405;
	__catch405_g_error:
	{
		GError* err = NULL;
		gchar* _tmp2_ = NULL;
		gchar* _tmp3_ = NULL;
		GError* _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
#line 4141 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 4141 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 4144 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 4144 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = _tmp2_;
#line 4144 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = err;
#line 4144 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = _tmp4_->message;
#line 4144 "/home/jens/Source/shotwell/src/Photo.vala"
		g_warning ("Photo.vala:4144: Unable to reimport photo %s changed by external edito" \
"r: %s", _tmp3_, _tmp5_);
#line 4144 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp3_);
#line 4141 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 29824 "Photo.c"
	}
	__finally405:
#line 4141 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 4141 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 4141 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 4141 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 29835 "Photo.c"
	}
}


static void photo_on_update_editable_attributes (Photo* self) {
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	GError * _inner_error_ = NULL;
#line 4149 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 4150 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 4150 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 4150 "/home/jens/Source/shotwell/src/Photo.vala"
	g_debug ("Photo.vala:4150: Updating editable attributes for %s", _tmp1_);
#line 4150 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp1_);
#line 29854 "Photo.c"
	{
#line 4152 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_update_editable_attributes (self, &_inner_error_);
#line 4152 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 29860 "Photo.c"
			goto __catch406_g_error;
		}
	}
	goto __finally406;
	__catch406_g_error:
	{
		GError* err = NULL;
		GError* _tmp2_ = NULL;
		const gchar* _tmp3_ = NULL;
#line 4151 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 4151 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 4154 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = err;
#line 4154 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = _tmp2_->message;
#line 4154 "/home/jens/Source/shotwell/src/Photo.vala"
		g_warning ("Photo.vala:4154: Unable to update editable attributes: %s", _tmp3_);
#line 4151 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 29882 "Photo.c"
	}
	__finally406:
#line 4151 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 4151 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 4151 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 4151 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 29893 "Photo.c"
	}
}


static void photo_on_remove_editable (Photo* self) {
	PhotoFileReader* reader = NULL;
	PhotoFileReader* _tmp0_ = NULL;
	PhotoFileReader* _tmp1_ = NULL;
	GFile* file = NULL;
	PhotoFileReader* _tmp2_ = NULL;
	GFile* _tmp3_ = NULL;
	GFile* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	gchar* _tmp8_ = NULL;
	gchar* _tmp9_ = NULL;
#line 4158 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 4159 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_editable_reader (self);
#line 4159 "/home/jens/Source/shotwell/src/Photo.vala"
	reader = _tmp0_;
#line 4160 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = reader;
#line 4160 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_ == NULL) {
#line 4161 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (reader);
#line 4161 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 29923 "Photo.c"
	}
#line 4163 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = reader;
#line 4163 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 4163 "/home/jens/Source/shotwell/src/Photo.vala"
	file = _tmp3_;
#line 4164 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = file;
#line 4164 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = g_file_query_exists (_tmp4_, NULL);
#line 4164 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp5_) {
#line 29937 "Photo.c"
		gchar* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
#line 4165 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 4165 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = _tmp6_;
#line 4165 "/home/jens/Source/shotwell/src/Photo.vala"
		g_debug ("Photo.vala:4165: Not removing editable for %s: file exists", _tmp7_);
#line 4165 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp7_);
#line 4167 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (file);
#line 4167 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_file_adapter_unref0 (reader);
#line 4167 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 29954 "Photo.c"
	}
#line 4170 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 4170 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = _tmp8_;
#line 4170 "/home/jens/Source/shotwell/src/Photo.vala"
	g_debug ("Photo.vala:4170: Removing editable for %s: file no longer exists", _tmp9_);
#line 4170 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp9_);
#line 4171 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_detach_editable (self, FALSE, TRUE, TRUE);
#line 4158 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (file);
#line 4158 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (reader);
#line 29970 "Photo.c"
}


void photo_get_original_dimensions (Photo* self, Dimensions* result) {
	Dimensions dim = {0};
	Dimensions _tmp0_ = {0};
	Orientation orientation = 0;
	Orientation _tmp1_ = 0;
	Dimensions _tmp2_ = {0};
	Dimensions _tmp3_ = {0};
#line 4179 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 4180 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_get_raw_dimensions (self, &_tmp0_);
#line 4180 "/home/jens/Source/shotwell/src/Photo.vala"
	dim = _tmp0_;
#line 4181 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = photo_get_orientation (self);
#line 4181 "/home/jens/Source/shotwell/src/Photo.vala"
	orientation = _tmp1_;
#line 4183 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = dim;
#line 4183 "/home/jens/Source/shotwell/src/Photo.vala"
	orientation_rotate_dimensions (orientation, &_tmp2_, &_tmp3_);
#line 4183 "/home/jens/Source/shotwell/src/Photo.vala"
	*result = _tmp3_;
#line 4183 "/home/jens/Source/shotwell/src/Photo.vala"
	return;
#line 29999 "Photo.c"
}


void photo_get_master_dimensions (Photo* self, Dimensions* result) {
	Orientation _tmp0_ = 0;
	Dimensions _tmp1_ = {0};
	Dimensions _tmp2_ = {0};
#line 4187 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 4188 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_original_orientation (self);
#line 4188 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_get_raw_dimensions (self, &_tmp1_);
#line 4188 "/home/jens/Source/shotwell/src/Photo.vala"
	orientation_rotate_dimensions (_tmp0_, &_tmp1_, &_tmp2_);
#line 4188 "/home/jens/Source/shotwell/src/Photo.vala"
	*result = _tmp2_;
#line 4188 "/home/jens/Source/shotwell/src/Photo.vala"
	return;
#line 30019 "Photo.c"
}


gboolean photo_get_crop (Photo* self, Box* crop, PhotoException exceptions) {
	Box _vala_crop = {0};
	gboolean result = FALSE;
	Box raw = {0};
	Box _tmp0_ = {0};
	gboolean _tmp1_ = FALSE;
	Dimensions dim = {0};
	Dimensions _tmp2_ = {0};
	Orientation orientation = 0;
	Orientation _tmp3_ = 0;
	PhotoException _tmp4_ = 0;
	gboolean _tmp5_ = FALSE;
#line 4192 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 4194 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = photo_get_raw_crop (self, &_tmp0_);
#line 4194 "/home/jens/Source/shotwell/src/Photo.vala"
	raw = _tmp0_;
#line 4194 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp1_) {
#line 4195 "/home/jens/Source/shotwell/src/Photo.vala"
		box_init (&_vala_crop, 0, 0, 0, 0);
#line 4197 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 4197 "/home/jens/Source/shotwell/src/Photo.vala"
		if (crop) {
#line 4197 "/home/jens/Source/shotwell/src/Photo.vala"
			*crop = _vala_crop;
#line 30051 "Photo.c"
		}
#line 4197 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 30055 "Photo.c"
	}
#line 4200 "/home/jens/Source/shotwell/src/Photo.vala"
	media_source_get_dimensions (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), PHOTO_EXCEPTION_CROP | PHOTO_EXCEPTION_ORIENTATION, &_tmp2_);
#line 4200 "/home/jens/Source/shotwell/src/Photo.vala"
	dim = _tmp2_;
#line 4201 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = photo_get_orientation (self);
#line 4201 "/home/jens/Source/shotwell/src/Photo.vala"
	orientation = _tmp3_;
#line 4203 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = exceptions;
#line 4203 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = photo_exception_allows (_tmp4_, PHOTO_EXCEPTION_ORIENTATION);
#line 4203 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp5_) {
#line 30071 "Photo.c"
		Orientation _tmp6_ = 0;
		Dimensions _tmp7_ = {0};
		Box _tmp8_ = {0};
		Box _tmp9_ = {0};
#line 4204 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = orientation;
#line 4204 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = dim;
#line 4204 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = raw;
#line 4204 "/home/jens/Source/shotwell/src/Photo.vala"
		orientation_rotate_box (_tmp6_, &_tmp7_, &_tmp8_, &_tmp9_);
#line 4204 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_crop = _tmp9_;
#line 30086 "Photo.c"
	} else {
		Box _tmp10_ = {0};
#line 4206 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp10_ = raw;
#line 4206 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_crop = _tmp10_;
#line 30093 "Photo.c"
	}
#line 4208 "/home/jens/Source/shotwell/src/Photo.vala"
	result = TRUE;
#line 4208 "/home/jens/Source/shotwell/src/Photo.vala"
	if (crop) {
#line 4208 "/home/jens/Source/shotwell/src/Photo.vala"
		*crop = _vala_crop;
#line 30101 "Photo.c"
	}
#line 4208 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 30105 "Photo.c"
}


void photo_set_crop (Photo* self, Box* crop) {
	Dimensions dim = {0};
	Dimensions _tmp0_ = {0};
	Orientation orientation = 0;
	Orientation _tmp1_ = 0;
	Box derotated = {0};
	Dimensions _tmp2_ = {0};
	Box _tmp3_ = {0};
	Box _tmp4_ = {0};
	Box _tmp5_ = {0};
	gint _tmp6_ = 0;
	Dimensions _tmp7_ = {0};
	gint _tmp8_ = 0;
	gint _tmp9_ = 0;
	Box _tmp10_ = {0};
	gint _tmp11_ = 0;
	Box _tmp12_ = {0};
	gint _tmp13_ = 0;
	Dimensions _tmp14_ = {0};
	gint _tmp15_ = 0;
	gint _tmp16_ = 0;
	Box _tmp17_ = {0};
	gint _tmp18_ = 0;
	Dimensions _tmp19_ = {0};
	gint _tmp20_ = 0;
	gint _tmp21_ = 0;
	Box _tmp22_ = {0};
	gint _tmp23_ = 0;
	Box _tmp24_ = {0};
	gint _tmp25_ = 0;
	Dimensions _tmp26_ = {0};
	gint _tmp27_ = 0;
	gint _tmp28_ = 0;
	Box _tmp29_ = {0};
#line 4212 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 4212 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (crop != NULL);
#line 4213 "/home/jens/Source/shotwell/src/Photo.vala"
	media_source_get_dimensions (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), PHOTO_EXCEPTION_CROP | PHOTO_EXCEPTION_ORIENTATION, &_tmp0_);
#line 4213 "/home/jens/Source/shotwell/src/Photo.vala"
	dim = _tmp0_;
#line 4214 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = photo_get_orientation (self);
#line 4214 "/home/jens/Source/shotwell/src/Photo.vala"
	orientation = _tmp1_;
#line 4216 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = dim;
#line 4216 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = *crop;
#line 4216 "/home/jens/Source/shotwell/src/Photo.vala"
	orientation_derotate_box (orientation, &_tmp2_, &_tmp3_, &_tmp4_);
#line 4216 "/home/jens/Source/shotwell/src/Photo.vala"
	derotated = _tmp4_;
#line 4218 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = derotated;
#line 4218 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = _tmp5_.left;
#line 4218 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = dim;
#line 4218 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = _tmp7_.width;
#line 4218 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = CLAMP (_tmp6_, 0, _tmp8_ - 2);
#line 4218 "/home/jens/Source/shotwell/src/Photo.vala"
	derotated.left = _tmp9_;
#line 4219 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = derotated;
#line 4219 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = _tmp10_.right;
#line 4219 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = derotated;
#line 4219 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = _tmp12_.left;
#line 4219 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = dim;
#line 4219 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = _tmp14_.width;
#line 4219 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_ = CLAMP (_tmp11_, _tmp13_, _tmp15_ - 1);
#line 4219 "/home/jens/Source/shotwell/src/Photo.vala"
	derotated.right = _tmp16_;
#line 4221 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = derotated;
#line 4221 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp18_ = _tmp17_.top;
#line 4221 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp19_ = dim;
#line 4221 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp20_ = _tmp19_.height;
#line 4221 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp21_ = CLAMP (_tmp18_, 0, _tmp20_ - 2);
#line 4221 "/home/jens/Source/shotwell/src/Photo.vala"
	derotated.top = _tmp21_;
#line 4222 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_ = derotated;
#line 4222 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp23_ = _tmp22_.bottom;
#line 4222 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp24_ = derotated;
#line 4222 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp25_ = _tmp24_.top;
#line 4222 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp26_ = dim;
#line 4222 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp27_ = _tmp26_.height;
#line 4222 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp28_ = CLAMP (_tmp23_, _tmp25_, _tmp27_ - 1);
#line 4222 "/home/jens/Source/shotwell/src/Photo.vala"
	derotated.bottom = _tmp28_;
#line 4224 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp29_ = derotated;
#line 4224 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_set_raw_crop (self, &_tmp29_);
#line 30223 "Photo.c"
}


gboolean photo_get_straighten (Photo* self, gdouble* theta) {
	gdouble _vala_theta = 0.0;
	gboolean result = FALSE;
	gdouble _tmp0_ = 0.0;
	gboolean _tmp1_ = FALSE;
#line 4227 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 4228 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = photo_get_raw_straighten (self, &_tmp0_);
#line 4228 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_theta = _tmp0_;
#line 4228 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp1_) {
#line 4229 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 4229 "/home/jens/Source/shotwell/src/Photo.vala"
		if (theta) {
#line 4229 "/home/jens/Source/shotwell/src/Photo.vala"
			*theta = _vala_theta;
#line 30246 "Photo.c"
		}
#line 4229 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 30250 "Photo.c"
	}
#line 4231 "/home/jens/Source/shotwell/src/Photo.vala"
	result = TRUE;
#line 4231 "/home/jens/Source/shotwell/src/Photo.vala"
	if (theta) {
#line 4231 "/home/jens/Source/shotwell/src/Photo.vala"
		*theta = _vala_theta;
#line 30258 "Photo.c"
	}
#line 4231 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 30262 "Photo.c"
}


void photo_set_straighten (Photo* self, gdouble theta) {
	gdouble _tmp0_ = 0.0;
#line 4234 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 4235 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = theta;
#line 4235 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_set_raw_straighten (self, _tmp0_);
#line 30274 "Photo.c"
}


static GdkPixbuf* photo_do_redeye (Photo* self, GdkPixbuf* pixbuf, EditingToolsRedeyeInstance* inst) {
	GdkPixbuf* result = NULL;
	gdouble r = 0.0;
	EditingToolsRedeyeInstance _tmp0_ = {0};
	gint _tmp1_ = 0;
	gint* x_insets_first_quadrant = NULL;
	EditingToolsRedeyeInstance _tmp2_ = {0};
	gint _tmp3_ = 0;
	gint* _tmp4_ = NULL;
	gint x_insets_first_quadrant_length1 = 0;
	gint _x_insets_first_quadrant_size_ = 0;
	gint i = 0;
	gint x_bounds_min = 0;
	EditingToolsRedeyeInstance _tmp22_ = {0};
	GdkPoint _tmp23_ = {0};
	gint _tmp24_ = 0;
	EditingToolsRedeyeInstance _tmp25_ = {0};
	gint _tmp26_ = 0;
	gint x_bounds_max = 0;
	EditingToolsRedeyeInstance _tmp27_ = {0};
	GdkPoint _tmp28_ = {0};
	gint _tmp29_ = 0;
	EditingToolsRedeyeInstance _tmp30_ = {0};
	gint _tmp31_ = 0;
	gint ymin = 0;
	EditingToolsRedeyeInstance _tmp32_ = {0};
	GdkPoint _tmp33_ = {0};
	gint _tmp34_ = 0;
	EditingToolsRedeyeInstance _tmp35_ = {0};
	gint _tmp36_ = 0;
	gint _tmp37_ = 0;
	gint _tmp38_ = 0;
	gint ymax = 0;
	EditingToolsRedeyeInstance _tmp40_ = {0};
	GdkPoint _tmp41_ = {0};
	gint _tmp42_ = 0;
	gint _tmp43_ = 0;
	gint _tmp44_ = 0;
	GdkPixbuf* _tmp45_ = NULL;
	gint _tmp46_ = 0;
	gint _tmp47_ = 0;
	gint inset_index = 0;
	EditingToolsRedeyeInstance _tmp88_ = {0};
	GdkPoint _tmp89_ = {0};
	gint _tmp90_ = 0;
	EditingToolsRedeyeInstance _tmp91_ = {0};
	GdkPoint _tmp92_ = {0};
	gint _tmp93_ = 0;
	EditingToolsRedeyeInstance _tmp94_ = {0};
	gint _tmp95_ = 0;
	gint* _tmp96_ = NULL;
	gint _tmp96__length1 = 0;
	GdkPixbuf* _tmp133_ = NULL;
	GdkPixbuf* _tmp134_ = NULL;
#line 4238 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 4238 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
#line 4238 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (inst != NULL, NULL);
#line 4248 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = *inst;
#line 4248 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_.radius;
#line 4248 "/home/jens/Source/shotwell/src/Photo.vala"
	r = (gdouble) _tmp1_;
#line 4249 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = *inst;
#line 4249 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp2_.radius;
#line 4249 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = g_new0 (gint, _tmp3_ + 1);
#line 4249 "/home/jens/Source/shotwell/src/Photo.vala"
	x_insets_first_quadrant = _tmp4_;
#line 4249 "/home/jens/Source/shotwell/src/Photo.vala"
	x_insets_first_quadrant_length1 = _tmp3_ + 1;
#line 4249 "/home/jens/Source/shotwell/src/Photo.vala"
	_x_insets_first_quadrant_size_ = x_insets_first_quadrant_length1;
#line 4251 "/home/jens/Source/shotwell/src/Photo.vala"
	i = 0;
#line 30358 "Photo.c"
	{
		gdouble y = 0.0;
		gdouble _tmp5_ = 0.0;
#line 4252 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = r;
#line 4252 "/home/jens/Source/shotwell/src/Photo.vala"
		y = _tmp5_;
#line 30366 "Photo.c"
		{
			gboolean _tmp6_ = FALSE;
#line 4252 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = TRUE;
#line 4252 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 30373 "Photo.c"
				gdouble _tmp8_ = 0.0;
				gdouble theta = 0.0;
				gdouble _tmp9_ = 0.0;
				gdouble _tmp10_ = 0.0;
				gdouble _tmp11_ = 0.0;
				gint x = 0;
				gdouble _tmp12_ = 0.0;
				gdouble _tmp13_ = 0.0;
				gdouble _tmp14_ = 0.0;
				gint* _tmp15_ = NULL;
				gint _tmp15__length1 = 0;
				gint _tmp16_ = 0;
				EditingToolsRedeyeInstance _tmp17_ = {0};
				gint _tmp18_ = 0;
				gint _tmp19_ = 0;
				gint _tmp20_ = 0;
				gint _tmp21_ = 0;
#line 4252 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp6_) {
#line 30393 "Photo.c"
					gdouble _tmp7_ = 0.0;
#line 4252 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp7_ = y;
#line 4252 "/home/jens/Source/shotwell/src/Photo.vala"
					y = _tmp7_ - 1.0;
#line 30399 "Photo.c"
				}
#line 4252 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = FALSE;
#line 4252 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = y;
#line 4252 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!(_tmp8_ >= 0.0)) {
#line 4252 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 30409 "Photo.c"
				}
#line 4253 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = y;
#line 4253 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = r;
#line 4253 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = asin (_tmp9_ / _tmp10_);
#line 4253 "/home/jens/Source/shotwell/src/Photo.vala"
				theta = _tmp11_;
#line 4254 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = r;
#line 4254 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = theta;
#line 4254 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = cos (_tmp13_);
#line 4254 "/home/jens/Source/shotwell/src/Photo.vala"
				x = (gint) ((_tmp12_ * _tmp14_) + 0.5);
#line 4255 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = x_insets_first_quadrant;
#line 4255 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15__length1 = x_insets_first_quadrant_length1;
#line 4255 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = i;
#line 4255 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp17_ = *inst;
#line 4255 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp18_ = _tmp17_.radius;
#line 4255 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp19_ = x;
#line 4255 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_[_tmp16_] = _tmp18_ - _tmp19_;
#line 4255 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp20_ = _tmp15_[_tmp16_];
#line 4257 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp21_ = i;
#line 4257 "/home/jens/Source/shotwell/src/Photo.vala"
				i = _tmp21_ + 1;
#line 30447 "Photo.c"
			}
		}
	}
#line 4260 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_ = *inst;
#line 4260 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp23_ = _tmp22_.center;
#line 4260 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp24_ = _tmp23_.x;
#line 4260 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp25_ = *inst;
#line 4260 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp26_ = _tmp25_.radius;
#line 4260 "/home/jens/Source/shotwell/src/Photo.vala"
	x_bounds_min = _tmp24_ - _tmp26_;
#line 4261 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp27_ = *inst;
#line 4261 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp28_ = _tmp27_.center;
#line 4261 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp29_ = _tmp28_.x;
#line 4261 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp30_ = *inst;
#line 4261 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp31_ = _tmp30_.radius;
#line 4261 "/home/jens/Source/shotwell/src/Photo.vala"
	x_bounds_max = _tmp29_ + _tmp31_;
#line 4262 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp32_ = *inst;
#line 4262 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp33_ = _tmp32_.center;
#line 4262 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp34_ = _tmp33_.y;
#line 4262 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp35_ = *inst;
#line 4262 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp36_ = _tmp35_.radius;
#line 4262 "/home/jens/Source/shotwell/src/Photo.vala"
	ymin = _tmp34_ - _tmp36_;
#line 4263 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp38_ = ymin;
#line 4263 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp38_ < 0) {
#line 4263 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp37_ = 0;
#line 30493 "Photo.c"
	} else {
		gint _tmp39_ = 0;
#line 4263 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp39_ = ymin;
#line 4263 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp37_ = _tmp39_;
#line 30500 "Photo.c"
	}
#line 4263 "/home/jens/Source/shotwell/src/Photo.vala"
	ymin = _tmp37_;
#line 4264 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp40_ = *inst;
#line 4264 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp41_ = _tmp40_.center;
#line 4264 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp42_ = _tmp41_.y;
#line 4264 "/home/jens/Source/shotwell/src/Photo.vala"
	ymax = _tmp42_;
#line 4265 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp44_ = ymax;
#line 4265 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp45_ = pixbuf;
#line 4265 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp46_ = gdk_pixbuf_get_height (_tmp45_);
#line 4265 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp47_ = _tmp46_;
#line 4265 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp44_ > (_tmp47_ - 1)) {
#line 30522 "Photo.c"
		GdkPixbuf* _tmp48_ = NULL;
		gint _tmp49_ = 0;
		gint _tmp50_ = 0;
#line 4265 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp48_ = pixbuf;
#line 4265 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp49_ = gdk_pixbuf_get_height (_tmp48_);
#line 4265 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp50_ = _tmp49_;
#line 4265 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp43_ = _tmp50_ - 1;
#line 30534 "Photo.c"
	} else {
		gint _tmp51_ = 0;
#line 4265 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp51_ = ymax;
#line 4265 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp43_ = _tmp51_;
#line 30541 "Photo.c"
	}
#line 4265 "/home/jens/Source/shotwell/src/Photo.vala"
	ymax = _tmp43_;
#line 4269 "/home/jens/Source/shotwell/src/Photo.vala"
	inset_index = 0;
#line 30547 "Photo.c"
	{
		gint y_it = 0;
		gint _tmp52_ = 0;
#line 4270 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp52_ = ymin;
#line 4270 "/home/jens/Source/shotwell/src/Photo.vala"
		y_it = _tmp52_;
#line 30555 "Photo.c"
		{
			gboolean _tmp53_ = FALSE;
#line 4270 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp53_ = TRUE;
#line 4270 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 30562 "Photo.c"
				gint _tmp55_ = 0;
				gint _tmp56_ = 0;
				gint xmin = 0;
				gint _tmp57_ = 0;
				gint* _tmp58_ = NULL;
				gint _tmp58__length1 = 0;
				gint _tmp59_ = 0;
				gint _tmp60_ = 0;
				gint _tmp61_ = 0;
				gint _tmp62_ = 0;
				gint xmax = 0;
				gint _tmp64_ = 0;
				gint* _tmp65_ = NULL;
				gint _tmp65__length1 = 0;
				gint _tmp66_ = 0;
				gint _tmp67_ = 0;
				gint _tmp68_ = 0;
				gint _tmp69_ = 0;
				GdkPixbuf* _tmp70_ = NULL;
				gint _tmp71_ = 0;
				gint _tmp72_ = 0;
				gint _tmp87_ = 0;
#line 4270 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp53_) {
#line 30587 "Photo.c"
					gint _tmp54_ = 0;
#line 4270 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp54_ = y_it;
#line 4270 "/home/jens/Source/shotwell/src/Photo.vala"
					y_it = _tmp54_ + 1;
#line 30593 "Photo.c"
				}
#line 4270 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp53_ = FALSE;
#line 4270 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp55_ = y_it;
#line 4270 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp56_ = ymax;
#line 4270 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!(_tmp55_ <= _tmp56_)) {
#line 4270 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 30605 "Photo.c"
				}
#line 4271 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp57_ = x_bounds_min;
#line 4271 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp58_ = x_insets_first_quadrant;
#line 4271 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp58__length1 = x_insets_first_quadrant_length1;
#line 4271 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp59_ = inset_index;
#line 4271 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp60_ = _tmp58_[_tmp59_];
#line 4271 "/home/jens/Source/shotwell/src/Photo.vala"
				xmin = _tmp57_ + _tmp60_;
#line 4272 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp62_ = xmin;
#line 4272 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp62_ < 0) {
#line 4272 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp61_ = 0;
#line 30625 "Photo.c"
				} else {
					gint _tmp63_ = 0;
#line 4272 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp63_ = xmin;
#line 4272 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp61_ = _tmp63_;
#line 30632 "Photo.c"
				}
#line 4272 "/home/jens/Source/shotwell/src/Photo.vala"
				xmin = _tmp61_;
#line 4273 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp64_ = x_bounds_max;
#line 4273 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp65_ = x_insets_first_quadrant;
#line 4273 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp65__length1 = x_insets_first_quadrant_length1;
#line 4273 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp66_ = inset_index;
#line 4273 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp67_ = _tmp65_[_tmp66_];
#line 4273 "/home/jens/Source/shotwell/src/Photo.vala"
				xmax = _tmp64_ - _tmp67_;
#line 4274 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp69_ = xmax;
#line 4274 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp70_ = pixbuf;
#line 4274 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp71_ = gdk_pixbuf_get_width (_tmp70_);
#line 4274 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp72_ = _tmp71_;
#line 4274 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp69_ > (_tmp72_ - 1)) {
#line 30658 "Photo.c"
					GdkPixbuf* _tmp73_ = NULL;
					gint _tmp74_ = 0;
					gint _tmp75_ = 0;
#line 4274 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp73_ = pixbuf;
#line 4274 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp74_ = gdk_pixbuf_get_width (_tmp73_);
#line 4274 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp75_ = _tmp74_;
#line 4274 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp68_ = _tmp75_ - 1;
#line 30670 "Photo.c"
				} else {
					gint _tmp76_ = 0;
#line 4274 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp76_ = xmax;
#line 4274 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp68_ = _tmp76_;
#line 30677 "Photo.c"
				}
#line 4274 "/home/jens/Source/shotwell/src/Photo.vala"
				xmax = _tmp68_;
#line 30681 "Photo.c"
				{
					gint x_it = 0;
					gint _tmp77_ = 0;
#line 4276 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp77_ = xmin;
#line 4276 "/home/jens/Source/shotwell/src/Photo.vala"
					x_it = _tmp77_;
#line 30689 "Photo.c"
					{
						gboolean _tmp78_ = FALSE;
#line 4276 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp78_ = TRUE;
#line 4276 "/home/jens/Source/shotwell/src/Photo.vala"
						while (TRUE) {
#line 30696 "Photo.c"
							gint _tmp80_ = 0;
							gint _tmp81_ = 0;
							GdkPixbuf* _tmp82_ = NULL;
							gint _tmp83_ = 0;
							gint _tmp84_ = 0;
							GdkPixbuf* _tmp85_ = NULL;
							GdkPixbuf* _tmp86_ = NULL;
#line 4276 "/home/jens/Source/shotwell/src/Photo.vala"
							if (!_tmp78_) {
#line 30706 "Photo.c"
								gint _tmp79_ = 0;
#line 4276 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp79_ = x_it;
#line 4276 "/home/jens/Source/shotwell/src/Photo.vala"
								x_it = _tmp79_ + 1;
#line 30712 "Photo.c"
							}
#line 4276 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp78_ = FALSE;
#line 4276 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp80_ = x_it;
#line 4276 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp81_ = xmax;
#line 4276 "/home/jens/Source/shotwell/src/Photo.vala"
							if (!(_tmp80_ <= _tmp81_)) {
#line 4276 "/home/jens/Source/shotwell/src/Photo.vala"
								break;
#line 30724 "Photo.c"
							}
#line 4277 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp82_ = pixbuf;
#line 4277 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp83_ = x_it;
#line 4277 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp84_ = y_it;
#line 4277 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp85_ = photo_red_reduce_pixel (self, _tmp82_, _tmp83_, _tmp84_);
#line 4277 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp86_ = _tmp85_;
#line 4277 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_object_unref0 (_tmp86_);
#line 30738 "Photo.c"
						}
					}
				}
#line 4279 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp87_ = inset_index;
#line 4279 "/home/jens/Source/shotwell/src/Photo.vala"
				inset_index = _tmp87_ + 1;
#line 30746 "Photo.c"
			}
		}
	}
#line 4284 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp88_ = *inst;
#line 4284 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp89_ = _tmp88_.center;
#line 4284 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp90_ = _tmp89_.y;
#line 4284 "/home/jens/Source/shotwell/src/Photo.vala"
	ymin = _tmp90_;
#line 4285 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp91_ = *inst;
#line 4285 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp92_ = _tmp91_.center;
#line 4285 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp93_ = _tmp92_.y;
#line 4285 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp94_ = *inst;
#line 4285 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp95_ = _tmp94_.radius;
#line 4285 "/home/jens/Source/shotwell/src/Photo.vala"
	ymax = _tmp93_ + _tmp95_;
#line 4286 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp96_ = x_insets_first_quadrant;
#line 4286 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp96__length1 = x_insets_first_quadrant_length1;
#line 4286 "/home/jens/Source/shotwell/src/Photo.vala"
	inset_index = _tmp96__length1 - 1;
#line 30776 "Photo.c"
	{
		gint y_it = 0;
		gint _tmp97_ = 0;
#line 4287 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp97_ = ymin;
#line 4287 "/home/jens/Source/shotwell/src/Photo.vala"
		y_it = _tmp97_;
#line 30784 "Photo.c"
		{
			gboolean _tmp98_ = FALSE;
#line 4287 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp98_ = TRUE;
#line 4287 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 30791 "Photo.c"
				gint _tmp100_ = 0;
				gint _tmp101_ = 0;
				gint xmin = 0;
				gint _tmp102_ = 0;
				gint* _tmp103_ = NULL;
				gint _tmp103__length1 = 0;
				gint _tmp104_ = 0;
				gint _tmp105_ = 0;
				gint _tmp106_ = 0;
				gint _tmp107_ = 0;
				gint xmax = 0;
				gint _tmp109_ = 0;
				gint* _tmp110_ = NULL;
				gint _tmp110__length1 = 0;
				gint _tmp111_ = 0;
				gint _tmp112_ = 0;
				gint _tmp113_ = 0;
				gint _tmp114_ = 0;
				GdkPixbuf* _tmp115_ = NULL;
				gint _tmp116_ = 0;
				gint _tmp117_ = 0;
				gint _tmp132_ = 0;
#line 4287 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp98_) {
#line 30816 "Photo.c"
					gint _tmp99_ = 0;
#line 4287 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp99_ = y_it;
#line 4287 "/home/jens/Source/shotwell/src/Photo.vala"
					y_it = _tmp99_ + 1;
#line 30822 "Photo.c"
				}
#line 4287 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp98_ = FALSE;
#line 4287 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp100_ = y_it;
#line 4287 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp101_ = ymax;
#line 4287 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!(_tmp100_ <= _tmp101_)) {
#line 4287 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 30834 "Photo.c"
				}
#line 4288 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp102_ = x_bounds_min;
#line 4288 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp103_ = x_insets_first_quadrant;
#line 4288 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp103__length1 = x_insets_first_quadrant_length1;
#line 4288 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp104_ = inset_index;
#line 4288 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp105_ = _tmp103_[_tmp104_];
#line 4288 "/home/jens/Source/shotwell/src/Photo.vala"
				xmin = _tmp102_ + _tmp105_;
#line 4289 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp107_ = xmin;
#line 4289 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp107_ < 0) {
#line 4289 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp106_ = 0;
#line 30854 "Photo.c"
				} else {
					gint _tmp108_ = 0;
#line 4289 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp108_ = xmin;
#line 4289 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp106_ = _tmp108_;
#line 30861 "Photo.c"
				}
#line 4289 "/home/jens/Source/shotwell/src/Photo.vala"
				xmin = _tmp106_;
#line 4290 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp109_ = x_bounds_max;
#line 4290 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp110_ = x_insets_first_quadrant;
#line 4290 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp110__length1 = x_insets_first_quadrant_length1;
#line 4290 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp111_ = inset_index;
#line 4290 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp112_ = _tmp110_[_tmp111_];
#line 4290 "/home/jens/Source/shotwell/src/Photo.vala"
				xmax = _tmp109_ - _tmp112_;
#line 4291 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp114_ = xmax;
#line 4291 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp115_ = pixbuf;
#line 4291 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp116_ = gdk_pixbuf_get_width (_tmp115_);
#line 4291 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp117_ = _tmp116_;
#line 4291 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp114_ > (_tmp117_ - 1)) {
#line 30887 "Photo.c"
					GdkPixbuf* _tmp118_ = NULL;
					gint _tmp119_ = 0;
					gint _tmp120_ = 0;
#line 4291 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp118_ = pixbuf;
#line 4291 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp119_ = gdk_pixbuf_get_width (_tmp118_);
#line 4291 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp120_ = _tmp119_;
#line 4291 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp113_ = _tmp120_ - 1;
#line 30899 "Photo.c"
				} else {
					gint _tmp121_ = 0;
#line 4291 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp121_ = xmax;
#line 4291 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp113_ = _tmp121_;
#line 30906 "Photo.c"
				}
#line 4291 "/home/jens/Source/shotwell/src/Photo.vala"
				xmax = _tmp113_;
#line 30910 "Photo.c"
				{
					gint x_it = 0;
					gint _tmp122_ = 0;
#line 4293 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp122_ = xmin;
#line 4293 "/home/jens/Source/shotwell/src/Photo.vala"
					x_it = _tmp122_;
#line 30918 "Photo.c"
					{
						gboolean _tmp123_ = FALSE;
#line 4293 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp123_ = TRUE;
#line 4293 "/home/jens/Source/shotwell/src/Photo.vala"
						while (TRUE) {
#line 30925 "Photo.c"
							gint _tmp125_ = 0;
							gint _tmp126_ = 0;
							GdkPixbuf* _tmp127_ = NULL;
							gint _tmp128_ = 0;
							gint _tmp129_ = 0;
							GdkPixbuf* _tmp130_ = NULL;
							GdkPixbuf* _tmp131_ = NULL;
#line 4293 "/home/jens/Source/shotwell/src/Photo.vala"
							if (!_tmp123_) {
#line 30935 "Photo.c"
								gint _tmp124_ = 0;
#line 4293 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp124_ = x_it;
#line 4293 "/home/jens/Source/shotwell/src/Photo.vala"
								x_it = _tmp124_ + 1;
#line 30941 "Photo.c"
							}
#line 4293 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp123_ = FALSE;
#line 4293 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp125_ = x_it;
#line 4293 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp126_ = xmax;
#line 4293 "/home/jens/Source/shotwell/src/Photo.vala"
							if (!(_tmp125_ <= _tmp126_)) {
#line 4293 "/home/jens/Source/shotwell/src/Photo.vala"
								break;
#line 30953 "Photo.c"
							}
#line 4294 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp127_ = pixbuf;
#line 4294 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp128_ = x_it;
#line 4294 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp129_ = y_it;
#line 4294 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp130_ = photo_red_reduce_pixel (self, _tmp127_, _tmp128_, _tmp129_);
#line 4294 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp131_ = _tmp130_;
#line 4294 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_object_unref0 (_tmp131_);
#line 30967 "Photo.c"
						}
					}
				}
#line 4296 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp132_ = inset_index;
#line 4296 "/home/jens/Source/shotwell/src/Photo.vala"
				inset_index = _tmp132_ - 1;
#line 30975 "Photo.c"
			}
		}
	}
#line 4299 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp133_ = pixbuf;
#line 4299 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp134_ = _g_object_ref0 (_tmp133_);
#line 4299 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp134_;
#line 4299 "/home/jens/Source/shotwell/src/Photo.vala"
	x_insets_first_quadrant = (g_free (x_insets_first_quadrant), NULL);
#line 4299 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 30989 "Photo.c"
}


static GdkPixbuf* photo_red_reduce_pixel (Photo* self, GdkPixbuf* pixbuf, gint x, gint y) {
	GdkPixbuf* result = NULL;
	gint px_start_byte_offset = 0;
	gint _tmp0_ = 0;
	GdkPixbuf* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	GdkPixbuf* _tmp4_ = NULL;
	gint _tmp5_ = 0;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp7_ = FALSE;
	gboolean _tmp8_ = FALSE;
	gint _tmp9_ = 0;
	GdkPixbuf* _tmp33_ = NULL;
	GdkPixbuf* _tmp34_ = NULL;
#line 4302 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 4302 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
#line 4303 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = y;
#line 4303 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = pixbuf;
#line 4303 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = gdk_pixbuf_get_rowstride (_tmp1_);
#line 4303 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = x;
#line 4303 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = pixbuf;
#line 4303 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = gdk_pixbuf_get_n_channels (_tmp4_);
#line 4303 "/home/jens/Source/shotwell/src/Photo.vala"
	px_start_byte_offset = (_tmp0_ * _tmp2_) + (_tmp3_ * _tmp5_);
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = x;
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp9_ >= 0) {
#line 31030 "Photo.c"
		gint _tmp10_ = 0;
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp10_ = y;
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = _tmp10_ >= 0;
#line 31036 "Photo.c"
	} else {
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = FALSE;
#line 31040 "Photo.c"
	}
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp8_) {
#line 31044 "Photo.c"
		gint _tmp11_ = 0;
		GdkPixbuf* _tmp12_ = NULL;
		gint _tmp13_ = 0;
		gint _tmp14_ = 0;
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = x;
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = pixbuf;
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp13_ = gdk_pixbuf_get_width (_tmp12_);
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp14_ = _tmp13_;
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = _tmp11_ < _tmp14_;
#line 31059 "Photo.c"
	} else {
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = FALSE;
#line 31063 "Photo.c"
	}
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp7_) {
#line 31067 "Photo.c"
		gint _tmp15_ = 0;
		GdkPixbuf* _tmp16_ = NULL;
		gint _tmp17_ = 0;
		gint _tmp18_ = 0;
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp15_ = y;
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = pixbuf;
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp17_ = gdk_pixbuf_get_height (_tmp16_);
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp18_ = _tmp17_;
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = _tmp15_ < _tmp18_;
#line 31082 "Photo.c"
	} else {
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = FALSE;
#line 31086 "Photo.c"
	}
#line 4310 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp6_) {
#line 31090 "Photo.c"
		guchar* pixel_data = NULL;
		GdkPixbuf* _tmp19_ = NULL;
		guint8* _tmp20_ = NULL;
		gint pixel_data_length1 = 0;
		gint _pixel_data_size_ = 0;
		guchar g = '\0';
		guchar* _tmp21_ = NULL;
		gint _tmp21__length1 = 0;
		gint _tmp22_ = 0;
		guchar _tmp23_ = '\0';
		guchar b = '\0';
		guchar* _tmp24_ = NULL;
		gint _tmp24__length1 = 0;
		gint _tmp25_ = 0;
		guchar _tmp26_ = '\0';
		guchar r = '\0';
		guchar _tmp27_ = '\0';
		guchar _tmp28_ = '\0';
		guchar* _tmp29_ = NULL;
		gint _tmp29__length1 = 0;
		gint _tmp30_ = 0;
		guchar _tmp31_ = '\0';
		guchar _tmp32_ = '\0';
#line 4311 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp19_ = pixbuf;
#line 4311 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = gdk_pixbuf_get_pixels (_tmp19_);
#line 4311 "/home/jens/Source/shotwell/src/Photo.vala"
		pixel_data = _tmp20_;
#line 4311 "/home/jens/Source/shotwell/src/Photo.vala"
		pixel_data_length1 = -1;
#line 4311 "/home/jens/Source/shotwell/src/Photo.vala"
		_pixel_data_size_ = pixel_data_length1;
#line 4321 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = pixel_data;
#line 4321 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21__length1 = pixel_data_length1;
#line 4321 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp22_ = px_start_byte_offset;
#line 4321 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp23_ = _tmp21_[_tmp22_ + 1];
#line 4321 "/home/jens/Source/shotwell/src/Photo.vala"
		g = _tmp23_;
#line 4322 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp24_ = pixel_data;
#line 4322 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp24__length1 = pixel_data_length1;
#line 4322 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp25_ = px_start_byte_offset;
#line 4322 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp26_ = _tmp24_[_tmp25_ + 2];
#line 4322 "/home/jens/Source/shotwell/src/Photo.vala"
		b = _tmp26_;
#line 4324 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp27_ = g;
#line 4324 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp28_ = b;
#line 4324 "/home/jens/Source/shotwell/src/Photo.vala"
		r = (guchar) ((_tmp27_ + _tmp28_) / 2);
#line 4326 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp29_ = pixel_data;
#line 4326 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp29__length1 = pixel_data_length1;
#line 4326 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp30_ = px_start_byte_offset;
#line 4326 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp31_ = r;
#line 4326 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp29_[_tmp30_] = _tmp31_;
#line 4326 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp32_ = _tmp29_[_tmp30_];
#line 31162 "Photo.c"
	}
#line 4329 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp33_ = pixbuf;
#line 4329 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp34_ = _g_object_ref0 (_tmp33_);
#line 4329 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp34_;
#line 4329 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 31172 "Photo.c"
}


void photo_unscaled_to_raw_point (Photo* self, GdkPoint* unscaled_point, GdkPoint* result) {
	Orientation unscaled_orientation = 0;
	Orientation _tmp0_ = 0;
	Dimensions unscaled_dims = {0};
	Orientation _tmp1_ = 0;
	Dimensions _tmp2_ = {0};
	Dimensions _tmp3_ = {0};
	gint unscaled_x_offset_raw = 0;
	gint unscaled_y_offset_raw = 0;
	Box crop_box = {0};
	Box _tmp4_ = {0};
	gboolean _tmp5_ = FALSE;
	GdkPoint derotated_point = {0};
	Orientation _tmp10_ = 0;
	Dimensions _tmp11_ = {0};
	GdkPoint _tmp12_ = {0};
	GdkPoint _tmp13_ = {0};
	gint _tmp14_ = 0;
	gint _tmp15_ = 0;
	gint _tmp16_ = 0;
	gint _tmp17_ = 0;
#line 4332 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 4332 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (unscaled_point != NULL);
#line 4333 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_orientation (self);
#line 4333 "/home/jens/Source/shotwell/src/Photo.vala"
	unscaled_orientation = _tmp0_;
#line 4335 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = unscaled_orientation;
#line 4335 "/home/jens/Source/shotwell/src/Photo.vala"
	media_source_get_dimensions (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), PHOTO_EXCEPTION_NONE, &_tmp2_);
#line 4335 "/home/jens/Source/shotwell/src/Photo.vala"
	orientation_rotate_dimensions (_tmp1_, &_tmp2_, &_tmp3_);
#line 4335 "/home/jens/Source/shotwell/src/Photo.vala"
	unscaled_dims = _tmp3_;
#line 4338 "/home/jens/Source/shotwell/src/Photo.vala"
	unscaled_x_offset_raw = 0;
#line 4339 "/home/jens/Source/shotwell/src/Photo.vala"
	unscaled_y_offset_raw = 0;
#line 4342 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = photo_get_raw_crop (self, &_tmp4_);
#line 4342 "/home/jens/Source/shotwell/src/Photo.vala"
	crop_box = _tmp4_;
#line 4342 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp5_) {
#line 31223 "Photo.c"
		Box _tmp6_ = {0};
		gint _tmp7_ = 0;
		Box _tmp8_ = {0};
		gint _tmp9_ = 0;
#line 4343 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = crop_box;
#line 4343 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = _tmp6_.left;
#line 4343 "/home/jens/Source/shotwell/src/Photo.vala"
		unscaled_x_offset_raw = _tmp7_;
#line 4344 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = crop_box;
#line 4344 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp9_ = _tmp8_.top;
#line 4344 "/home/jens/Source/shotwell/src/Photo.vala"
		unscaled_y_offset_raw = _tmp9_;
#line 31240 "Photo.c"
	}
#line 4347 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = unscaled_orientation;
#line 4347 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = unscaled_dims;
#line 4347 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = *unscaled_point;
#line 4347 "/home/jens/Source/shotwell/src/Photo.vala"
	orientation_derotate_point (_tmp10_, &_tmp11_, &_tmp12_, &_tmp13_);
#line 4347 "/home/jens/Source/shotwell/src/Photo.vala"
	derotated_point = _tmp13_;
#line 4351 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = derotated_point.x;
#line 4351 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = unscaled_x_offset_raw;
#line 4351 "/home/jens/Source/shotwell/src/Photo.vala"
	derotated_point.x = _tmp14_ + _tmp15_;
#line 4352 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_ = derotated_point.y;
#line 4352 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = unscaled_y_offset_raw;
#line 4352 "/home/jens/Source/shotwell/src/Photo.vala"
	derotated_point.y = _tmp16_ + _tmp17_;
#line 4354 "/home/jens/Source/shotwell/src/Photo.vala"
	*result = derotated_point;
#line 4354 "/home/jens/Source/shotwell/src/Photo.vala"
	return;
#line 31268 "Photo.c"
}


void photo_unscaled_to_raw_rect (Photo* self, GdkRectangle* unscaled_rect, GdkRectangle* result) {
	GdkPoint upper_left = {0};
	GdkPoint _tmp0_ = {0};
	GdkPoint lower_right = {0};
	GdkPoint _tmp1_ = {0};
	GdkRectangle _tmp2_ = {0};
	gint _tmp3_ = 0;
	GdkRectangle _tmp4_ = {0};
	gint _tmp5_ = 0;
	GdkPoint _tmp6_ = {0};
	gint _tmp7_ = 0;
	GdkRectangle _tmp8_ = {0};
	gint _tmp9_ = 0;
	GdkPoint _tmp10_ = {0};
	gint _tmp11_ = 0;
	GdkRectangle _tmp12_ = {0};
	gint _tmp13_ = 0;
	GdkPoint _tmp14_ = {0};
	GdkPoint _tmp15_ = {0};
	GdkPoint _tmp16_ = {0};
	GdkPoint _tmp17_ = {0};
	GdkPoint _tmp18_ = {0};
	gint _tmp19_ = 0;
	GdkPoint _tmp20_ = {0};
	gint _tmp21_ = 0;
	GdkPoint _tmp27_ = {0};
	gint _tmp28_ = 0;
	GdkPoint _tmp29_ = {0};
	gint _tmp30_ = 0;
	GdkRectangle raw_rect = {0};
	GdkPoint _tmp36_ = {0};
	gint _tmp37_ = 0;
	GdkPoint _tmp38_ = {0};
	gint _tmp39_ = 0;
	GdkPoint _tmp40_ = {0};
	gint _tmp41_ = 0;
	GdkPoint _tmp42_ = {0};
	gint _tmp43_ = 0;
	GdkPoint _tmp44_ = {0};
	gint _tmp45_ = 0;
	GdkPoint _tmp46_ = {0};
	gint _tmp47_ = 0;
#line 4357 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (self));
#line 4357 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (unscaled_rect != NULL);
#line 4358 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_.x = 0;
#line 4358 "/home/jens/Source/shotwell/src/Photo.vala"
	upper_left = _tmp0_;
#line 4359 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_.x = 0;
#line 4359 "/home/jens/Source/shotwell/src/Photo.vala"
	lower_right = _tmp1_;
#line 4360 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = *unscaled_rect;
#line 4360 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp2_.x;
#line 4360 "/home/jens/Source/shotwell/src/Photo.vala"
	upper_left.x = _tmp3_;
#line 4361 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = *unscaled_rect;
#line 4361 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = _tmp4_.y;
#line 4361 "/home/jens/Source/shotwell/src/Photo.vala"
	upper_left.y = _tmp5_;
#line 4362 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = upper_left;
#line 4362 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = _tmp6_.x;
#line 4362 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = *unscaled_rect;
#line 4362 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = _tmp8_.width;
#line 4362 "/home/jens/Source/shotwell/src/Photo.vala"
	lower_right.x = _tmp7_ + _tmp9_;
#line 4363 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = upper_left;
#line 4363 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = _tmp10_.y;
#line 4363 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = *unscaled_rect;
#line 4363 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = _tmp12_.height;
#line 4363 "/home/jens/Source/shotwell/src/Photo.vala"
	lower_right.y = _tmp11_ + _tmp13_;
#line 4365 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = upper_left;
#line 4365 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_unscaled_to_raw_point (self, &_tmp14_, &_tmp15_);
#line 4365 "/home/jens/Source/shotwell/src/Photo.vala"
	upper_left = _tmp15_;
#line 4366 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_ = lower_right;
#line 4366 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_unscaled_to_raw_point (self, &_tmp16_, &_tmp17_);
#line 4366 "/home/jens/Source/shotwell/src/Photo.vala"
	lower_right = _tmp17_;
#line 4368 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp18_ = upper_left;
#line 4368 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp19_ = _tmp18_.x;
#line 4368 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp20_ = lower_right;
#line 4368 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp21_ = _tmp20_.x;
#line 4368 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp19_ > _tmp21_) {
#line 31380 "Photo.c"
		gint temp = 0;
		GdkPoint _tmp22_ = {0};
		gint _tmp23_ = 0;
		GdkPoint _tmp24_ = {0};
		gint _tmp25_ = 0;
		gint _tmp26_ = 0;
#line 4369 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp22_ = upper_left;
#line 4369 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp23_ = _tmp22_.x;
#line 4369 "/home/jens/Source/shotwell/src/Photo.vala"
		temp = _tmp23_;
#line 4370 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp24_ = lower_right;
#line 4370 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp25_ = _tmp24_.x;
#line 4370 "/home/jens/Source/shotwell/src/Photo.vala"
		upper_left.x = _tmp25_;
#line 4371 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp26_ = temp;
#line 4371 "/home/jens/Source/shotwell/src/Photo.vala"
		lower_right.x = _tmp26_;
#line 31403 "Photo.c"
	}
#line 4373 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp27_ = upper_left;
#line 4373 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp28_ = _tmp27_.y;
#line 4373 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp29_ = lower_right;
#line 4373 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp30_ = _tmp29_.y;
#line 4373 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp28_ > _tmp30_) {
#line 31415 "Photo.c"
		gint temp = 0;
		GdkPoint _tmp31_ = {0};
		gint _tmp32_ = 0;
		GdkPoint _tmp33_ = {0};
		gint _tmp34_ = 0;
		gint _tmp35_ = 0;
#line 4374 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp31_ = upper_left;
#line 4374 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp32_ = _tmp31_.y;
#line 4374 "/home/jens/Source/shotwell/src/Photo.vala"
		temp = _tmp32_;
#line 4375 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp33_ = lower_right;
#line 4375 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp34_ = _tmp33_.y;
#line 4375 "/home/jens/Source/shotwell/src/Photo.vala"
		upper_left.y = _tmp34_;
#line 4376 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp35_ = temp;
#line 4376 "/home/jens/Source/shotwell/src/Photo.vala"
		lower_right.y = _tmp35_;
#line 31438 "Photo.c"
	}
#line 4379 "/home/jens/Source/shotwell/src/Photo.vala"
	memset (&raw_rect, 0, sizeof (GdkRectangle));
#line 4380 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp36_ = upper_left;
#line 4380 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp37_ = _tmp36_.x;
#line 4380 "/home/jens/Source/shotwell/src/Photo.vala"
	raw_rect.x = _tmp37_;
#line 4381 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp38_ = upper_left;
#line 4381 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp39_ = _tmp38_.y;
#line 4381 "/home/jens/Source/shotwell/src/Photo.vala"
	raw_rect.y = _tmp39_;
#line 4382 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp40_ = lower_right;
#line 4382 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp41_ = _tmp40_.x;
#line 4382 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp42_ = upper_left;
#line 4382 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp43_ = _tmp42_.x;
#line 4382 "/home/jens/Source/shotwell/src/Photo.vala"
	raw_rect.width = _tmp41_ - _tmp43_;
#line 4383 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp44_ = lower_right;
#line 4383 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp45_ = _tmp44_.y;
#line 4383 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp46_ = upper_left;
#line 4383 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp47_ = _tmp46_.y;
#line 4383 "/home/jens/Source/shotwell/src/Photo.vala"
	raw_rect.height = _tmp45_ - _tmp47_;
#line 4385 "/home/jens/Source/shotwell/src/Photo.vala"
	*result = raw_rect;
#line 4385 "/home/jens/Source/shotwell/src/Photo.vala"
	return;
#line 31478 "Photo.c"
}


PixelTransformationBundle* photo_get_enhance_transformations (Photo* self) {
	PixelTransformationBundle* result = NULL;
	GdkPixbuf* pixbuf = NULL;
	PixelTransformationBundle* transformations = NULL;
	GdkPixbuf* _tmp4_ = NULL;
	PixelTransformationBundle* _tmp5_ = NULL;
	GError * _inner_error_ = NULL;
#line 4388 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), NULL);
#line 4389 "/home/jens/Source/shotwell/src/Photo.vala"
	pixbuf = NULL;
#line 31493 "Photo.c"
	{
		GdkPixbuf* _tmp0_ = NULL;
		Scaling _tmp1_ = {0};
		GdkPixbuf* _tmp2_ = NULL;
		GdkPixbuf* _tmp3_ = NULL;
#line 4396 "/home/jens/Source/shotwell/src/Photo.vala"
		scaling_for_best_fit (360, FALSE, &_tmp1_);
#line 4396 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = photo_get_pixbuf_with_options (self, &_tmp1_, PHOTO_EXCEPTION_ALL, BACKING_FETCH_MODE_BASELINE, &_inner_error_);
#line 4396 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = _tmp2_;
#line 4396 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 31507 "Photo.c"
			goto __catch407_g_error;
		}
#line 4396 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = _tmp0_;
#line 4396 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = NULL;
#line 4396 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (pixbuf);
#line 4396 "/home/jens/Source/shotwell/src/Photo.vala"
		pixbuf = _tmp3_;
#line 4395 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp0_);
#line 31520 "Photo.c"
	}
	goto __finally407;
	__catch407_g_error:
	{
		GError* e = NULL;
#line 4395 "/home/jens/Source/shotwell/src/Photo.vala"
		e = _inner_error_;
#line 4395 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 4403 "/home/jens/Source/shotwell/src/Photo.vala"
		g_warning ("Photo.vala:4403: %s", "Photo: get_enhance_transformations: couldn't obtain pixbuf to build " "transform histogram");
#line 4405 "/home/jens/Source/shotwell/src/Photo.vala"
		result = NULL;
#line 4405 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (e);
#line 4405 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (pixbuf);
#line 4405 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 31540 "Photo.c"
	}
	__finally407:
#line 4395 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 4395 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (pixbuf);
#line 4395 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 4395 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 4395 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 31553 "Photo.c"
	}
#line 4412 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = pixbuf;
#line 4412 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = auto_enhance_create_auto_enhance_adjustments (_tmp4_);
#line 4412 "/home/jens/Source/shotwell/src/Photo.vala"
	transformations = _tmp5_;
#line 4420 "/home/jens/Source/shotwell/src/Photo.vala"
	result = transformations;
#line 4420 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (pixbuf);
#line 4420 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 31567 "Photo.c"
}


gboolean photo_enhance (Photo* self) {
	gboolean result = FALSE;
	PixelTransformationBundle* transformations = NULL;
	PixelTransformationBundle* _tmp0_ = NULL;
	PixelTransformationBundle* _tmp1_ = NULL;
	GError * _inner_error_ = NULL;
#line 4423 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (self), FALSE);
#line 4424 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_get_enhance_transformations (self);
#line 4424 "/home/jens/Source/shotwell/src/Photo.vala"
	transformations = _tmp0_;
#line 4426 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = transformations;
#line 4426 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_ == NULL) {
#line 4427 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 4427 "/home/jens/Source/shotwell/src/Photo.vala"
		_pixel_transformation_bundle_unref0 (transformations);
#line 4427 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 31593 "Photo.c"
	}
	{
		PhotoRow* _tmp2_ = NULL;
#line 4432 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = self->row;
#line 4432 "/home/jens/Source/shotwell/src/Photo.vala"
		g_rec_mutex_lock (&self->priv->__lock_row);
#line 31601 "Photo.c"
		{
			PixelTransformationBundle* _tmp3_ = NULL;
#line 4433 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = transformations;
#line 4433 "/home/jens/Source/shotwell/src/Photo.vala"
			photo_set_color_adjustments (self, _tmp3_);
#line 31608 "Photo.c"
		}
		__finally408:
		{
			PhotoRow* _tmp4_ = NULL;
#line 4432 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = self->row;
#line 4432 "/home/jens/Source/shotwell/src/Photo.vala"
			g_rec_mutex_unlock (&self->priv->__lock_row);
#line 31617 "Photo.c"
		}
#line 4432 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 31621 "Photo.c"
			gboolean _tmp5_ = FALSE;
#line 4432 "/home/jens/Source/shotwell/src/Photo.vala"
			_pixel_transformation_bundle_unref0 (transformations);
#line 4432 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 4432 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 4432 "/home/jens/Source/shotwell/src/Photo.vala"
			return _tmp5_;
#line 31631 "Photo.c"
		}
	}
#line 4440 "/home/jens/Source/shotwell/src/Photo.vala"
	result = TRUE;
#line 4440 "/home/jens/Source/shotwell/src/Photo.vala"
	_pixel_transformation_bundle_unref0 (transformations);
#line 4440 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 31640 "Photo.c"
}


gboolean photo_get_develop_raw_photos_to_files (void) {
	gboolean result;
	gboolean _tmp0_ = FALSE;
#line 349 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo__develop_raw_photos_to_files;
#line 349 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 349 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 31653 "Photo.c"
}


void photo_set_develop_raw_photos_to_files (gboolean value) {
	gboolean _tmp0_ = FALSE;
#line 349 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = value;
#line 349 "/home/jens/Source/shotwell/src/Photo.vala"
	photo__develop_raw_photos_to_files = _tmp0_;
#line 31663 "Photo.c"
}


static void photo_real_editable_replaced (Photo* self, GFile* old_file, GFile* new_file) {
#line 358 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((old_file == NULL) || G_IS_FILE (old_file));
#line 358 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((new_file == NULL) || G_IS_FILE (new_file));
#line 31672 "Photo.c"
}


static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
	typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2);
	register GMarshalFunc_VOID__OBJECT_OBJECT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (n_param_values == 3);
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_CCLOSURE_SWAP_DATA (closure)) {
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
		data1 = closure->data;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
		data2 = param_values->data[0].v_pointer;
#line 31691 "Photo.c"
	} else {
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
		data1 = param_values->data[0].v_pointer;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
		data2 = closure->data;
#line 31697 "Photo.c"
	}
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	callback = (GMarshalFunc_VOID__OBJECT_OBJECT) (marshal_data ? marshal_data : cc->callback);
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	callback (data1, g_value_get_object (param_values + 1), g_value_get_object (param_values + 2), data2);
#line 31703 "Photo.c"
}


static void photo_real_raw_development_modified (Photo* self) {
}


static void photo_real_baseline_replaced (Photo* self) {
}


static void photo_real_master_reimported (Photo* self, PhotoMetadata* metadata) {
#line 376 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 31718 "Photo.c"
}


static void g_cclosure_user_marshal_VOID__MEDIA_METADATA (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
	typedef void (*GMarshalFunc_VOID__MEDIA_METADATA) (gpointer data1, gpointer arg_1, gpointer data2);
	register GMarshalFunc_VOID__MEDIA_METADATA callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (n_param_values == 2);
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_CCLOSURE_SWAP_DATA (closure)) {
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
		data1 = closure->data;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
		data2 = param_values->data[0].v_pointer;
#line 31737 "Photo.c"
	} else {
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
		data1 = param_values->data[0].v_pointer;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
		data2 = closure->data;
#line 31743 "Photo.c"
	}
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	callback = (GMarshalFunc_VOID__MEDIA_METADATA) (marshal_data ? marshal_data : cc->callback);
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	callback (data1, value_get_media_metadata (param_values + 1), data2);
#line 31749 "Photo.c"
}


static void photo_real_editable_reimported (Photo* self, PhotoMetadata* metadata) {
#line 380 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 31756 "Photo.c"
}


static void photo_real_baseline_reimported (Photo* self, PhotoMetadata* metadata) {
#line 387 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 31763 "Photo.c"
}


static void photo_real_source_reimported (Photo* self, PhotoMetadata* metadata) {
#line 394 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 31770 "Photo.c"
}


static void _photo_photo_transformation_state_impl_on_photo_baseline_replaced_photo_baseline_replaced (Photo* _sender, gpointer self) {
#line 257 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_photo_transformation_state_impl_on_photo_baseline_replaced ((PhotoPhotoTransformationStateImpl*) self);
#line 31777 "Photo.c"
}


static PhotoPhotoTransformationStateImpl* photo_photo_transformation_state_impl_construct (GType object_type, Photo* photo, Orientation orientation, GeeHashMap* transformations, PixelTransformer* transformer, PixelTransformationBundle* adjustments) {
	PhotoPhotoTransformationStateImpl * self = NULL;
	Photo* _tmp0_ = NULL;
	Photo* _tmp1_ = NULL;
	Orientation _tmp2_ = 0;
	GeeHashMap* _tmp3_ = NULL;
	GeeHashMap* _tmp4_ = NULL;
	PixelTransformer* _tmp5_ = NULL;
	PixelTransformer* _tmp6_ = NULL;
	PixelTransformationBundle* _tmp7_ = NULL;
	PixelTransformationBundle* _tmp8_ = NULL;
	Photo* _tmp9_ = NULL;
#line 244 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (photo), NULL);
#line 244 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail ((transformations == NULL) || GEE_IS_HASH_MAP (transformations), NULL);
#line 244 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail ((transformer == NULL) || IS_PIXEL_TRANSFORMER (transformer), NULL);
#line 244 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail ((adjustments == NULL) || IS_PIXEL_TRANSFORMATION_BUNDLE (adjustments), NULL);
#line 244 "/home/jens/Source/shotwell/src/Photo.vala"
	self = (PhotoPhotoTransformationStateImpl*) photo_transformation_state_construct (object_type);
#line 247 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo;
#line 247 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 247 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->photo);
#line 247 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->photo = _tmp1_;
#line 248 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = orientation;
#line 248 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->orientation = _tmp2_;
#line 249 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = transformations;
#line 249 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = photo_photo_transformation_state_impl_copy_transformations (_tmp3_);
#line 249 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->transformations);
#line 249 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->transformations = _tmp4_;
#line 250 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = transformer;
#line 250 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = _pixel_transformer_ref0 (_tmp5_);
#line 250 "/home/jens/Source/shotwell/src/Photo.vala"
	_pixel_transformer_unref0 (self->priv->transformer);
#line 250 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->transformer = _tmp6_;
#line 251 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = adjustments;
#line 251 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = _pixel_transformation_bundle_ref0 (_tmp7_);
#line 251 "/home/jens/Source/shotwell/src/Photo.vala"
	_pixel_transformation_bundle_unref0 (self->priv->adjustments);
#line 251 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->adjustments = _tmp8_;
#line 253 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = photo;
#line 253 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_connect_object (_tmp9_, "baseline-replaced", (GCallback) _photo_photo_transformation_state_impl_on_photo_baseline_replaced_photo_baseline_replaced, self, 0);
#line 244 "/home/jens/Source/shotwell/src/Photo.vala"
	return self;
#line 31845 "Photo.c"
}


static PhotoPhotoTransformationStateImpl* photo_photo_transformation_state_impl_new (Photo* photo, Orientation orientation, GeeHashMap* transformations, PixelTransformer* transformer, PixelTransformationBundle* adjustments) {
#line 244 "/home/jens/Source/shotwell/src/Photo.vala"
	return photo_photo_transformation_state_impl_construct (PHOTO_TYPE_PHOTO_TRANSFORMATION_STATE_IMPL, photo, orientation, transformations, transformer, adjustments);
#line 31852 "Photo.c"
}


static Orientation photo_photo_transformation_state_impl_get_orientation (PhotoPhotoTransformationStateImpl* self) {
	Orientation result = 0;
	Orientation _tmp0_ = 0;
#line 260 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (PHOTO_IS_PHOTO_TRANSFORMATION_STATE_IMPL (self), 0);
#line 261 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = self->priv->orientation;
#line 261 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 261 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 31867 "Photo.c"
}


static GeeHashMap* photo_photo_transformation_state_impl_get_transformations (PhotoPhotoTransformationStateImpl* self) {
	GeeHashMap* result = NULL;
	GeeHashMap* _tmp0_ = NULL;
	GeeHashMap* _tmp1_ = NULL;
#line 264 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (PHOTO_IS_PHOTO_TRANSFORMATION_STATE_IMPL (self), NULL);
#line 265 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = self->priv->transformations;
#line 265 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = photo_photo_transformation_state_impl_copy_transformations (_tmp0_);
#line 265 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp1_;
#line 265 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 31885 "Photo.c"
}


static PixelTransformer* photo_photo_transformation_state_impl_get_transformer (PhotoPhotoTransformationStateImpl* self) {
	PixelTransformer* result = NULL;
	PixelTransformer* _tmp0_ = NULL;
	PixelTransformer* _tmp1_ = NULL;
#line 268 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (PHOTO_IS_PHOTO_TRANSFORMATION_STATE_IMPL (self), NULL);
#line 269 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = self->priv->transformer;
#line 269 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_ != NULL) {
#line 31899 "Photo.c"
		PixelTransformer* _tmp2_ = NULL;
		PixelTransformer* _tmp3_ = NULL;
#line 269 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = self->priv->transformer;
#line 269 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = pixel_transformer_copy (_tmp2_);
#line 269 "/home/jens/Source/shotwell/src/Photo.vala"
		_pixel_transformer_unref0 (_tmp0_);
#line 269 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = _tmp3_;
#line 31910 "Photo.c"
	} else {
#line 269 "/home/jens/Source/shotwell/src/Photo.vala"
		_pixel_transformer_unref0 (_tmp0_);
#line 269 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = NULL;
#line 31916 "Photo.c"
	}
#line 269 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 269 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 31922 "Photo.c"
}


static PixelTransformationBundle* photo_photo_transformation_state_impl_get_color_adjustments (PhotoPhotoTransformationStateImpl* self) {
	PixelTransformationBundle* result = NULL;
	PixelTransformationBundle* _tmp0_ = NULL;
	PixelTransformationBundle* _tmp1_ = NULL;
#line 272 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (PHOTO_IS_PHOTO_TRANSFORMATION_STATE_IMPL (self), NULL);
#line 273 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = self->priv->adjustments;
#line 273 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_ != NULL) {
#line 31936 "Photo.c"
		PixelTransformationBundle* _tmp2_ = NULL;
		PixelTransformationBundle* _tmp3_ = NULL;
#line 273 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = self->priv->adjustments;
#line 273 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = pixel_transformation_bundle_copy (_tmp2_);
#line 273 "/home/jens/Source/shotwell/src/Photo.vala"
		_pixel_transformation_bundle_unref0 (_tmp0_);
#line 273 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = _tmp3_;
#line 31947 "Photo.c"
	} else {
#line 273 "/home/jens/Source/shotwell/src/Photo.vala"
		_pixel_transformation_bundle_unref0 (_tmp0_);
#line 273 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = NULL;
#line 31953 "Photo.c"
	}
#line 273 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 273 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 31959 "Photo.c"
}


static GeeHashMap* photo_photo_transformation_state_impl_copy_transformations (GeeHashMap* original) {
	GeeHashMap* result = NULL;
	GeeHashMap* _tmp0_ = NULL;
	GeeHashMap* clone = NULL;
	GeeHashMap* _tmp1_ = NULL;
#line 276 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail ((original == NULL) || GEE_IS_HASH_MAP (original), NULL);
#line 278 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = original;
#line 278 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp0_ == NULL) {
#line 279 "/home/jens/Source/shotwell/src/Photo.vala"
		result = NULL;
#line 279 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 31978 "Photo.c"
	}
#line 281 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, TYPE_KEY_VALUE_MAP, (GBoxedCopyFunc) key_value_map_ref, (GDestroyNotify) key_value_map_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
#line 281 "/home/jens/Source/shotwell/src/Photo.vala"
	clone = _tmp1_;
#line 31984 "Photo.c"
	{
		GeeIterator* _object_it = NULL;
		GeeHashMap* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeSet* _tmp4_ = NULL;
		GeeSet* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
		GeeIterator* _tmp7_ = NULL;
#line 282 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = original;
#line 282 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = gee_abstract_map_get_keys (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
#line 282 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = _tmp3_;
#line 282 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = _tmp4_;
#line 282 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_ITERABLE, GeeIterable));
#line 282 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = _tmp6_;
#line 282 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp5_);
#line 282 "/home/jens/Source/shotwell/src/Photo.vala"
		_object_it = _tmp7_;
#line 282 "/home/jens/Source/shotwell/src/Photo.vala"
		while (TRUE) {
#line 32011 "Photo.c"
			GeeIterator* _tmp8_ = NULL;
			gboolean _tmp9_ = FALSE;
			gchar* object = NULL;
			GeeIterator* _tmp10_ = NULL;
			gpointer _tmp11_ = NULL;
			GeeHashMap* _tmp12_ = NULL;
			const gchar* _tmp13_ = NULL;
			GeeHashMap* _tmp14_ = NULL;
			const gchar* _tmp15_ = NULL;
			gpointer _tmp16_ = NULL;
			KeyValueMap* _tmp17_ = NULL;
			KeyValueMap* _tmp18_ = NULL;
			KeyValueMap* _tmp19_ = NULL;
#line 282 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = _object_it;
#line 282 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = gee_iterator_next (_tmp8_);
#line 282 "/home/jens/Source/shotwell/src/Photo.vala"
			if (!_tmp9_) {
#line 282 "/home/jens/Source/shotwell/src/Photo.vala"
				break;
#line 32033 "Photo.c"
			}
#line 282 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = _object_it;
#line 282 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = gee_iterator_get (_tmp10_);
#line 282 "/home/jens/Source/shotwell/src/Photo.vala"
			object = (gchar*) _tmp11_;
#line 283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = clone;
#line 283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = object;
#line 283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp14_ = original;
#line 283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp15_ = object;
#line 283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp16_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp15_);
#line 283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp17_ = (KeyValueMap*) _tmp16_;
#line 283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp18_ = key_value_map_copy (_tmp17_);
#line 283 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp19_ = _tmp18_;
#line 283 "/home/jens/Source/shotwell/src/Photo.vala"
			gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp13_, _tmp19_);
#line 283 "/home/jens/Source/shotwell/src/Photo.vala"
			_key_value_map_unref0 (_tmp19_);
#line 283 "/home/jens/Source/shotwell/src/Photo.vala"
			_key_value_map_unref0 (_tmp17_);
#line 282 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_free0 (object);
#line 32065 "Photo.c"
		}
#line 282 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_object_it);
#line 32069 "Photo.c"
	}
#line 285 "/home/jens/Source/shotwell/src/Photo.vala"
	result = clone;
#line 285 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 32075 "Photo.c"
}


static void photo_photo_transformation_state_impl_on_photo_baseline_replaced (PhotoPhotoTransformationStateImpl* self) {
	gboolean _tmp0_ = FALSE;
#line 288 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (PHOTO_IS_PHOTO_TRANSFORMATION_STATE_IMPL (self));
#line 289 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_transformation_state_is_broken (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_TRANSFORMATION_STATE, PhotoTransformationState));
#line 289 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp0_) {
#line 290 "/home/jens/Source/shotwell/src/Photo.vala"
		g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_TRANSFORMATION_STATE, PhotoTransformationState), "broken");
#line 32089 "Photo.c"
	}
}


static void photo_photo_transformation_state_impl_class_init (PhotoPhotoTransformationStateImplClass * klass) {
#line 237 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_photo_transformation_state_impl_parent_class = g_type_class_peek_parent (klass);
#line 237 "/home/jens/Source/shotwell/src/Photo.vala"
	g_type_class_add_private (klass, sizeof (PhotoPhotoTransformationStateImplPrivate));
#line 237 "/home/jens/Source/shotwell/src/Photo.vala"
	G_OBJECT_CLASS (klass)->finalize = photo_photo_transformation_state_impl_finalize;
#line 32101 "Photo.c"
}


static void photo_photo_transformation_state_impl_instance_init (PhotoPhotoTransformationStateImpl * self) {
#line 237 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv = PHOTO_PHOTO_TRANSFORMATION_STATE_IMPL_GET_PRIVATE (self);
#line 32108 "Photo.c"
}


static void photo_photo_transformation_state_impl_finalize (GObject* obj) {
	PhotoPhotoTransformationStateImpl * self;
	Photo* _tmp0_ = NULL;
	guint _tmp1_ = 0U;
#line 237 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PHOTO_TYPE_PHOTO_TRANSFORMATION_STATE_IMPL, PhotoPhotoTransformationStateImpl);
#line 257 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = self->priv->photo;
#line 257 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_parse_name ("baseline-replaced", TYPE_PHOTO, &_tmp1_, NULL, FALSE);
#line 257 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _photo_photo_transformation_state_impl_on_photo_baseline_replaced_photo_baseline_replaced, self);
#line 238 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->photo);
#line 240 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->transformations);
#line 241 "/home/jens/Source/shotwell/src/Photo.vala"
	_pixel_transformer_unref0 (self->priv->transformer);
#line 242 "/home/jens/Source/shotwell/src/Photo.vala"
	_pixel_transformation_bundle_unref0 (self->priv->adjustments);
#line 237 "/home/jens/Source/shotwell/src/Photo.vala"
	G_OBJECT_CLASS (photo_photo_transformation_state_impl_parent_class)->finalize (obj);
#line 32134 "Photo.c"
}


static GType photo_photo_transformation_state_impl_get_type (void) {
	static volatile gsize photo_photo_transformation_state_impl_type_id__volatile = 0;
	if (g_once_init_enter (&photo_photo_transformation_state_impl_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PhotoPhotoTransformationStateImplClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) photo_photo_transformation_state_impl_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PhotoPhotoTransformationStateImpl), 0, (GInstanceInitFunc) photo_photo_transformation_state_impl_instance_init, NULL };
		GType photo_photo_transformation_state_impl_type_id;
		photo_photo_transformation_state_impl_type_id = g_type_register_static (TYPE_PHOTO_TRANSFORMATION_STATE, "PhotoPhotoTransformationStateImpl", &g_define_type_info, 0);
		g_once_init_leave (&photo_photo_transformation_state_impl_type_id__volatile, photo_photo_transformation_state_impl_type_id);
	}
	return photo_photo_transformation_state_impl_type_id__volatile;
}


static PhotoBackingReaders* photo_backing_readers_construct (GType object_type) {
	PhotoBackingReaders* self = NULL;
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	self = (PhotoBackingReaders*) g_type_create_instance (object_type);
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	return self;
#line 32156 "Photo.c"
}


static PhotoBackingReaders* photo_backing_readers_new (void) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	return photo_backing_readers_construct (PHOTO_TYPE_BACKING_READERS);
#line 32163 "Photo.c"
}


static void photo_value_backing_readers_init (GValue* value) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	value->data[0].v_pointer = NULL;
#line 32170 "Photo.c"
}


static void photo_value_backing_readers_free_value (GValue* value) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	if (value->data[0].v_pointer) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_backing_readers_unref (value->data[0].v_pointer);
#line 32179 "Photo.c"
	}
}


static void photo_value_backing_readers_copy_value (const GValue* src_value, GValue* dest_value) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	if (src_value->data[0].v_pointer) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		dest_value->data[0].v_pointer = photo_backing_readers_ref (src_value->data[0].v_pointer);
#line 32189 "Photo.c"
	} else {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		dest_value->data[0].v_pointer = NULL;
#line 32193 "Photo.c"
	}
}


static gpointer photo_value_backing_readers_peek_pointer (const GValue* value) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	return value->data[0].v_pointer;
#line 32201 "Photo.c"
}


static gchar* photo_value_backing_readers_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	if (collect_values[0].v_pointer) {
#line 32208 "Photo.c"
		PhotoBackingReaders* object;
		object = collect_values[0].v_pointer;
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		if (object->parent_instance.g_class == NULL) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 32215 "Photo.c"
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 32219 "Photo.c"
		}
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = photo_backing_readers_ref (object);
#line 32223 "Photo.c"
	} else {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 32227 "Photo.c"
	}
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	return NULL;
#line 32231 "Photo.c"
}


static gchar* photo_value_backing_readers_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	PhotoBackingReaders** object_p;
	object_p = collect_values[0].v_pointer;
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!object_p) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 32242 "Photo.c"
	}
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!value->data[0].v_pointer) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = NULL;
#line 32248 "Photo.c"
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = value->data[0].v_pointer;
#line 32252 "Photo.c"
	} else {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = photo_backing_readers_ref (value->data[0].v_pointer);
#line 32256 "Photo.c"
	}
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	return NULL;
#line 32260 "Photo.c"
}


static GParamSpec* photo_param_spec_backing_readers (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	PhotoParamSpecBackingReaders* spec;
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (g_type_is_a (object_type, PHOTO_TYPE_BACKING_READERS), NULL);
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	G_PARAM_SPEC (spec)->value_type = object_type;
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	return G_PARAM_SPEC (spec);
#line 32274 "Photo.c"
}


static gpointer photo_value_get_backing_readers (const GValue* value) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PHOTO_TYPE_BACKING_READERS), NULL);
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	return value->data[0].v_pointer;
#line 32283 "Photo.c"
}


static void photo_value_set_backing_readers (GValue* value, gpointer v_object) {
	PhotoBackingReaders* old;
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PHOTO_TYPE_BACKING_READERS));
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	old = value->data[0].v_pointer;
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	if (v_object) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PHOTO_TYPE_BACKING_READERS));
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = v_object;
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_backing_readers_ref (value->data[0].v_pointer);
#line 32303 "Photo.c"
	} else {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 32307 "Photo.c"
	}
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	if (old) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_backing_readers_unref (old);
#line 32313 "Photo.c"
	}
}


static void photo_value_take_backing_readers (GValue* value, gpointer v_object) {
	PhotoBackingReaders* old;
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PHOTO_TYPE_BACKING_READERS));
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	old = value->data[0].v_pointer;
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	if (v_object) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PHOTO_TYPE_BACKING_READERS));
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = v_object;
#line 32332 "Photo.c"
	} else {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 32336 "Photo.c"
	}
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	if (old) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_backing_readers_unref (old);
#line 32342 "Photo.c"
	}
}


static void photo_backing_readers_class_init (PhotoBackingReadersClass * klass) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_backing_readers_parent_class = g_type_class_peek_parent (klass);
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoBackingReadersClass *) klass)->finalize = photo_backing_readers_finalize;
#line 32352 "Photo.c"
}


static void photo_backing_readers_instance_init (PhotoBackingReaders * self) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	self->ref_count = 1;
#line 32359 "Photo.c"
}


static void photo_backing_readers_finalize (PhotoBackingReaders* obj) {
	PhotoBackingReaders * self;
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PHOTO_TYPE_BACKING_READERS, PhotoBackingReaders);
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_handlers_destroy (self);
#line 295 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (self->master);
#line 296 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (self->developer);
#line 297 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_file_adapter_unref0 (self->editable);
#line 32375 "Photo.c"
}


static GType photo_backing_readers_get_type (void) {
	static volatile gsize photo_backing_readers_type_id__volatile = 0;
	if (g_once_init_enter (&photo_backing_readers_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { photo_value_backing_readers_init, photo_value_backing_readers_free_value, photo_value_backing_readers_copy_value, photo_value_backing_readers_peek_pointer, "p", photo_value_backing_readers_collect_value, "p", photo_value_backing_readers_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (PhotoBackingReadersClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) photo_backing_readers_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PhotoBackingReaders), 0, (GInstanceInitFunc) photo_backing_readers_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType photo_backing_readers_type_id;
		photo_backing_readers_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PhotoBackingReaders", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&photo_backing_readers_type_id__volatile, photo_backing_readers_type_id);
	}
	return photo_backing_readers_type_id__volatile;
}


static gpointer photo_backing_readers_ref (gpointer instance) {
	PhotoBackingReaders* self;
	self = instance;
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	g_atomic_int_inc (&self->ref_count);
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	return instance;
#line 32400 "Photo.c"
}


static void photo_backing_readers_unref (gpointer instance) {
	PhotoBackingReaders* self;
	self = instance;
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		PHOTO_BACKING_READERS_GET_CLASS (self)->finalize (self);
#line 294 "/home/jens/Source/shotwell/src/Photo.vala"
		g_type_free_instance ((GTypeInstance *) self);
#line 32413 "Photo.c"
	}
}


static PhotoCachedPixbuf* photo_cached_pixbuf_construct (GType object_type, Photo* photo, GdkPixbuf* pixbuf) {
	PhotoCachedPixbuf* self = NULL;
	Photo* _tmp0_ = NULL;
	Photo* _tmp1_ = NULL;
	GdkPixbuf* _tmp2_ = NULL;
	GdkPixbuf* _tmp3_ = NULL;
#line 305 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO (photo), NULL);
#line 305 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
#line 305 "/home/jens/Source/shotwell/src/Photo.vala"
	self = (PhotoCachedPixbuf*) g_type_create_instance (object_type);
#line 306 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo;
#line 306 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 306 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->photo);
#line 306 "/home/jens/Source/shotwell/src/Photo.vala"
	self->photo = _tmp1_;
#line 307 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = pixbuf;
#line 307 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 307 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->pixbuf);
#line 307 "/home/jens/Source/shotwell/src/Photo.vala"
	self->pixbuf = _tmp3_;
#line 305 "/home/jens/Source/shotwell/src/Photo.vala"
	return self;
#line 32448 "Photo.c"
}


static PhotoCachedPixbuf* photo_cached_pixbuf_new (Photo* photo, GdkPixbuf* pixbuf) {
#line 305 "/home/jens/Source/shotwell/src/Photo.vala"
	return photo_cached_pixbuf_construct (PHOTO_TYPE_CACHED_PIXBUF, photo, pixbuf);
#line 32455 "Photo.c"
}


static void photo_value_cached_pixbuf_init (GValue* value) {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	value->data[0].v_pointer = NULL;
#line 32462 "Photo.c"
}


static void photo_value_cached_pixbuf_free_value (GValue* value) {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	if (value->data[0].v_pointer) {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_cached_pixbuf_unref (value->data[0].v_pointer);
#line 32471 "Photo.c"
	}
}


static void photo_value_cached_pixbuf_copy_value (const GValue* src_value, GValue* dest_value) {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	if (src_value->data[0].v_pointer) {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		dest_value->data[0].v_pointer = photo_cached_pixbuf_ref (src_value->data[0].v_pointer);
#line 32481 "Photo.c"
	} else {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		dest_value->data[0].v_pointer = NULL;
#line 32485 "Photo.c"
	}
}


static gpointer photo_value_cached_pixbuf_peek_pointer (const GValue* value) {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	return value->data[0].v_pointer;
#line 32493 "Photo.c"
}


static gchar* photo_value_cached_pixbuf_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	if (collect_values[0].v_pointer) {
#line 32500 "Photo.c"
		PhotoCachedPixbuf* object;
		object = collect_values[0].v_pointer;
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		if (object->parent_instance.g_class == NULL) {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 32507 "Photo.c"
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 32511 "Photo.c"
		}
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = photo_cached_pixbuf_ref (object);
#line 32515 "Photo.c"
	} else {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 32519 "Photo.c"
	}
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	return NULL;
#line 32523 "Photo.c"
}


static gchar* photo_value_cached_pixbuf_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	PhotoCachedPixbuf** object_p;
	object_p = collect_values[0].v_pointer;
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!object_p) {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 32534 "Photo.c"
	}
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!value->data[0].v_pointer) {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = NULL;
#line 32540 "Photo.c"
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = value->data[0].v_pointer;
#line 32544 "Photo.c"
	} else {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = photo_cached_pixbuf_ref (value->data[0].v_pointer);
#line 32548 "Photo.c"
	}
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	return NULL;
#line 32552 "Photo.c"
}


static GParamSpec* photo_param_spec_cached_pixbuf (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	PhotoParamSpecCachedPixbuf* spec;
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (g_type_is_a (object_type, PHOTO_TYPE_CACHED_PIXBUF), NULL);
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	G_PARAM_SPEC (spec)->value_type = object_type;
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	return G_PARAM_SPEC (spec);
#line 32566 "Photo.c"
}


static gpointer photo_value_get_cached_pixbuf (const GValue* value) {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PHOTO_TYPE_CACHED_PIXBUF), NULL);
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	return value->data[0].v_pointer;
#line 32575 "Photo.c"
}


static void photo_value_set_cached_pixbuf (GValue* value, gpointer v_object) {
	PhotoCachedPixbuf* old;
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PHOTO_TYPE_CACHED_PIXBUF));
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	old = value->data[0].v_pointer;
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	if (v_object) {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PHOTO_TYPE_CACHED_PIXBUF));
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = v_object;
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_cached_pixbuf_ref (value->data[0].v_pointer);
#line 32595 "Photo.c"
	} else {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 32599 "Photo.c"
	}
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	if (old) {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_cached_pixbuf_unref (old);
#line 32605 "Photo.c"
	}
}


static void photo_value_take_cached_pixbuf (GValue* value, gpointer v_object) {
	PhotoCachedPixbuf* old;
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PHOTO_TYPE_CACHED_PIXBUF));
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	old = value->data[0].v_pointer;
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	if (v_object) {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PHOTO_TYPE_CACHED_PIXBUF));
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = v_object;
#line 32624 "Photo.c"
	} else {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 32628 "Photo.c"
	}
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	if (old) {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_cached_pixbuf_unref (old);
#line 32634 "Photo.c"
	}
}


static void photo_cached_pixbuf_class_init (PhotoCachedPixbufClass * klass) {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_cached_pixbuf_parent_class = g_type_class_peek_parent (klass);
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoCachedPixbufClass *) klass)->finalize = photo_cached_pixbuf_finalize;
#line 32644 "Photo.c"
}


static void photo_cached_pixbuf_instance_init (PhotoCachedPixbuf * self) {
	GTimer* _tmp0_ = NULL;
#line 303 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = g_timer_new ();
#line 303 "/home/jens/Source/shotwell/src/Photo.vala"
	self->last_touched = _tmp0_;
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	self->ref_count = 1;
#line 32656 "Photo.c"
}


static void photo_cached_pixbuf_finalize (PhotoCachedPixbuf* obj) {
	PhotoCachedPixbuf * self;
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PHOTO_TYPE_CACHED_PIXBUF, PhotoCachedPixbuf);
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_handlers_destroy (self);
#line 301 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->photo);
#line 302 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->pixbuf);
#line 303 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_timer_destroy0 (self->last_touched);
#line 32672 "Photo.c"
}


static GType photo_cached_pixbuf_get_type (void) {
	static volatile gsize photo_cached_pixbuf_type_id__volatile = 0;
	if (g_once_init_enter (&photo_cached_pixbuf_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { photo_value_cached_pixbuf_init, photo_value_cached_pixbuf_free_value, photo_value_cached_pixbuf_copy_value, photo_value_cached_pixbuf_peek_pointer, "p", photo_value_cached_pixbuf_collect_value, "p", photo_value_cached_pixbuf_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (PhotoCachedPixbufClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) photo_cached_pixbuf_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PhotoCachedPixbuf), 0, (GInstanceInitFunc) photo_cached_pixbuf_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType photo_cached_pixbuf_type_id;
		photo_cached_pixbuf_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PhotoCachedPixbuf", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&photo_cached_pixbuf_type_id__volatile, photo_cached_pixbuf_type_id);
	}
	return photo_cached_pixbuf_type_id__volatile;
}


static gpointer photo_cached_pixbuf_ref (gpointer instance) {
	PhotoCachedPixbuf* self;
	self = instance;
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	g_atomic_int_inc (&self->ref_count);
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	return instance;
#line 32697 "Photo.c"
}


static void photo_cached_pixbuf_unref (gpointer instance) {
	PhotoCachedPixbuf* self;
	self = instance;
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		PHOTO_CACHED_PIXBUF_GET_CLASS (self)->finalize (self);
#line 300 "/home/jens/Source/shotwell/src/Photo.vala"
		g_type_free_instance ((GTypeInstance *) self);
#line 32710 "Photo.c"
	}
}


PhotoReimportMasterState* photo_reimport_master_state_construct (GType object_type) {
	PhotoReimportMasterState* self = NULL;
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	self = (PhotoReimportMasterState*) g_type_create_instance (object_type);
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	return self;
#line 32721 "Photo.c"
}


static void photo_value_reimport_master_state_init (GValue* value) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	value->data[0].v_pointer = NULL;
#line 32728 "Photo.c"
}


static void photo_value_reimport_master_state_free_value (GValue* value) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	if (value->data[0].v_pointer) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_reimport_master_state_unref (value->data[0].v_pointer);
#line 32737 "Photo.c"
	}
}


static void photo_value_reimport_master_state_copy_value (const GValue* src_value, GValue* dest_value) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	if (src_value->data[0].v_pointer) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		dest_value->data[0].v_pointer = photo_reimport_master_state_ref (src_value->data[0].v_pointer);
#line 32747 "Photo.c"
	} else {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		dest_value->data[0].v_pointer = NULL;
#line 32751 "Photo.c"
	}
}


static gpointer photo_value_reimport_master_state_peek_pointer (const GValue* value) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	return value->data[0].v_pointer;
#line 32759 "Photo.c"
}


static gchar* photo_value_reimport_master_state_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	if (collect_values[0].v_pointer) {
#line 32766 "Photo.c"
		PhotoReimportMasterState* object;
		object = collect_values[0].v_pointer;
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		if (object->parent_instance.g_class == NULL) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 32773 "Photo.c"
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 32777 "Photo.c"
		}
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = photo_reimport_master_state_ref (object);
#line 32781 "Photo.c"
	} else {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 32785 "Photo.c"
	}
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	return NULL;
#line 32789 "Photo.c"
}


static gchar* photo_value_reimport_master_state_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	PhotoReimportMasterState** object_p;
	object_p = collect_values[0].v_pointer;
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!object_p) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 32800 "Photo.c"
	}
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!value->data[0].v_pointer) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = NULL;
#line 32806 "Photo.c"
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = value->data[0].v_pointer;
#line 32810 "Photo.c"
	} else {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = photo_reimport_master_state_ref (value->data[0].v_pointer);
#line 32814 "Photo.c"
	}
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	return NULL;
#line 32818 "Photo.c"
}


GParamSpec* photo_param_spec_reimport_master_state (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	PhotoParamSpecReimportMasterState* spec;
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (g_type_is_a (object_type, PHOTO_TYPE_REIMPORT_MASTER_STATE), NULL);
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	G_PARAM_SPEC (spec)->value_type = object_type;
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	return G_PARAM_SPEC (spec);
#line 32832 "Photo.c"
}


gpointer photo_value_get_reimport_master_state (const GValue* value) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PHOTO_TYPE_REIMPORT_MASTER_STATE), NULL);
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	return value->data[0].v_pointer;
#line 32841 "Photo.c"
}


void photo_value_set_reimport_master_state (GValue* value, gpointer v_object) {
	PhotoReimportMasterState* old;
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PHOTO_TYPE_REIMPORT_MASTER_STATE));
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	old = value->data[0].v_pointer;
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	if (v_object) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PHOTO_TYPE_REIMPORT_MASTER_STATE));
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = v_object;
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_reimport_master_state_ref (value->data[0].v_pointer);
#line 32861 "Photo.c"
	} else {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 32865 "Photo.c"
	}
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	if (old) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_reimport_master_state_unref (old);
#line 32871 "Photo.c"
	}
}


void photo_value_take_reimport_master_state (GValue* value, gpointer v_object) {
	PhotoReimportMasterState* old;
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PHOTO_TYPE_REIMPORT_MASTER_STATE));
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	old = value->data[0].v_pointer;
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	if (v_object) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PHOTO_TYPE_REIMPORT_MASTER_STATE));
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = v_object;
#line 32890 "Photo.c"
	} else {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 32894 "Photo.c"
	}
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	if (old) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_reimport_master_state_unref (old);
#line 32900 "Photo.c"
	}
}


static void photo_reimport_master_state_class_init (PhotoReimportMasterStateClass * klass) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_reimport_master_state_parent_class = g_type_class_peek_parent (klass);
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoReimportMasterStateClass *) klass)->finalize = photo_reimport_master_state_finalize;
#line 32910 "Photo.c"
}


static void photo_reimport_master_state_instance_init (PhotoReimportMasterState * self) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	self->ref_count = 1;
#line 32917 "Photo.c"
}


static void photo_reimport_master_state_finalize (PhotoReimportMasterState* obj) {
	PhotoReimportMasterState * self;
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PHOTO_TYPE_REIMPORT_MASTER_STATE, PhotoReimportMasterState);
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_handlers_destroy (self);
#line 32927 "Photo.c"
}


GType photo_reimport_master_state_get_type (void) {
	static volatile gsize photo_reimport_master_state_type_id__volatile = 0;
	if (g_once_init_enter (&photo_reimport_master_state_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { photo_value_reimport_master_state_init, photo_value_reimport_master_state_free_value, photo_value_reimport_master_state_copy_value, photo_value_reimport_master_state_peek_pointer, "p", photo_value_reimport_master_state_collect_value, "p", photo_value_reimport_master_state_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (PhotoReimportMasterStateClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) photo_reimport_master_state_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PhotoReimportMasterState), 0, (GInstanceInitFunc) photo_reimport_master_state_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType photo_reimport_master_state_type_id;
		photo_reimport_master_state_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PhotoReimportMasterState", &g_define_type_info, &g_define_type_fundamental_info, G_TYPE_FLAG_ABSTRACT);
		g_once_init_leave (&photo_reimport_master_state_type_id__volatile, photo_reimport_master_state_type_id);
	}
	return photo_reimport_master_state_type_id__volatile;
}


gpointer photo_reimport_master_state_ref (gpointer instance) {
	PhotoReimportMasterState* self;
	self = instance;
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	g_atomic_int_inc (&self->ref_count);
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	return instance;
#line 32952 "Photo.c"
}


void photo_reimport_master_state_unref (gpointer instance) {
	PhotoReimportMasterState* self;
	self = instance;
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		PHOTO_REIMPORT_MASTER_STATE_GET_CLASS (self)->finalize (self);
#line 1350 "/home/jens/Source/shotwell/src/Photo.vala"
		g_type_free_instance ((GTypeInstance *) self);
#line 32965 "Photo.c"
	}
}


static gchar** _vala_array_dup23 (gchar** self, int length) {
	gchar** result;
	int i;
#line 1362 "/home/jens/Source/shotwell/src/Photo.vala"
	result = g_new0 (gchar*, length + 1);
#line 1362 "/home/jens/Source/shotwell/src/Photo.vala"
	for (i = 0; i < length; i++) {
#line 32977 "Photo.c"
		gchar* _tmp0_ = NULL;
#line 1362 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = g_strdup (self[i]);
#line 1362 "/home/jens/Source/shotwell/src/Photo.vala"
		result[i] = _tmp0_;
#line 32983 "Photo.c"
	}
#line 1362 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 32987 "Photo.c"
}


static PhotoReimportMasterStateImpl* photo_reimport_master_state_impl_construct (GType object_type, PhotoRow* row, PhotoMetadata* metadata, gchar** alterations, int alterations_length1) {
	PhotoReimportMasterStateImpl* self = NULL;
	PhotoRow* _tmp0_ = NULL;
	PhotoRow* _tmp1_ = NULL;
	PhotoMetadata* _tmp2_ = NULL;
	PhotoMetadata* _tmp3_ = NULL;
	gchar** _tmp4_ = NULL;
	gint _tmp4__length1 = 0;
	gchar** _tmp5_ = NULL;
	gint _tmp5__length1 = 0;
#line 1359 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO_ROW (row), NULL);
#line 1359 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata), NULL);
#line 1359 "/home/jens/Source/shotwell/src/Photo.vala"
	self = (PhotoReimportMasterStateImpl*) photo_reimport_master_state_construct (object_type);
#line 1360 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = row;
#line 1360 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _photo_row_ref0 (_tmp0_);
#line 1360 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_row_unref0 (self->row);
#line 1360 "/home/jens/Source/shotwell/src/Photo.vala"
	self->row = _tmp1_;
#line 1361 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = metadata;
#line 1361 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _media_metadata_ref0 (_tmp2_);
#line 1361 "/home/jens/Source/shotwell/src/Photo.vala"
	_media_metadata_unref0 (self->metadata);
#line 1361 "/home/jens/Source/shotwell/src/Photo.vala"
	self->metadata = _tmp3_;
#line 1362 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = alterations;
#line 1362 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4__length1 = alterations_length1;
#line 1362 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = (_tmp4_ != NULL) ? _vala_array_dup23 (_tmp4_, _tmp4__length1) : ((gpointer) _tmp4_);
#line 1362 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5__length1 = _tmp4__length1;
#line 1362 "/home/jens/Source/shotwell/src/Photo.vala"
	self->alterations = (_vala_array_free (self->alterations, self->alterations_length1, (GDestroyNotify) g_free), NULL);
#line 1362 "/home/jens/Source/shotwell/src/Photo.vala"
	self->alterations = _tmp5_;
#line 1362 "/home/jens/Source/shotwell/src/Photo.vala"
	self->alterations_length1 = _tmp5__length1;
#line 1362 "/home/jens/Source/shotwell/src/Photo.vala"
	self->_alterations_size_ = self->alterations_length1;
#line 1359 "/home/jens/Source/shotwell/src/Photo.vala"
	return self;
#line 33041 "Photo.c"
}


static PhotoReimportMasterStateImpl* photo_reimport_master_state_impl_new (PhotoRow* row, PhotoMetadata* metadata, gchar** alterations, int alterations_length1) {
#line 1359 "/home/jens/Source/shotwell/src/Photo.vala"
	return photo_reimport_master_state_impl_construct (PHOTO_TYPE_REIMPORT_MASTER_STATE_IMPL, row, metadata, alterations, alterations_length1);
#line 33048 "Photo.c"
}


static void photo_reimport_master_state_impl_class_init (PhotoReimportMasterStateImplClass * klass) {
#line 1353 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_reimport_master_state_impl_parent_class = g_type_class_peek_parent (klass);
#line 1353 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoReimportMasterStateClass *) klass)->finalize = photo_reimport_master_state_impl_finalize;
#line 33057 "Photo.c"
}


static void photo_reimport_master_state_impl_instance_init (PhotoReimportMasterStateImpl * self) {
	PhotoRow* _tmp0_ = NULL;
#line 1354 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_row_new ();
#line 1354 "/home/jens/Source/shotwell/src/Photo.vala"
	self->row = _tmp0_;
#line 1357 "/home/jens/Source/shotwell/src/Photo.vala"
	self->metadata_only = FALSE;
#line 33069 "Photo.c"
}


static void photo_reimport_master_state_impl_finalize (PhotoReimportMasterState* obj) {
	PhotoReimportMasterStateImpl * self;
#line 1353 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PHOTO_TYPE_REIMPORT_MASTER_STATE_IMPL, PhotoReimportMasterStateImpl);
#line 1354 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_row_unref0 (self->row);
#line 1355 "/home/jens/Source/shotwell/src/Photo.vala"
	_media_metadata_unref0 (self->metadata);
#line 1356 "/home/jens/Source/shotwell/src/Photo.vala"
	self->alterations = (_vala_array_free (self->alterations, self->alterations_length1, (GDestroyNotify) g_free), NULL);
#line 1353 "/home/jens/Source/shotwell/src/Photo.vala"
	PHOTO_REIMPORT_MASTER_STATE_CLASS (photo_reimport_master_state_impl_parent_class)->finalize (obj);
#line 33085 "Photo.c"
}


static GType photo_reimport_master_state_impl_get_type (void) {
	static volatile gsize photo_reimport_master_state_impl_type_id__volatile = 0;
	if (g_once_init_enter (&photo_reimport_master_state_impl_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PhotoReimportMasterStateImplClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) photo_reimport_master_state_impl_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PhotoReimportMasterStateImpl), 0, (GInstanceInitFunc) photo_reimport_master_state_impl_instance_init, NULL };
		GType photo_reimport_master_state_impl_type_id;
		photo_reimport_master_state_impl_type_id = g_type_register_static (PHOTO_TYPE_REIMPORT_MASTER_STATE, "PhotoReimportMasterStateImpl", &g_define_type_info, 0);
		g_once_init_leave (&photo_reimport_master_state_impl_type_id__volatile, photo_reimport_master_state_impl_type_id);
	}
	return photo_reimport_master_state_impl_type_id__volatile;
}


PhotoReimportEditableState* photo_reimport_editable_state_construct (GType object_type) {
	PhotoReimportEditableState* self = NULL;
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	self = (PhotoReimportEditableState*) g_type_create_instance (object_type);
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	return self;
#line 33107 "Photo.c"
}


static void photo_value_reimport_editable_state_init (GValue* value) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	value->data[0].v_pointer = NULL;
#line 33114 "Photo.c"
}


static void photo_value_reimport_editable_state_free_value (GValue* value) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	if (value->data[0].v_pointer) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_reimport_editable_state_unref (value->data[0].v_pointer);
#line 33123 "Photo.c"
	}
}


static void photo_value_reimport_editable_state_copy_value (const GValue* src_value, GValue* dest_value) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	if (src_value->data[0].v_pointer) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		dest_value->data[0].v_pointer = photo_reimport_editable_state_ref (src_value->data[0].v_pointer);
#line 33133 "Photo.c"
	} else {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		dest_value->data[0].v_pointer = NULL;
#line 33137 "Photo.c"
	}
}


static gpointer photo_value_reimport_editable_state_peek_pointer (const GValue* value) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	return value->data[0].v_pointer;
#line 33145 "Photo.c"
}


static gchar* photo_value_reimport_editable_state_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	if (collect_values[0].v_pointer) {
#line 33152 "Photo.c"
		PhotoReimportEditableState* object;
		object = collect_values[0].v_pointer;
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		if (object->parent_instance.g_class == NULL) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 33159 "Photo.c"
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 33163 "Photo.c"
		}
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = photo_reimport_editable_state_ref (object);
#line 33167 "Photo.c"
	} else {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 33171 "Photo.c"
	}
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	return NULL;
#line 33175 "Photo.c"
}


static gchar* photo_value_reimport_editable_state_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	PhotoReimportEditableState** object_p;
	object_p = collect_values[0].v_pointer;
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!object_p) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 33186 "Photo.c"
	}
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!value->data[0].v_pointer) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = NULL;
#line 33192 "Photo.c"
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = value->data[0].v_pointer;
#line 33196 "Photo.c"
	} else {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = photo_reimport_editable_state_ref (value->data[0].v_pointer);
#line 33200 "Photo.c"
	}
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	return NULL;
#line 33204 "Photo.c"
}


GParamSpec* photo_param_spec_reimport_editable_state (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	PhotoParamSpecReimportEditableState* spec;
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (g_type_is_a (object_type, PHOTO_TYPE_REIMPORT_EDITABLE_STATE), NULL);
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	G_PARAM_SPEC (spec)->value_type = object_type;
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	return G_PARAM_SPEC (spec);
#line 33218 "Photo.c"
}


gpointer photo_value_get_reimport_editable_state (const GValue* value) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PHOTO_TYPE_REIMPORT_EDITABLE_STATE), NULL);
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	return value->data[0].v_pointer;
#line 33227 "Photo.c"
}


void photo_value_set_reimport_editable_state (GValue* value, gpointer v_object) {
	PhotoReimportEditableState* old;
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PHOTO_TYPE_REIMPORT_EDITABLE_STATE));
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	old = value->data[0].v_pointer;
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	if (v_object) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PHOTO_TYPE_REIMPORT_EDITABLE_STATE));
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = v_object;
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_reimport_editable_state_ref (value->data[0].v_pointer);
#line 33247 "Photo.c"
	} else {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 33251 "Photo.c"
	}
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	if (old) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_reimport_editable_state_unref (old);
#line 33257 "Photo.c"
	}
}


void photo_value_take_reimport_editable_state (GValue* value, gpointer v_object) {
	PhotoReimportEditableState* old;
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PHOTO_TYPE_REIMPORT_EDITABLE_STATE));
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	old = value->data[0].v_pointer;
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	if (v_object) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PHOTO_TYPE_REIMPORT_EDITABLE_STATE));
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = v_object;
#line 33276 "Photo.c"
	} else {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 33280 "Photo.c"
	}
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	if (old) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_reimport_editable_state_unref (old);
#line 33286 "Photo.c"
	}
}


static void photo_reimport_editable_state_class_init (PhotoReimportEditableStateClass * klass) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_reimport_editable_state_parent_class = g_type_class_peek_parent (klass);
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoReimportEditableStateClass *) klass)->finalize = photo_reimport_editable_state_finalize;
#line 33296 "Photo.c"
}


static void photo_reimport_editable_state_instance_init (PhotoReimportEditableState * self) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	self->ref_count = 1;
#line 33303 "Photo.c"
}


static void photo_reimport_editable_state_finalize (PhotoReimportEditableState* obj) {
	PhotoReimportEditableState * self;
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PHOTO_TYPE_REIMPORT_EDITABLE_STATE, PhotoReimportEditableState);
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_handlers_destroy (self);
#line 33313 "Photo.c"
}


GType photo_reimport_editable_state_get_type (void) {
	static volatile gsize photo_reimport_editable_state_type_id__volatile = 0;
	if (g_once_init_enter (&photo_reimport_editable_state_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { photo_value_reimport_editable_state_init, photo_value_reimport_editable_state_free_value, photo_value_reimport_editable_state_copy_value, photo_value_reimport_editable_state_peek_pointer, "p", photo_value_reimport_editable_state_collect_value, "p", photo_value_reimport_editable_state_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (PhotoReimportEditableStateClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) photo_reimport_editable_state_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PhotoReimportEditableState), 0, (GInstanceInitFunc) photo_reimport_editable_state_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType photo_reimport_editable_state_type_id;
		photo_reimport_editable_state_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PhotoReimportEditableState", &g_define_type_info, &g_define_type_fundamental_info, G_TYPE_FLAG_ABSTRACT);
		g_once_init_leave (&photo_reimport_editable_state_type_id__volatile, photo_reimport_editable_state_type_id);
	}
	return photo_reimport_editable_state_type_id__volatile;
}


gpointer photo_reimport_editable_state_ref (gpointer instance) {
	PhotoReimportEditableState* self;
	self = instance;
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	g_atomic_int_inc (&self->ref_count);
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	return instance;
#line 33338 "Photo.c"
}


void photo_reimport_editable_state_unref (gpointer instance) {
	PhotoReimportEditableState* self;
	self = instance;
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		PHOTO_REIMPORT_EDITABLE_STATE_GET_CLASS (self)->finalize (self);
#line 1366 "/home/jens/Source/shotwell/src/Photo.vala"
		g_type_free_instance ((GTypeInstance *) self);
#line 33351 "Photo.c"
	}
}


static PhotoReimportEditableStateImpl* photo_reimport_editable_state_impl_construct (GType object_type, BackingPhotoRow* backing_state, PhotoMetadata* metadata) {
	PhotoReimportEditableStateImpl* self = NULL;
	BackingPhotoRow* _tmp0_ = NULL;
	BackingPhotoRow* _tmp1_ = NULL;
	PhotoMetadata* _tmp2_ = NULL;
	PhotoMetadata* _tmp3_ = NULL;
#line 1374 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_BACKING_PHOTO_ROW (backing_state), NULL);
#line 1374 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata), NULL);
#line 1374 "/home/jens/Source/shotwell/src/Photo.vala"
	self = (PhotoReimportEditableStateImpl*) photo_reimport_editable_state_construct (object_type);
#line 1375 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = backing_state;
#line 1375 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _backing_photo_row_ref0 (_tmp0_);
#line 1375 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (self->backing_state);
#line 1375 "/home/jens/Source/shotwell/src/Photo.vala"
	self->backing_state = _tmp1_;
#line 1376 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = metadata;
#line 1376 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _media_metadata_ref0 (_tmp2_);
#line 1376 "/home/jens/Source/shotwell/src/Photo.vala"
	_media_metadata_unref0 (self->metadata);
#line 1376 "/home/jens/Source/shotwell/src/Photo.vala"
	self->metadata = _tmp3_;
#line 1374 "/home/jens/Source/shotwell/src/Photo.vala"
	return self;
#line 33386 "Photo.c"
}


static PhotoReimportEditableStateImpl* photo_reimport_editable_state_impl_new (BackingPhotoRow* backing_state, PhotoMetadata* metadata) {
#line 1374 "/home/jens/Source/shotwell/src/Photo.vala"
	return photo_reimport_editable_state_impl_construct (PHOTO_TYPE_REIMPORT_EDITABLE_STATE_IMPL, backing_state, metadata);
#line 33393 "Photo.c"
}


static void photo_reimport_editable_state_impl_class_init (PhotoReimportEditableStateImplClass * klass) {
#line 1369 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_reimport_editable_state_impl_parent_class = g_type_class_peek_parent (klass);
#line 1369 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoReimportEditableStateClass *) klass)->finalize = photo_reimport_editable_state_impl_finalize;
#line 33402 "Photo.c"
}


static void photo_reimport_editable_state_impl_instance_init (PhotoReimportEditableStateImpl * self) {
	BackingPhotoRow* _tmp0_ = NULL;
#line 1370 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = backing_photo_row_new ();
#line 1370 "/home/jens/Source/shotwell/src/Photo.vala"
	self->backing_state = _tmp0_;
#line 1372 "/home/jens/Source/shotwell/src/Photo.vala"
	self->metadata_only = FALSE;
#line 33414 "Photo.c"
}


static void photo_reimport_editable_state_impl_finalize (PhotoReimportEditableState* obj) {
	PhotoReimportEditableStateImpl * self;
#line 1369 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PHOTO_TYPE_REIMPORT_EDITABLE_STATE_IMPL, PhotoReimportEditableStateImpl);
#line 1370 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (self->backing_state);
#line 1371 "/home/jens/Source/shotwell/src/Photo.vala"
	_media_metadata_unref0 (self->metadata);
#line 1369 "/home/jens/Source/shotwell/src/Photo.vala"
	PHOTO_REIMPORT_EDITABLE_STATE_CLASS (photo_reimport_editable_state_impl_parent_class)->finalize (obj);
#line 33428 "Photo.c"
}


static GType photo_reimport_editable_state_impl_get_type (void) {
	static volatile gsize photo_reimport_editable_state_impl_type_id__volatile = 0;
	if (g_once_init_enter (&photo_reimport_editable_state_impl_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PhotoReimportEditableStateImplClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) photo_reimport_editable_state_impl_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PhotoReimportEditableStateImpl), 0, (GInstanceInitFunc) photo_reimport_editable_state_impl_instance_init, NULL };
		GType photo_reimport_editable_state_impl_type_id;
		photo_reimport_editable_state_impl_type_id = g_type_register_static (PHOTO_TYPE_REIMPORT_EDITABLE_STATE, "PhotoReimportEditableStateImpl", &g_define_type_info, 0);
		g_once_init_leave (&photo_reimport_editable_state_impl_type_id__volatile, photo_reimport_editable_state_impl_type_id);
	}
	return photo_reimport_editable_state_impl_type_id__volatile;
}


PhotoReimportRawDevelopmentState* photo_reimport_raw_development_state_construct (GType object_type) {
	PhotoReimportRawDevelopmentState* self = NULL;
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	self = (PhotoReimportRawDevelopmentState*) g_type_create_instance (object_type);
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	return self;
#line 33450 "Photo.c"
}


static void photo_value_reimport_raw_development_state_init (GValue* value) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	value->data[0].v_pointer = NULL;
#line 33457 "Photo.c"
}


static void photo_value_reimport_raw_development_state_free_value (GValue* value) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	if (value->data[0].v_pointer) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_reimport_raw_development_state_unref (value->data[0].v_pointer);
#line 33466 "Photo.c"
	}
}


static void photo_value_reimport_raw_development_state_copy_value (const GValue* src_value, GValue* dest_value) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	if (src_value->data[0].v_pointer) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		dest_value->data[0].v_pointer = photo_reimport_raw_development_state_ref (src_value->data[0].v_pointer);
#line 33476 "Photo.c"
	} else {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		dest_value->data[0].v_pointer = NULL;
#line 33480 "Photo.c"
	}
}


static gpointer photo_value_reimport_raw_development_state_peek_pointer (const GValue* value) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	return value->data[0].v_pointer;
#line 33488 "Photo.c"
}


static gchar* photo_value_reimport_raw_development_state_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	if (collect_values[0].v_pointer) {
#line 33495 "Photo.c"
		PhotoReimportRawDevelopmentState* object;
		object = collect_values[0].v_pointer;
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		if (object->parent_instance.g_class == NULL) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 33502 "Photo.c"
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 33506 "Photo.c"
		}
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = photo_reimport_raw_development_state_ref (object);
#line 33510 "Photo.c"
	} else {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 33514 "Photo.c"
	}
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	return NULL;
#line 33518 "Photo.c"
}


static gchar* photo_value_reimport_raw_development_state_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	PhotoReimportRawDevelopmentState** object_p;
	object_p = collect_values[0].v_pointer;
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!object_p) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 33529 "Photo.c"
	}
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!value->data[0].v_pointer) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = NULL;
#line 33535 "Photo.c"
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = value->data[0].v_pointer;
#line 33539 "Photo.c"
	} else {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = photo_reimport_raw_development_state_ref (value->data[0].v_pointer);
#line 33543 "Photo.c"
	}
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	return NULL;
#line 33547 "Photo.c"
}


GParamSpec* photo_param_spec_reimport_raw_development_state (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	PhotoParamSpecReimportRawDevelopmentState* spec;
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (g_type_is_a (object_type, PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE), NULL);
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	G_PARAM_SPEC (spec)->value_type = object_type;
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	return G_PARAM_SPEC (spec);
#line 33561 "Photo.c"
}


gpointer photo_value_get_reimport_raw_development_state (const GValue* value) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE), NULL);
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	return value->data[0].v_pointer;
#line 33570 "Photo.c"
}


void photo_value_set_reimport_raw_development_state (GValue* value, gpointer v_object) {
	PhotoReimportRawDevelopmentState* old;
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE));
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	old = value->data[0].v_pointer;
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	if (v_object) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE));
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = v_object;
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_reimport_raw_development_state_ref (value->data[0].v_pointer);
#line 33590 "Photo.c"
	} else {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 33594 "Photo.c"
	}
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	if (old) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_reimport_raw_development_state_unref (old);
#line 33600 "Photo.c"
	}
}


void photo_value_take_reimport_raw_development_state (GValue* value, gpointer v_object) {
	PhotoReimportRawDevelopmentState* old;
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE));
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	old = value->data[0].v_pointer;
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	if (v_object) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE));
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = v_object;
#line 33619 "Photo.c"
	} else {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 33623 "Photo.c"
	}
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	if (old) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_reimport_raw_development_state_unref (old);
#line 33629 "Photo.c"
	}
}


static void photo_reimport_raw_development_state_class_init (PhotoReimportRawDevelopmentStateClass * klass) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_reimport_raw_development_state_parent_class = g_type_class_peek_parent (klass);
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoReimportRawDevelopmentStateClass *) klass)->finalize = photo_reimport_raw_development_state_finalize;
#line 33639 "Photo.c"
}


static void photo_reimport_raw_development_state_instance_init (PhotoReimportRawDevelopmentState * self) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	self->ref_count = 1;
#line 33646 "Photo.c"
}


static void photo_reimport_raw_development_state_finalize (PhotoReimportRawDevelopmentState* obj) {
	PhotoReimportRawDevelopmentState * self;
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE, PhotoReimportRawDevelopmentState);
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_handlers_destroy (self);
#line 33656 "Photo.c"
}


GType photo_reimport_raw_development_state_get_type (void) {
	static volatile gsize photo_reimport_raw_development_state_type_id__volatile = 0;
	if (g_once_init_enter (&photo_reimport_raw_development_state_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { photo_value_reimport_raw_development_state_init, photo_value_reimport_raw_development_state_free_value, photo_value_reimport_raw_development_state_copy_value, photo_value_reimport_raw_development_state_peek_pointer, "p", photo_value_reimport_raw_development_state_collect_value, "p", photo_value_reimport_raw_development_state_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (PhotoReimportRawDevelopmentStateClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) photo_reimport_raw_development_state_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PhotoReimportRawDevelopmentState), 0, (GInstanceInitFunc) photo_reimport_raw_development_state_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType photo_reimport_raw_development_state_type_id;
		photo_reimport_raw_development_state_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PhotoReimportRawDevelopmentState", &g_define_type_info, &g_define_type_fundamental_info, G_TYPE_FLAG_ABSTRACT);
		g_once_init_leave (&photo_reimport_raw_development_state_type_id__volatile, photo_reimport_raw_development_state_type_id);
	}
	return photo_reimport_raw_development_state_type_id__volatile;
}


gpointer photo_reimport_raw_development_state_ref (gpointer instance) {
	PhotoReimportRawDevelopmentState* self;
	self = instance;
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	g_atomic_int_inc (&self->ref_count);
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	return instance;
#line 33681 "Photo.c"
}


void photo_reimport_raw_development_state_unref (gpointer instance) {
	PhotoReimportRawDevelopmentState* self;
	self = instance;
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_GET_CLASS (self)->finalize (self);
#line 1380 "/home/jens/Source/shotwell/src/Photo.vala"
		g_type_free_instance ((GTypeInstance *) self);
#line 33694 "Photo.c"
	}
}


static PhotoReimportRawDevelopmentStateImpl* photo_reimport_raw_development_state_impl_construct (GType object_type) {
	PhotoReimportRawDevelopmentStateImpl* self = NULL;
#line 1397 "/home/jens/Source/shotwell/src/Photo.vala"
	self = (PhotoReimportRawDevelopmentStateImpl*) photo_reimport_raw_development_state_construct (object_type);
#line 1397 "/home/jens/Source/shotwell/src/Photo.vala"
	return self;
#line 33705 "Photo.c"
}


static PhotoReimportRawDevelopmentStateImpl* photo_reimport_raw_development_state_impl_new (void) {
#line 1397 "/home/jens/Source/shotwell/src/Photo.vala"
	return photo_reimport_raw_development_state_impl_construct (PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL);
#line 33712 "Photo.c"
}


static void photo_reimport_raw_development_state_impl_add (PhotoReimportRawDevelopmentStateImpl* self, BackingPhotoRow* backing, PhotoMetadata* metadata) {
	GeeCollection* _tmp0_ = NULL;
	BackingPhotoRow* _tmp1_ = NULL;
	PhotoMetadata* _tmp2_ = NULL;
	PhotoReimportRawDevelopmentStateImplDevToReimport* _tmp3_ = NULL;
	PhotoReimportRawDevelopmentStateImplDevToReimport* _tmp4_ = NULL;
#line 1400 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (PHOTO_IS_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL (self));
#line 1400 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_BACKING_PHOTO_ROW (backing));
#line 1400 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 1401 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = self->list;
#line 1401 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = backing;
#line 1401 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = metadata;
#line 1401 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = photo_reimport_raw_development_state_impl_dev_to_reimport_new (_tmp1_, _tmp2_);
#line 1401 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = _tmp3_;
#line 1401 "/home/jens/Source/shotwell/src/Photo.vala"
	gee_collection_add (_tmp0_, _tmp4_);
#line 1401 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_reimport_raw_development_state_impl_dev_to_reimport_unref0 (_tmp4_);
#line 33742 "Photo.c"
}


static gint photo_reimport_raw_development_state_impl_get_size (PhotoReimportRawDevelopmentStateImpl* self) {
	gint result = 0;
	GeeCollection* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
#line 1404 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (PHOTO_IS_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL (self), 0);
#line 1405 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = self->list;
#line 1405 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = gee_collection_get_size (_tmp0_);
#line 1405 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = _tmp1_;
#line 1405 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp2_;
#line 1405 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 33763 "Photo.c"
}


static PhotoReimportRawDevelopmentStateImplDevToReimport* photo_reimport_raw_development_state_impl_dev_to_reimport_construct (GType object_type, BackingPhotoRow* backing, PhotoMetadata* metadata) {
	PhotoReimportRawDevelopmentStateImplDevToReimport* self = NULL;
	BackingPhotoRow* _tmp0_ = NULL;
	BackingPhotoRow* _tmp1_ = NULL;
	PhotoMetadata* _tmp2_ = NULL;
	PhotoMetadata* _tmp3_ = NULL;
#line 1388 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_BACKING_PHOTO_ROW (backing), NULL);
#line 1388 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata), NULL);
#line 1388 "/home/jens/Source/shotwell/src/Photo.vala"
	self = (PhotoReimportRawDevelopmentStateImplDevToReimport*) g_type_create_instance (object_type);
#line 1389 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = backing;
#line 1389 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _backing_photo_row_ref0 (_tmp0_);
#line 1389 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (self->backing);
#line 1389 "/home/jens/Source/shotwell/src/Photo.vala"
	self->backing = _tmp1_;
#line 1390 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = metadata;
#line 1390 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _media_metadata_ref0 (_tmp2_);
#line 1390 "/home/jens/Source/shotwell/src/Photo.vala"
	_media_metadata_unref0 (self->metadata);
#line 1390 "/home/jens/Source/shotwell/src/Photo.vala"
	self->metadata = _tmp3_;
#line 1388 "/home/jens/Source/shotwell/src/Photo.vala"
	return self;
#line 33797 "Photo.c"
}


static PhotoReimportRawDevelopmentStateImplDevToReimport* photo_reimport_raw_development_state_impl_dev_to_reimport_new (BackingPhotoRow* backing, PhotoMetadata* metadata) {
#line 1388 "/home/jens/Source/shotwell/src/Photo.vala"
	return photo_reimport_raw_development_state_impl_dev_to_reimport_construct (PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_TYPE_DEV_TO_REIMPORT, backing, metadata);
#line 33804 "Photo.c"
}


static void photo_reimport_raw_development_state_impl_value_dev_to_reimport_init (GValue* value) {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	value->data[0].v_pointer = NULL;
#line 33811 "Photo.c"
}


static void photo_reimport_raw_development_state_impl_value_dev_to_reimport_free_value (GValue* value) {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	if (value->data[0].v_pointer) {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_reimport_raw_development_state_impl_dev_to_reimport_unref (value->data[0].v_pointer);
#line 33820 "Photo.c"
	}
}


static void photo_reimport_raw_development_state_impl_value_dev_to_reimport_copy_value (const GValue* src_value, GValue* dest_value) {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	if (src_value->data[0].v_pointer) {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		dest_value->data[0].v_pointer = photo_reimport_raw_development_state_impl_dev_to_reimport_ref (src_value->data[0].v_pointer);
#line 33830 "Photo.c"
	} else {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		dest_value->data[0].v_pointer = NULL;
#line 33834 "Photo.c"
	}
}


static gpointer photo_reimport_raw_development_state_impl_value_dev_to_reimport_peek_pointer (const GValue* value) {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	return value->data[0].v_pointer;
#line 33842 "Photo.c"
}


static gchar* photo_reimport_raw_development_state_impl_value_dev_to_reimport_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	if (collect_values[0].v_pointer) {
#line 33849 "Photo.c"
		PhotoReimportRawDevelopmentStateImplDevToReimport* object;
		object = collect_values[0].v_pointer;
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		if (object->parent_instance.g_class == NULL) {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 33856 "Photo.c"
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 33860 "Photo.c"
		}
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = photo_reimport_raw_development_state_impl_dev_to_reimport_ref (object);
#line 33864 "Photo.c"
	} else {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 33868 "Photo.c"
	}
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	return NULL;
#line 33872 "Photo.c"
}


static gchar* photo_reimport_raw_development_state_impl_value_dev_to_reimport_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	PhotoReimportRawDevelopmentStateImplDevToReimport** object_p;
	object_p = collect_values[0].v_pointer;
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!object_p) {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 33883 "Photo.c"
	}
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!value->data[0].v_pointer) {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = NULL;
#line 33889 "Photo.c"
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = value->data[0].v_pointer;
#line 33893 "Photo.c"
	} else {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		*object_p = photo_reimport_raw_development_state_impl_dev_to_reimport_ref (value->data[0].v_pointer);
#line 33897 "Photo.c"
	}
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	return NULL;
#line 33901 "Photo.c"
}


static GParamSpec* photo_reimport_raw_development_state_impl_param_spec_dev_to_reimport (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	PhotoReimportRawDevelopmentStateImplParamSpecDevToReimport* spec;
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (g_type_is_a (object_type, PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_TYPE_DEV_TO_REIMPORT), NULL);
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	G_PARAM_SPEC (spec)->value_type = object_type;
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	return G_PARAM_SPEC (spec);
#line 33915 "Photo.c"
}


static gpointer photo_reimport_raw_development_state_impl_value_get_dev_to_reimport (const GValue* value) {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_TYPE_DEV_TO_REIMPORT), NULL);
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	return value->data[0].v_pointer;
#line 33924 "Photo.c"
}


static void photo_reimport_raw_development_state_impl_value_set_dev_to_reimport (GValue* value, gpointer v_object) {
	PhotoReimportRawDevelopmentStateImplDevToReimport* old;
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_TYPE_DEV_TO_REIMPORT));
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	old = value->data[0].v_pointer;
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	if (v_object) {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_TYPE_DEV_TO_REIMPORT));
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = v_object;
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_reimport_raw_development_state_impl_dev_to_reimport_ref (value->data[0].v_pointer);
#line 33944 "Photo.c"
	} else {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 33948 "Photo.c"
	}
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	if (old) {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_reimport_raw_development_state_impl_dev_to_reimport_unref (old);
#line 33954 "Photo.c"
	}
}


static void photo_reimport_raw_development_state_impl_value_take_dev_to_reimport (GValue* value, gpointer v_object) {
	PhotoReimportRawDevelopmentStateImplDevToReimport* old;
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_TYPE_DEV_TO_REIMPORT));
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	old = value->data[0].v_pointer;
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	if (v_object) {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_TYPE_DEV_TO_REIMPORT));
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = v_object;
#line 33973 "Photo.c"
	} else {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		value->data[0].v_pointer = NULL;
#line 33977 "Photo.c"
	}
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	if (old) {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_reimport_raw_development_state_impl_dev_to_reimport_unref (old);
#line 33983 "Photo.c"
	}
}


static void photo_reimport_raw_development_state_impl_dev_to_reimport_class_init (PhotoReimportRawDevelopmentStateImplDevToReimportClass * klass) {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_reimport_raw_development_state_impl_dev_to_reimport_parent_class = g_type_class_peek_parent (klass);
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoReimportRawDevelopmentStateImplDevToReimportClass *) klass)->finalize = photo_reimport_raw_development_state_impl_dev_to_reimport_finalize;
#line 33993 "Photo.c"
}


static void photo_reimport_raw_development_state_impl_dev_to_reimport_instance_init (PhotoReimportRawDevelopmentStateImplDevToReimport * self) {
	BackingPhotoRow* _tmp0_ = NULL;
#line 1385 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = backing_photo_row_new ();
#line 1385 "/home/jens/Source/shotwell/src/Photo.vala"
	self->backing = _tmp0_;
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	self->ref_count = 1;
#line 34005 "Photo.c"
}


static void photo_reimport_raw_development_state_impl_dev_to_reimport_finalize (PhotoReimportRawDevelopmentStateImplDevToReimport* obj) {
	PhotoReimportRawDevelopmentStateImplDevToReimport * self;
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_TYPE_DEV_TO_REIMPORT, PhotoReimportRawDevelopmentStateImplDevToReimport);
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_handlers_destroy (self);
#line 1385 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (self->backing);
#line 1386 "/home/jens/Source/shotwell/src/Photo.vala"
	_media_metadata_unref0 (self->metadata);
#line 34019 "Photo.c"
}


GType photo_reimport_raw_development_state_impl_dev_to_reimport_get_type (void) {
	static volatile gsize photo_reimport_raw_development_state_impl_dev_to_reimport_type_id__volatile = 0;
	if (g_once_init_enter (&photo_reimport_raw_development_state_impl_dev_to_reimport_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { photo_reimport_raw_development_state_impl_value_dev_to_reimport_init, photo_reimport_raw_development_state_impl_value_dev_to_reimport_free_value, photo_reimport_raw_development_state_impl_value_dev_to_reimport_copy_value, photo_reimport_raw_development_state_impl_value_dev_to_reimport_peek_pointer, "p", photo_reimport_raw_development_state_impl_value_dev_to_reimport_collect_value, "p", photo_reimport_raw_development_state_impl_value_dev_to_reimport_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (PhotoReimportRawDevelopmentStateImplDevToReimportClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) photo_reimport_raw_development_state_impl_dev_to_reimport_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PhotoReimportRawDevelopmentStateImplDevToReimport), 0, (GInstanceInitFunc) photo_reimport_raw_development_state_impl_dev_to_reimport_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType photo_reimport_raw_development_state_impl_dev_to_reimport_type_id;
		photo_reimport_raw_development_state_impl_dev_to_reimport_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PhotoReimportRawDevelopmentStateImplDevToReimport", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&photo_reimport_raw_development_state_impl_dev_to_reimport_type_id__volatile, photo_reimport_raw_development_state_impl_dev_to_reimport_type_id);
	}
	return photo_reimport_raw_development_state_impl_dev_to_reimport_type_id__volatile;
}


static gpointer photo_reimport_raw_development_state_impl_dev_to_reimport_ref (gpointer instance) {
	PhotoReimportRawDevelopmentStateImplDevToReimport* self;
	self = instance;
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	g_atomic_int_inc (&self->ref_count);
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	return instance;
#line 34044 "Photo.c"
}


static void photo_reimport_raw_development_state_impl_dev_to_reimport_unref (gpointer instance) {
	PhotoReimportRawDevelopmentStateImplDevToReimport* self;
	self = instance;
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_DEV_TO_REIMPORT_GET_CLASS (self)->finalize (self);
#line 1384 "/home/jens/Source/shotwell/src/Photo.vala"
		g_type_free_instance ((GTypeInstance *) self);
#line 34057 "Photo.c"
	}
}


static void photo_reimport_raw_development_state_impl_class_init (PhotoReimportRawDevelopmentStateImplClass * klass) {
#line 1383 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_reimport_raw_development_state_impl_parent_class = g_type_class_peek_parent (klass);
#line 1383 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoReimportRawDevelopmentStateClass *) klass)->finalize = photo_reimport_raw_development_state_impl_finalize;
#line 34067 "Photo.c"
}


static void photo_reimport_raw_development_state_impl_instance_init (PhotoReimportRawDevelopmentStateImpl * self) {
	GeeArrayList* _tmp0_ = NULL;
#line 1394 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = gee_array_list_new (PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL_TYPE_DEV_TO_REIMPORT, (GBoxedCopyFunc) photo_reimport_raw_development_state_impl_dev_to_reimport_ref, (GDestroyNotify) photo_reimport_raw_development_state_impl_dev_to_reimport_unref, NULL, NULL, NULL);
#line 1394 "/home/jens/Source/shotwell/src/Photo.vala"
	self->list = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_COLLECTION, GeeCollection);
#line 1395 "/home/jens/Source/shotwell/src/Photo.vala"
	self->metadata_only = FALSE;
#line 34079 "Photo.c"
}


static void photo_reimport_raw_development_state_impl_finalize (PhotoReimportRawDevelopmentState* obj) {
	PhotoReimportRawDevelopmentStateImpl * self;
#line 1383 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE_IMPL, PhotoReimportRawDevelopmentStateImpl);
#line 1394 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->list);
#line 1383 "/home/jens/Source/shotwell/src/Photo.vala"
	PHOTO_REIMPORT_RAW_DEVELOPMENT_STATE_CLASS (photo_reimport_raw_development_state_impl_parent_class)->finalize (obj);
#line 34091 "Photo.c"
}


static GType photo_reimport_raw_development_state_impl_get_type (void) {
	static volatile gsize photo_reimport_raw_development_state_impl_type_id__volatile = 0;
	if (g_once_init_enter (&photo_reimport_raw_development_state_impl_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PhotoReimportRawDevelopmentStateImplClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) photo_reimport_raw_development_state_impl_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PhotoReimportRawDevelopmentStateImpl), 0, (GInstanceInitFunc) photo_reimport_raw_development_state_impl_instance_init, NULL };
		GType photo_reimport_raw_development_state_impl_type_id;
		photo_reimport_raw_development_state_impl_type_id = g_type_register_static (PHOTO_TYPE_REIMPORT_RAW_DEVELOPMENT_STATE, "PhotoReimportRawDevelopmentStateImpl", &g_define_type_info, 0);
		g_once_init_leave (&photo_reimport_raw_development_state_impl_type_id__volatile, photo_reimport_raw_development_state_impl_type_id);
	}
	return photo_reimport_raw_development_state_impl_type_id__volatile;
}


static void photo_class_init (PhotoClass * klass) {
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_parent_class = g_type_class_peek_parent (klass);
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	g_type_class_add_private (klass, sizeof (PhotoPrivate));
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->notify_editable_replaced = (void (*)(Photo*, GFile*, GFile*)) photo_real_notify_editable_replaced;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->notify_raw_development_modified = (void (*)(Photo*)) photo_real_notify_raw_development_modified;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->notify_baseline_replaced = (void (*)(Photo*)) photo_real_notify_baseline_replaced;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->notify_master_reimported = (void (*)(Photo*, PhotoMetadata*)) photo_real_notify_master_reimported;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->notify_editable_reimported = (void (*)(Photo*, PhotoMetadata*)) photo_real_notify_editable_reimported;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->notify_source_reimported = (void (*)(Photo*, PhotoMetadata*)) photo_real_notify_source_reimported;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->notify_baseline_reimported = (void (*)(Photo*, PhotoMetadata*)) photo_real_notify_baseline_reimported;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((DataSourceClass *) klass)->internal_delete_backing = (gboolean (*)(DataSource*, GError**)) photo_real_internal_delete_backing;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->get_backing_files_state = (BackingFileState** (*)(MediaSource*, int*)) photo_real_get_backing_files_state;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->apply_user_metadata_for_reimport = (void (*)(Photo*, PhotoMetadata*)) photo_real_apply_user_metadata_for_reimport;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((DataSourceClass *) klass)->get_typename = (gchar* (*)(DataSource*)) photo_real_get_typename;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((DataSourceClass *) klass)->get_instance_id = (gint64 (*)(DataSource*)) photo_real_get_instance_id;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((DataSourceClass *) klass)->get_source_id = (gchar* (*)(DataSource*)) photo_real_get_source_id;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((ThumbnailSourceClass *) klass)->get_preferred_thumbnail_format = (PhotoFileFormat (*)(ThumbnailSource*)) photo_real_get_preferred_thumbnail_format;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((ThumbnailSourceClass *) klass)->create_thumbnail = (GdkPixbuf* (*)(ThumbnailSource*, gint, GError**)) photo_real_create_thumbnail;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->get_file = (GFile* (*)(MediaSource*)) photo_real_get_file;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->get_master_file = (GFile* (*)(MediaSource*)) photo_real_get_master_file;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->get_timestamp = (time_t (*)(MediaSource*)) photo_real_get_timestamp;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->get_event_id = (void (*)(MediaSource*, EventID*)) photo_real_get_event_id;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->get_import_id = (void (*)(MediaSource*, ImportID*)) photo_real_get_import_id;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->get_master_md5 = (gchar* (*)(MediaSource*)) photo_real_get_master_md5;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->get_rating = (Rating (*)(MediaSource*)) photo_real_get_rating;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->set_rating = (void (*)(MediaSource*, Rating)) photo_real_set_rating;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->increase_rating = (void (*)(MediaSource*)) photo_real_increase_rating;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->decrease_rating = (void (*)(MediaSource*)) photo_real_decrease_rating;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((DataSourceClass *) klass)->commit_backlinks = (void (*)(DataSource*, SourceCollection*, const gchar*)) photo_real_commit_backlinks;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->set_event_id = (gboolean (*)(MediaSource*, EventID*)) photo_real_set_event_id;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((DataObjectClass *) klass)->to_string = (gchar* (*)(DataObject*)) photo_real_to_string;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((DataSourceClass *) klass)->equals = (gboolean (*)(DataSource*, DataSource*)) photo_real_equals;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->get_filesize = (guint64 (*)(MediaSource*)) photo_real_get_filesize;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->get_master_filesize = (guint64 (*)(MediaSource*)) photo_real_get_master_filesize;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->get_exposure_time = (time_t (*)(MediaSource*)) photo_real_get_exposure_time;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->get_basename = (gchar* (*)(MediaSource*)) photo_real_get_basename;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->get_title = (gchar* (*)(MediaSource*)) photo_real_get_title;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->get_comment = (gchar* (*)(MediaSource*)) photo_real_get_comment;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->set_title = (void (*)(MediaSource*, const gchar*)) photo_real_set_title;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->set_comment = (gboolean (*)(MediaSource*, const gchar*)) photo_real_set_comment;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->get_dimensions = (void (*)(MediaSource*, PhotoException, Dimensions*)) photo_real_get_dimensions;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoSourceClass *) klass)->get_metadata = (PhotoMetadata* (*)(PhotoSource*)) photo_real_get_metadata;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->rotate = (void (*)(Photo*, Rotation)) photo_real_rotate;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoSourceClass *) klass)->get_pixbuf = (GdkPixbuf* (*)(PhotoSource*, Scaling*, GError**)) photo_real_get_pixbuf;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->has_user_generated_metadata = (gboolean (*)(Photo*)) photo_real_has_user_generated_metadata;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->set_user_metadata_for_export = (void (*)(Photo*, PhotoMetadata*)) photo_real_set_user_metadata_for_export;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->editable_replaced = photo_real_editable_replaced;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->raw_development_modified = photo_real_raw_development_modified;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->baseline_replaced = photo_real_baseline_replaced;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->master_reimported = photo_real_master_reimported;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->editable_reimported = photo_real_editable_reimported;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->baseline_reimported = photo_real_baseline_reimported;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->source_reimported = photo_real_source_reimported;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_photo_get_property;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_photo_set_property;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	G_OBJECT_CLASS (klass)->finalize = photo_finalize;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_new ("editable_replaced", TYPE_PHOTO, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (PhotoClass, editable_replaced), NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, g_file_get_type (), g_file_get_type ());
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_new ("raw_development_modified", TYPE_PHOTO, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (PhotoClass, raw_development_modified), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_new ("baseline_replaced", TYPE_PHOTO, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (PhotoClass, baseline_replaced), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_new ("master_reimported", TYPE_PHOTO, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (PhotoClass, master_reimported), NULL, NULL, g_cclosure_user_marshal_VOID__MEDIA_METADATA, G_TYPE_NONE, 1, TYPE_PHOTO_METADATA);
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_new ("editable_reimported", TYPE_PHOTO, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (PhotoClass, editable_reimported), NULL, NULL, g_cclosure_user_marshal_VOID__MEDIA_METADATA, G_TYPE_NONE, 1, TYPE_PHOTO_METADATA);
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_new ("baseline_reimported", TYPE_PHOTO, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (PhotoClass, baseline_reimported), NULL, NULL, g_cclosure_user_marshal_VOID__MEDIA_METADATA, G_TYPE_NONE, 1, TYPE_PHOTO_METADATA);
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_new ("source_reimported", TYPE_PHOTO, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (PhotoClass, source_reimported), NULL, NULL, g_cclosure_user_marshal_VOID__MEDIA_METADATA, G_TYPE_NONE, 1, TYPE_PHOTO_METADATA);
#line 326 "/home/jens/Source/shotwell/src/Photo.vala"
	g_rec_mutex_init (&__lock_photo_source_pixbuf_cache);
#line 34234 "Photo.c"
}


static void photo_dateable_interface_init (DateableIface * iface) {
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_dateable_parent_iface = g_type_interface_peek_parent (iface);
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	iface->get_exposure_time = (time_t (*)(Dateable*)) photo_real_get_exposure_time;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	iface->set_exposure_time = (void (*)(Dateable*, time_t)) photo_real_set_exposure_time;
#line 34245 "Photo.c"
}


static void photo_instance_init (Photo * self) {
	BackingPhotoRow* _tmp0_ = NULL;
	PhotoBackingReaders* _tmp1_ = NULL;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv = PHOTO_GET_PRIVATE (self);
#line 331 "/home/jens/Source/shotwell/src/Photo.vala"
	g_rec_mutex_init (&self->priv->__lock_row);
#line 332 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = backing_photo_row_new ();
#line 332 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->editable = _tmp0_;
#line 333 "/home/jens/Source/shotwell/src/Photo.vala"
	g_rec_mutex_init (&self->priv->__lock_readers);
#line 333 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = photo_backing_readers_new ();
#line 333 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->readers = _tmp1_;
#line 334 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->transformer = NULL;
#line 335 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->adjustments = NULL;
#line 337 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->file_title = NULL;
#line 338 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->editable_monitor = NULL;
#line 339 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->reimport_editable_scheduler = NULL;
#line 340 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->update_editable_attributes_scheduler = NULL;
#line 341 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->remove_editable_scheduler = NULL;
#line 343 "/home/jens/Source/shotwell/src/Photo.vala"
	self->can_rotate_now = TRUE;
#line 346 "/home/jens/Source/shotwell/src/Photo.vala"
	g_rec_mutex_init (&self->priv->__lock_developments);
#line 346 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->developments = NULL;
#line 353 "/home/jens/Source/shotwell/src/Photo.vala"
	self->backing_photo_row = NULL;
#line 34288 "Photo.c"
}


static void photo_finalize (GObject* obj) {
	Photo * self;
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PHOTO, Photo);
#line 331 "/home/jens/Source/shotwell/src/Photo.vala"
	g_rec_mutex_clear (&self->priv->__lock_row);
#line 331 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_row_unref0 (self->row);
#line 332 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (self->priv->editable);
#line 333 "/home/jens/Source/shotwell/src/Photo.vala"
	g_rec_mutex_clear (&self->priv->__lock_readers);
#line 333 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_backing_readers_unref0 (self->priv->readers);
#line 334 "/home/jens/Source/shotwell/src/Photo.vala"
	_pixel_transformer_unref0 (self->priv->transformer);
#line 335 "/home/jens/Source/shotwell/src/Photo.vala"
	_pixel_transformation_bundle_unref0 (self->priv->adjustments);
#line 337 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (self->priv->file_title);
#line 338 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->editable_monitor);
#line 339 "/home/jens/Source/shotwell/src/Photo.vala"
	_one_shot_scheduler_unref0 (self->priv->reimport_editable_scheduler);
#line 340 "/home/jens/Source/shotwell/src/Photo.vala"
	_one_shot_scheduler_unref0 (self->priv->update_editable_attributes_scheduler);
#line 341 "/home/jens/Source/shotwell/src/Photo.vala"
	_one_shot_scheduler_unref0 (self->priv->remove_editable_scheduler);
#line 346 "/home/jens/Source/shotwell/src/Photo.vala"
	g_rec_mutex_clear (&self->priv->__lock_developments);
#line 346 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->developments);
#line 353 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (self->backing_photo_row);
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	G_OBJECT_CLASS (photo_parent_class)->finalize (obj);
#line 34328 "Photo.c"
}


GType photo_get_type (void) {
	static volatile gsize photo_type_id__volatile = 0;
	if (g_once_init_enter (&photo_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PhotoClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) photo_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Photo), 0, (GInstanceInitFunc) photo_instance_init, NULL };
		static const GInterfaceInfo dateable_info = { (GInterfaceInitFunc) photo_dateable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType photo_type_id;
		photo_type_id = g_type_register_static (TYPE_PHOTO_SOURCE, "Photo", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
		g_type_add_interface_static (photo_type_id, TYPE_DATEABLE, &dateable_info);
		g_once_init_leave (&photo_type_id__volatile, photo_type_id);
	}
	return photo_type_id__volatile;
}


static void _vala_photo_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	Photo * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_PHOTO, Photo);
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	switch (property_id) {
#line 34351 "Photo.c"
		default:
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
		break;
#line 34357 "Photo.c"
	}
}


static void _vala_photo_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	Photo * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_PHOTO, Photo);
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
	switch (property_id) {
#line 34367 "Photo.c"
		default:
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 161 "/home/jens/Source/shotwell/src/Photo.vala"
		break;
#line 34373 "Photo.c"
	}
}


GType library_photo_source_collection_state_get_type (void) {
	static volatile gsize library_photo_source_collection_state_type_id__volatile = 0;
	if (g_once_init_enter (&library_photo_source_collection_state_type_id__volatile)) {
		static const GEnumValue values[] = {{LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_UNKNOWN, "LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_UNKNOWN", "unknown"}, {LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_ONLINE, "LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_ONLINE", "online"}, {LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_OFFLINE, "LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_OFFLINE", "offline"}, {LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_TRASH, "LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_TRASH", "trash"}, {LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_EDITABLE, "LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_EDITABLE", "editable"}, {LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_DEVELOPER, "LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_DEVELOPER", "developer"}, {0, NULL, NULL}};
		GType library_photo_source_collection_state_type_id;
		library_photo_source_collection_state_type_id = g_enum_register_static ("LibraryPhotoSourceCollectionState", values);
		g_once_init_leave (&library_photo_source_collection_state_type_id__volatile, library_photo_source_collection_state_type_id);
	}
	return library_photo_source_collection_state_type_id__volatile;
}


static guint _file_hash_gee_hash_data_func (gconstpointer v, gpointer self) {
	guint result;
	result = file_hash ((GFile*) v);
#line 4464 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 34395 "Photo.c"
}


static gboolean _file_equal_gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self) {
	gboolean result;
	result = file_equal ((GFile*) a, (GFile*) b);
#line 4464 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 34404 "Photo.c"
}


static gint _int64_compare_gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) {
	gint result;
	result = int64_compare ((gint64*) a, (gint64*) b);
#line 4468 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 34413 "Photo.c"
}


static gint64* _int64_dup (gint64* self) {
	gint64* dup;
#line 4468 "/home/jens/Source/shotwell/src/Photo.vala"
	dup = g_new0 (gint64, 1);
#line 4468 "/home/jens/Source/shotwell/src/Photo.vala"
	memcpy (dup, self, sizeof (gint64));
#line 4468 "/home/jens/Source/shotwell/src/Photo.vala"
	return dup;
#line 34425 "Photo.c"
}


static gboolean _int64_equal_gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self) {
	gboolean result;
	result = int64_equal ((gint64*) a, (gint64*) b);
#line 4470 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 34434 "Photo.c"
}


static gint64 _photo_get_photo_key_get_source_database_key (DataSource* source, gpointer self) {
	gint64 result;
	result = photo_get_photo_key (source);
#line 4490 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 34443 "Photo.c"
}


static void _library_photo_source_collection_on_trashcan_contents_altered_source_holding_tank_contents_altered (SourceHoldingTank* _sender, GeeCollection* added, GeeCollection* removed, gpointer self) {
#line 4492 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_source_collection_on_trashcan_contents_altered ((LibraryPhotoSourceCollection*) self, added, removed);
#line 34450 "Photo.c"
}


static void _library_photo_source_collection_on_offline_contents_altered_source_holding_tank_contents_altered (SourceHoldingTank* _sender, GeeCollection* added, GeeCollection* removed, gpointer self) {
#line 4493 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_source_collection_on_offline_contents_altered ((LibraryPhotoSourceCollection*) self, added, removed);
#line 34457 "Photo.c"
}


LibraryPhotoSourceCollection* library_photo_source_collection_construct (GType object_type) {
	LibraryPhotoSourceCollection* self = NULL;
	MediaSourceHoldingTank* _tmp0_ = NULL;
	MediaSourceHoldingTank* _tmp1_ = NULL;
	MediaSourceHoldingTank* _tmp2_ = NULL;
	MediaSourceHoldingTank* _tmp3_ = NULL;
#line 4490 "/home/jens/Source/shotwell/src/Photo.vala"
	self = (LibraryPhotoSourceCollection*) media_source_collection_construct (object_type, "LibraryPhotoSourceCollection", _photo_get_photo_key_get_source_database_key, NULL);
#line 4492 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = media_source_collection_get_trashcan (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
#line 4492 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 4492 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_connect (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_SOURCE_HOLDING_TANK, SourceHoldingTank), "contents-altered", (GCallback) _library_photo_source_collection_on_trashcan_contents_altered_source_holding_tank_contents_altered, self);
#line 4492 "/home/jens/Source/shotwell/src/Photo.vala"
	_source_holding_tank_unref0 (_tmp1_);
#line 4493 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = media_source_collection_get_offline_bin (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
#line 4493 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp2_;
#line 4493 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_connect (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_SOURCE_HOLDING_TANK, SourceHoldingTank), "contents-altered", (GCallback) _library_photo_source_collection_on_offline_contents_altered_source_holding_tank_contents_altered, self);
#line 4493 "/home/jens/Source/shotwell/src/Photo.vala"
	_source_holding_tank_unref0 (_tmp3_);
#line 4489 "/home/jens/Source/shotwell/src/Photo.vala"
	return self;
#line 34487 "Photo.c"
}


LibraryPhotoSourceCollection* library_photo_source_collection_new (void) {
#line 4489 "/home/jens/Source/shotwell/src/Photo.vala"
	return library_photo_source_collection_construct (TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION);
#line 34494 "Photo.c"
}


static gboolean _library_photo_source_collection_check_if_trashed_photo_source_holding_tank_check_to_keep (DataSource* source, Alteration* alteration, gpointer self) {
	gboolean result;
	result = library_photo_source_collection_check_if_trashed_photo ((LibraryPhotoSourceCollection*) self, source, alteration);
#line 4497 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 34503 "Photo.c"
}


static MediaSourceHoldingTank* library_photo_source_collection_real_create_trashcan (MediaSourceCollection* base) {
	LibraryPhotoSourceCollection * self;
	MediaSourceHoldingTank* result = NULL;
	LibraryPhotoSourceHoldingTank* _tmp0_ = NULL;
#line 4496 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollection);
#line 4497 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = library_photo_source_holding_tank_new (self, _library_photo_source_collection_check_if_trashed_photo_source_holding_tank_check_to_keep, self, _photo_get_photo_key_get_source_database_key, NULL);
#line 4497 "/home/jens/Source/shotwell/src/Photo.vala"
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_MEDIA_SOURCE_HOLDING_TANK, MediaSourceHoldingTank);
#line 4497 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 34519 "Photo.c"
}


static gboolean _library_photo_source_collection_check_if_offline_photo_source_holding_tank_check_to_keep (DataSource* source, Alteration* alteration, gpointer self) {
	gboolean result;
	result = library_photo_source_collection_check_if_offline_photo ((LibraryPhotoSourceCollection*) self, source, alteration);
#line 4501 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 34528 "Photo.c"
}


static MediaSourceHoldingTank* library_photo_source_collection_real_create_offline_bin (MediaSourceCollection* base) {
	LibraryPhotoSourceCollection * self;
	MediaSourceHoldingTank* result = NULL;
	LibraryPhotoSourceHoldingTank* _tmp0_ = NULL;
#line 4500 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollection);
#line 4501 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = library_photo_source_holding_tank_new (self, _library_photo_source_collection_check_if_offline_photo_source_holding_tank_check_to_keep, self, _photo_get_photo_key_get_source_database_key, NULL);
#line 4501 "/home/jens/Source/shotwell/src/Photo.vala"
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_MEDIA_SOURCE_HOLDING_TANK, MediaSourceHoldingTank);
#line 4501 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 34544 "Photo.c"
}


static MediaMonitor* library_photo_source_collection_real_create_media_monitor (MediaSourceCollection* base, Workers* workers, GCancellable* cancellable) {
	LibraryPhotoSourceCollection * self;
	MediaMonitor* result = NULL;
	Workers* _tmp0_ = NULL;
	GCancellable* _tmp1_ = NULL;
	PhotoMonitor* _tmp2_ = NULL;
#line 4504 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollection);
#line 4504 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_WORKERS (workers), NULL);
#line 4504 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_IS_CANCELLABLE (cancellable), NULL);
#line 4505 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = workers;
#line 4505 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = cancellable;
#line 4505 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_monitor_new (_tmp0_, _tmp1_);
#line 4505 "/home/jens/Source/shotwell/src/Photo.vala"
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_MEDIA_MONITOR, MediaMonitor);
#line 4505 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 34570 "Photo.c"
}


static gboolean library_photo_source_collection_real_holds_type_of_source (SourceCollection* base, DataSource* source) {
	LibraryPhotoSourceCollection * self;
	gboolean result = FALSE;
	DataSource* _tmp0_ = NULL;
#line 4508 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollection);
#line 4508 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_DATA_SOURCE (source), FALSE);
#line 4509 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = source;
#line 4509 "/home/jens/Source/shotwell/src/Photo.vala"
	result = G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, TYPE_LIBRARY_PHOTO);
#line 4509 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 34588 "Photo.c"
}


static gchar* library_photo_source_collection_real_get_typename (MediaSourceCollection* base) {
	LibraryPhotoSourceCollection * self;
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
#line 4512 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollection);
#line 4513 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = g_strdup (PHOTO_TYPENAME);
#line 4513 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 4513 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 34604 "Photo.c"
}


static gboolean library_photo_source_collection_real_is_file_recognized (MediaSourceCollection* base, GFile* file) {
	LibraryPhotoSourceCollection * self;
	gboolean result = FALSE;
	GFile* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
#line 4516 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollection);
#line 4516 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_IS_FILE (file), FALSE);
#line 4517 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = file;
#line 4517 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = photo_file_format_is_file_supported (_tmp0_);
#line 4517 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp1_;
#line 4517 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 34625 "Photo.c"
}


static void _library_photo_source_collection_on_editable_replaced_photo_editable_replaced (Photo* _sender, GFile* old_file, GFile* new_file, gpointer self) {
#line 4529 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_source_collection_on_editable_replaced ((LibraryPhotoSourceCollection*) self, _sender, old_file, new_file);
#line 34632 "Photo.c"
}


static void _library_photo_source_collection_on_raw_development_modified_photo_raw_development_modified (Photo* _sender, gpointer self) {
#line 4535 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_source_collection_on_raw_development_modified ((LibraryPhotoSourceCollection*) self, _sender);
#line 34639 "Photo.c"
}


static void library_photo_source_collection_real_notify_contents_altered (DataCollection* base, GeeIterable* added, GeeIterable* removed) {
	LibraryPhotoSourceCollection * self;
	GeeIterable* _tmp0_ = NULL;
	GeeIterable* _tmp75_ = NULL;
	GeeIterable* _tmp153_ = NULL;
	GeeIterable* _tmp154_ = NULL;
#line 4520 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollection);
#line 4520 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((added == NULL) || GEE_IS_ITERABLE (added));
#line 4520 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((removed == NULL) || GEE_IS_ITERABLE (removed));
#line 4522 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = added;
#line 4522 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp0_ != NULL) {
#line 34659 "Photo.c"
		{
			GeeIterator* _object_it = NULL;
			GeeIterable* _tmp1_ = NULL;
			GeeIterator* _tmp2_ = NULL;
#line 4523 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = added;
#line 4523 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = gee_iterable_iterator (_tmp1_);
#line 4523 "/home/jens/Source/shotwell/src/Photo.vala"
			_object_it = _tmp2_;
#line 4523 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 34672 "Photo.c"
				GeeIterator* _tmp3_ = NULL;
				gboolean _tmp4_ = FALSE;
				DataObject* object = NULL;
				GeeIterator* _tmp5_ = NULL;
				gpointer _tmp6_ = NULL;
				LibraryPhoto* photo = NULL;
				DataObject* _tmp7_ = NULL;
				LibraryPhoto* _tmp8_ = NULL;
				GFile* editable = NULL;
				LibraryPhoto* _tmp9_ = NULL;
				GFile* _tmp10_ = NULL;
				GFile* _tmp11_ = NULL;
				LibraryPhoto* _tmp15_ = NULL;
				GeeCollection* raw_list = NULL;
				LibraryPhoto* _tmp16_ = NULL;
				GeeCollection* _tmp17_ = NULL;
				GeeCollection* _tmp18_ = NULL;
				LibraryPhoto* _tmp28_ = NULL;
				gint64 master_filesize = 0LL;
				LibraryPhoto* _tmp29_ = NULL;
				BackingPhotoRow* _tmp30_ = NULL;
				BackingPhotoRow* _tmp31_ = NULL;
				gint64 _tmp32_ = 0LL;
				gint64 _tmp33_ = 0LL;
				gint64 _tmp34_ = 0LL;
				LibraryPhoto* _tmp35_ = NULL;
				BackingPhotoRow* _tmp36_ = NULL;
				BackingPhotoRow* _tmp37_ = NULL;
				gboolean _tmp38_ = FALSE;
				gint64 editable_filesize = 0LL;
				GeeMultiMap* _tmp43_ = NULL;
				gint64 _tmp44_ = 0LL;
				LibraryPhoto* _tmp45_ = NULL;
				GeeHashMap* _tmp46_ = NULL;
				LibraryPhoto* _tmp47_ = NULL;
				gint64 _tmp48_ = 0LL;
				gint64 _tmp49_ = 0LL;
				GeeCollection* raw_rows = NULL;
				LibraryPhoto* _tmp56_ = NULL;
				GeeCollection* _tmp57_ = NULL;
				GeeCollection* _tmp58_ = NULL;
#line 4523 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = _object_it;
#line 4523 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = gee_iterator_next (_tmp3_);
#line 4523 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp4_) {
#line 4523 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 34722 "Photo.c"
				}
#line 4523 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = _object_it;
#line 4523 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = gee_iterator_get (_tmp5_);
#line 4523 "/home/jens/Source/shotwell/src/Photo.vala"
				object = (DataObject*) _tmp6_;
#line 4524 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = object;
#line 4524 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, TYPE_LIBRARY_PHOTO, LibraryPhoto));
#line 4524 "/home/jens/Source/shotwell/src/Photo.vala"
				photo = _tmp8_;
#line 4526 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = photo;
#line 4526 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = photo_get_editable_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_PHOTO, Photo));
#line 4526 "/home/jens/Source/shotwell/src/Photo.vala"
				editable = _tmp10_;
#line 4527 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = editable;
#line 4527 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp11_ != NULL) {
#line 34746 "Photo.c"
					GeeHashMap* _tmp12_ = NULL;
					GFile* _tmp13_ = NULL;
					LibraryPhoto* _tmp14_ = NULL;
#line 4528 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp12_ = self->priv->by_editable_file;
#line 4528 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp13_ = editable;
#line 4528 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp14_ = photo;
#line 4528 "/home/jens/Source/shotwell/src/Photo.vala"
					gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp13_, _tmp14_);
#line 34758 "Photo.c"
				}
#line 4529 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = photo;
#line 4529 "/home/jens/Source/shotwell/src/Photo.vala"
				g_signal_connect (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, TYPE_PHOTO, Photo), "editable-replaced", (GCallback) _library_photo_source_collection_on_editable_replaced_photo_editable_replaced, self);
#line 4531 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = photo;
#line 4531 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp17_ = photo_get_raw_developer_files (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, TYPE_PHOTO, Photo));
#line 4531 "/home/jens/Source/shotwell/src/Photo.vala"
				raw_list = _tmp17_;
#line 4532 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp18_ = raw_list;
#line 4532 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp18_ != NULL) {
#line 34774 "Photo.c"
					{
						GeeIterator* _f_it = NULL;
						GeeCollection* _tmp19_ = NULL;
						GeeIterator* _tmp20_ = NULL;
#line 4533 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp19_ = raw_list;
#line 4533 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp20_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, GEE_TYPE_ITERABLE, GeeIterable));
#line 4533 "/home/jens/Source/shotwell/src/Photo.vala"
						_f_it = _tmp20_;
#line 4533 "/home/jens/Source/shotwell/src/Photo.vala"
						while (TRUE) {
#line 34787 "Photo.c"
							GeeIterator* _tmp21_ = NULL;
							gboolean _tmp22_ = FALSE;
							GFile* f = NULL;
							GeeIterator* _tmp23_ = NULL;
							gpointer _tmp24_ = NULL;
							GeeHashMap* _tmp25_ = NULL;
							GFile* _tmp26_ = NULL;
							LibraryPhoto* _tmp27_ = NULL;
#line 4533 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp21_ = _f_it;
#line 4533 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp22_ = gee_iterator_next (_tmp21_);
#line 4533 "/home/jens/Source/shotwell/src/Photo.vala"
							if (!_tmp22_) {
#line 4533 "/home/jens/Source/shotwell/src/Photo.vala"
								break;
#line 34804 "Photo.c"
							}
#line 4533 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp23_ = _f_it;
#line 4533 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp24_ = gee_iterator_get (_tmp23_);
#line 4533 "/home/jens/Source/shotwell/src/Photo.vala"
							f = (GFile*) _tmp24_;
#line 4534 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp25_ = self->priv->by_raw_development_file;
#line 4534 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp26_ = f;
#line 4534 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp27_ = photo;
#line 4534 "/home/jens/Source/shotwell/src/Photo.vala"
							gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp26_, _tmp27_);
#line 4533 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_object_unref0 (f);
#line 34822 "Photo.c"
						}
#line 4533 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_object_unref0 (_f_it);
#line 34826 "Photo.c"
					}
				}
#line 4535 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp28_ = photo;
#line 4535 "/home/jens/Source/shotwell/src/Photo.vala"
				g_signal_connect (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, TYPE_PHOTO, Photo), "raw-development-modified", (GCallback) _library_photo_source_collection_on_raw_development_modified_photo_raw_development_modified, self);
#line 4537 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp29_ = photo;
#line 4537 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp30_ = photo_get_master_photo_row (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, TYPE_PHOTO, Photo));
#line 4537 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp31_ = _tmp30_;
#line 4537 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp32_ = _tmp31_->filesize;
#line 4537 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp33_ = _tmp32_;
#line 4537 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (_tmp31_);
#line 4537 "/home/jens/Source/shotwell/src/Photo.vala"
				master_filesize = _tmp33_;
#line 4538 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp35_ = photo;
#line 4538 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp36_ = photo_get_editable_photo_row (G_TYPE_CHECK_INSTANCE_CAST (_tmp35_, TYPE_PHOTO, Photo));
#line 4538 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp37_ = _tmp36_;
#line 4538 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp38_ = _tmp37_ != NULL;
#line 4538 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (_tmp37_);
#line 4538 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp38_) {
#line 34859 "Photo.c"
					LibraryPhoto* _tmp39_ = NULL;
					BackingPhotoRow* _tmp40_ = NULL;
					BackingPhotoRow* _tmp41_ = NULL;
					gint64 _tmp42_ = 0LL;
#line 4539 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp39_ = photo;
#line 4539 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp40_ = photo_get_editable_photo_row (G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, TYPE_PHOTO, Photo));
#line 4539 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp41_ = _tmp40_;
#line 4539 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp42_ = _tmp41_->filesize;
#line 4539 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp34_ = _tmp42_;
#line 4539 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (_tmp41_);
#line 34876 "Photo.c"
				} else {
#line 4540 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp34_ = (gint64) -1;
#line 34880 "Photo.c"
				}
#line 4538 "/home/jens/Source/shotwell/src/Photo.vala"
				editable_filesize = _tmp34_;
#line 4541 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp43_ = self->priv->filesize_to_photo;
#line 4541 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp44_ = master_filesize;
#line 4541 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp45_ = photo;
#line 4541 "/home/jens/Source/shotwell/src/Photo.vala"
				gee_multi_map_set (_tmp43_, &_tmp44_, _tmp45_);
#line 4542 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp46_ = self->priv->photo_to_master_filesize;
#line 4542 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp47_ = photo;
#line 4542 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp48_ = master_filesize;
#line 4542 "/home/jens/Source/shotwell/src/Photo.vala"
				gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp46_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp47_, &_tmp48_);
#line 4543 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp49_ = editable_filesize;
#line 4543 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp49_ >= ((gint64) 0)) {
#line 34904 "Photo.c"
					GeeMultiMap* _tmp50_ = NULL;
					gint64 _tmp51_ = 0LL;
					LibraryPhoto* _tmp52_ = NULL;
					GeeHashMap* _tmp53_ = NULL;
					LibraryPhoto* _tmp54_ = NULL;
					gint64 _tmp55_ = 0LL;
#line 4544 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp50_ = self->priv->filesize_to_photo;
#line 4544 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp51_ = editable_filesize;
#line 4544 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp52_ = photo;
#line 4544 "/home/jens/Source/shotwell/src/Photo.vala"
					gee_multi_map_set (_tmp50_, &_tmp51_, _tmp52_);
#line 4545 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp53_ = self->priv->photo_to_editable_filesize;
#line 4545 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp54_ = photo;
#line 4545 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp55_ = editable_filesize;
#line 4545 "/home/jens/Source/shotwell/src/Photo.vala"
					gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp54_, &_tmp55_);
#line 34927 "Photo.c"
				}
#line 4548 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp56_ = photo;
#line 4548 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp57_ = photo_get_raw_development_photo_rows (G_TYPE_CHECK_INSTANCE_CAST (_tmp56_, TYPE_PHOTO, Photo));
#line 4548 "/home/jens/Source/shotwell/src/Photo.vala"
				raw_rows = _tmp57_;
#line 4549 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp58_ = raw_rows;
#line 4549 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp58_ != NULL) {
#line 34939 "Photo.c"
					{
						GeeIterator* _row_it = NULL;
						GeeCollection* _tmp59_ = NULL;
						GeeIterator* _tmp60_ = NULL;
#line 4550 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp59_ = raw_rows;
#line 4550 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp60_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp59_, GEE_TYPE_ITERABLE, GeeIterable));
#line 4550 "/home/jens/Source/shotwell/src/Photo.vala"
						_row_it = _tmp60_;
#line 4550 "/home/jens/Source/shotwell/src/Photo.vala"
						while (TRUE) {
#line 34952 "Photo.c"
							GeeIterator* _tmp61_ = NULL;
							gboolean _tmp62_ = FALSE;
							BackingPhotoRow* row = NULL;
							GeeIterator* _tmp63_ = NULL;
							gpointer _tmp64_ = NULL;
							BackingPhotoRow* _tmp65_ = NULL;
							gint64 _tmp66_ = 0LL;
#line 4550 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp61_ = _row_it;
#line 4550 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp62_ = gee_iterator_next (_tmp61_);
#line 4550 "/home/jens/Source/shotwell/src/Photo.vala"
							if (!_tmp62_) {
#line 4550 "/home/jens/Source/shotwell/src/Photo.vala"
								break;
#line 34968 "Photo.c"
							}
#line 4550 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp63_ = _row_it;
#line 4550 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp64_ = gee_iterator_get (_tmp63_);
#line 4550 "/home/jens/Source/shotwell/src/Photo.vala"
							row = (BackingPhotoRow*) _tmp64_;
#line 4551 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp65_ = row;
#line 4551 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp66_ = _tmp65_->filesize;
#line 4551 "/home/jens/Source/shotwell/src/Photo.vala"
							if (_tmp66_ >= ((gint64) 0)) {
#line 34982 "Photo.c"
								GeeMultiMap* _tmp67_ = NULL;
								BackingPhotoRow* _tmp68_ = NULL;
								gint64 _tmp69_ = 0LL;
								LibraryPhoto* _tmp70_ = NULL;
								GeeMultiMap* _tmp71_ = NULL;
								LibraryPhoto* _tmp72_ = NULL;
								BackingPhotoRow* _tmp73_ = NULL;
								gint64 _tmp74_ = 0LL;
#line 4552 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp67_ = self->priv->filesize_to_photo;
#line 4552 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp68_ = row;
#line 4552 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp69_ = _tmp68_->filesize;
#line 4552 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp70_ = photo;
#line 4552 "/home/jens/Source/shotwell/src/Photo.vala"
								gee_multi_map_set (_tmp67_, &_tmp69_, _tmp70_);
#line 4553 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp71_ = self->priv->photo_to_raw_development_filesize;
#line 4553 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp72_ = photo;
#line 4553 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp73_ = row;
#line 4553 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp74_ = _tmp73_->filesize;
#line 4553 "/home/jens/Source/shotwell/src/Photo.vala"
								gee_multi_map_set (_tmp71_, _tmp72_, &_tmp74_);
#line 35011 "Photo.c"
							}
#line 4550 "/home/jens/Source/shotwell/src/Photo.vala"
							_backing_photo_row_unref0 (row);
#line 35015 "Photo.c"
						}
#line 4550 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_object_unref0 (_row_it);
#line 35019 "Photo.c"
					}
				}
#line 4523 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (raw_rows);
#line 4523 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (raw_list);
#line 4523 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (editable);
#line 4523 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (photo);
#line 4523 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (object);
#line 35032 "Photo.c"
			}
#line 4523 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_object_it);
#line 35036 "Photo.c"
		}
	}
#line 4560 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp75_ = removed;
#line 4560 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp75_ != NULL) {
#line 35043 "Photo.c"
		{
			GeeIterator* _object_it = NULL;
			GeeIterable* _tmp76_ = NULL;
			GeeIterator* _tmp77_ = NULL;
#line 4561 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp76_ = removed;
#line 4561 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp77_ = gee_iterable_iterator (_tmp76_);
#line 4561 "/home/jens/Source/shotwell/src/Photo.vala"
			_object_it = _tmp77_;
#line 4561 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 35056 "Photo.c"
				GeeIterator* _tmp78_ = NULL;
				gboolean _tmp79_ = FALSE;
				DataObject* object = NULL;
				GeeIterator* _tmp80_ = NULL;
				gpointer _tmp81_ = NULL;
				LibraryPhoto* photo = NULL;
				DataObject* _tmp82_ = NULL;
				LibraryPhoto* _tmp83_ = NULL;
				GFile* editable = NULL;
				LibraryPhoto* _tmp84_ = NULL;
				GFile* _tmp85_ = NULL;
				GFile* _tmp86_ = NULL;
				LibraryPhoto* _tmp94_ = NULL;
				guint _tmp95_ = 0U;
				GeeCollection* raw_list = NULL;
				LibraryPhoto* _tmp96_ = NULL;
				GeeCollection* _tmp97_ = NULL;
				GeeCollection* _tmp98_ = NULL;
				LibraryPhoto* _tmp107_ = NULL;
				guint _tmp108_ = 0U;
				gint64 master_filesize = 0LL;
				LibraryPhoto* _tmp109_ = NULL;
				BackingPhotoRow* _tmp110_ = NULL;
				BackingPhotoRow* _tmp111_ = NULL;
				gint64 _tmp112_ = 0LL;
				gint64 _tmp113_ = 0LL;
				gint64 _tmp114_ = 0LL;
				LibraryPhoto* _tmp115_ = NULL;
				BackingPhotoRow* _tmp116_ = NULL;
				BackingPhotoRow* _tmp117_ = NULL;
				gboolean _tmp118_ = FALSE;
				gint64 editable_filesize = 0LL;
				GeeMultiMap* _tmp123_ = NULL;
				gint64 _tmp124_ = 0LL;
				LibraryPhoto* _tmp125_ = NULL;
				GeeHashMap* _tmp126_ = NULL;
				LibraryPhoto* _tmp127_ = NULL;
				gint64 _tmp128_ = 0LL;
				GeeCollection* raw_rows = NULL;
				LibraryPhoto* _tmp134_ = NULL;
				GeeCollection* _tmp135_ = NULL;
				GeeCollection* _tmp136_ = NULL;
#line 4561 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp78_ = _object_it;
#line 4561 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp79_ = gee_iterator_next (_tmp78_);
#line 4561 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp79_) {
#line 4561 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 35107 "Photo.c"
				}
#line 4561 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp80_ = _object_it;
#line 4561 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp81_ = gee_iterator_get (_tmp80_);
#line 4561 "/home/jens/Source/shotwell/src/Photo.vala"
				object = (DataObject*) _tmp81_;
#line 4562 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp82_ = object;
#line 4562 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp83_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp82_, TYPE_LIBRARY_PHOTO, LibraryPhoto));
#line 4562 "/home/jens/Source/shotwell/src/Photo.vala"
				photo = _tmp83_;
#line 4564 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp84_ = photo;
#line 4564 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp85_ = photo_get_editable_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp84_, TYPE_PHOTO, Photo));
#line 4564 "/home/jens/Source/shotwell/src/Photo.vala"
				editable = _tmp85_;
#line 4565 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp86_ = editable;
#line 4565 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp86_ != NULL) {
#line 35131 "Photo.c"
					gboolean is_removed = FALSE;
					GeeHashMap* _tmp87_ = NULL;
					LibraryPhoto* _tmp88_ = NULL;
					GFile* _tmp89_ = NULL;
					GFile* _tmp90_ = NULL;
					gboolean _tmp91_ = FALSE;
					gboolean _tmp92_ = FALSE;
					gboolean _tmp93_ = FALSE;
#line 4566 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp87_ = self->priv->by_editable_file;
#line 4566 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp88_ = photo;
#line 4566 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp89_ = photo_get_editable_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp88_, TYPE_PHOTO, Photo));
#line 4566 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp90_ = _tmp89_;
#line 4566 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp91_ = gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp87_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp90_, NULL);
#line 4566 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp92_ = _tmp91_;
#line 4566 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_tmp90_);
#line 4566 "/home/jens/Source/shotwell/src/Photo.vala"
					is_removed = _tmp92_;
#line 4567 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp93_ = is_removed;
#line 4567 "/home/jens/Source/shotwell/src/Photo.vala"
					_vala_assert (_tmp93_, "is_removed");
#line 35160 "Photo.c"
				}
#line 4569 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp94_ = photo;
#line 4569 "/home/jens/Source/shotwell/src/Photo.vala"
				g_signal_parse_name ("editable-replaced", TYPE_PHOTO, &_tmp95_, NULL, FALSE);
#line 4569 "/home/jens/Source/shotwell/src/Photo.vala"
				g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp94_, TYPE_PHOTO, Photo), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp95_, 0, NULL, (GCallback) _library_photo_source_collection_on_editable_replaced_photo_editable_replaced, self);
#line 4571 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp96_ = photo;
#line 4571 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp97_ = photo_get_raw_developer_files (G_TYPE_CHECK_INSTANCE_CAST (_tmp96_, TYPE_PHOTO, Photo));
#line 4571 "/home/jens/Source/shotwell/src/Photo.vala"
				raw_list = _tmp97_;
#line 4572 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp98_ = raw_list;
#line 4572 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp98_ != NULL) {
#line 35178 "Photo.c"
					{
						GeeIterator* _f_it = NULL;
						GeeCollection* _tmp99_ = NULL;
						GeeIterator* _tmp100_ = NULL;
#line 4573 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp99_ = raw_list;
#line 4573 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp100_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp99_, GEE_TYPE_ITERABLE, GeeIterable));
#line 4573 "/home/jens/Source/shotwell/src/Photo.vala"
						_f_it = _tmp100_;
#line 4573 "/home/jens/Source/shotwell/src/Photo.vala"
						while (TRUE) {
#line 35191 "Photo.c"
							GeeIterator* _tmp101_ = NULL;
							gboolean _tmp102_ = FALSE;
							GFile* f = NULL;
							GeeIterator* _tmp103_ = NULL;
							gpointer _tmp104_ = NULL;
							GeeHashMap* _tmp105_ = NULL;
							GFile* _tmp106_ = NULL;
#line 4573 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp101_ = _f_it;
#line 4573 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp102_ = gee_iterator_next (_tmp101_);
#line 4573 "/home/jens/Source/shotwell/src/Photo.vala"
							if (!_tmp102_) {
#line 4573 "/home/jens/Source/shotwell/src/Photo.vala"
								break;
#line 35207 "Photo.c"
							}
#line 4573 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp103_ = _f_it;
#line 4573 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp104_ = gee_iterator_get (_tmp103_);
#line 4573 "/home/jens/Source/shotwell/src/Photo.vala"
							f = (GFile*) _tmp104_;
#line 4574 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp105_ = self->priv->by_raw_development_file;
#line 4574 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp106_ = f;
#line 4574 "/home/jens/Source/shotwell/src/Photo.vala"
							gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp105_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp106_, NULL);
#line 4573 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_object_unref0 (f);
#line 35223 "Photo.c"
						}
#line 4573 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_object_unref0 (_f_it);
#line 35227 "Photo.c"
					}
				}
#line 4575 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp107_ = photo;
#line 4575 "/home/jens/Source/shotwell/src/Photo.vala"
				g_signal_parse_name ("raw-development-modified", TYPE_PHOTO, &_tmp108_, NULL, FALSE);
#line 4575 "/home/jens/Source/shotwell/src/Photo.vala"
				g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp107_, TYPE_PHOTO, Photo), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp108_, 0, NULL, (GCallback) _library_photo_source_collection_on_raw_development_modified_photo_raw_development_modified, self);
#line 4577 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp109_ = photo;
#line 4577 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp110_ = photo_get_master_photo_row (G_TYPE_CHECK_INSTANCE_CAST (_tmp109_, TYPE_PHOTO, Photo));
#line 4577 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp111_ = _tmp110_;
#line 4577 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp112_ = _tmp111_->filesize;
#line 4577 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp113_ = _tmp112_;
#line 4577 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (_tmp111_);
#line 4577 "/home/jens/Source/shotwell/src/Photo.vala"
				master_filesize = _tmp113_;
#line 4578 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp115_ = photo;
#line 4578 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp116_ = photo_get_editable_photo_row (G_TYPE_CHECK_INSTANCE_CAST (_tmp115_, TYPE_PHOTO, Photo));
#line 4578 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp117_ = _tmp116_;
#line 4578 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp118_ = _tmp117_ != NULL;
#line 4578 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (_tmp117_);
#line 4578 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp118_) {
#line 35262 "Photo.c"
					LibraryPhoto* _tmp119_ = NULL;
					BackingPhotoRow* _tmp120_ = NULL;
					BackingPhotoRow* _tmp121_ = NULL;
					gint64 _tmp122_ = 0LL;
#line 4579 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp119_ = photo;
#line 4579 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp120_ = photo_get_editable_photo_row (G_TYPE_CHECK_INSTANCE_CAST (_tmp119_, TYPE_PHOTO, Photo));
#line 4579 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp121_ = _tmp120_;
#line 4579 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp122_ = _tmp121_->filesize;
#line 4579 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp114_ = _tmp122_;
#line 4579 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (_tmp121_);
#line 35279 "Photo.c"
				} else {
#line 4580 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp114_ = (gint64) -1;
#line 35283 "Photo.c"
				}
#line 4578 "/home/jens/Source/shotwell/src/Photo.vala"
				editable_filesize = _tmp114_;
#line 4581 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp123_ = self->priv->filesize_to_photo;
#line 4581 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp124_ = master_filesize;
#line 4581 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp125_ = photo;
#line 4581 "/home/jens/Source/shotwell/src/Photo.vala"
				gee_multi_map_remove (_tmp123_, &_tmp124_, _tmp125_);
#line 4582 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp126_ = self->priv->photo_to_master_filesize;
#line 4582 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp127_ = photo;
#line 4582 "/home/jens/Source/shotwell/src/Photo.vala"
				gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp126_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp127_, NULL);
#line 4583 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp128_ = editable_filesize;
#line 4583 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp128_ >= ((gint64) 0)) {
#line 35305 "Photo.c"
					GeeMultiMap* _tmp129_ = NULL;
					gint64 _tmp130_ = 0LL;
					LibraryPhoto* _tmp131_ = NULL;
					GeeHashMap* _tmp132_ = NULL;
					LibraryPhoto* _tmp133_ = NULL;
#line 4584 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp129_ = self->priv->filesize_to_photo;
#line 4584 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp130_ = editable_filesize;
#line 4584 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp131_ = photo;
#line 4584 "/home/jens/Source/shotwell/src/Photo.vala"
					gee_multi_map_remove (_tmp129_, &_tmp130_, _tmp131_);
#line 4585 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp132_ = self->priv->photo_to_editable_filesize;
#line 4585 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp133_ = photo;
#line 4585 "/home/jens/Source/shotwell/src/Photo.vala"
					gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp132_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp133_, NULL);
#line 35325 "Photo.c"
				}
#line 4588 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp134_ = photo;
#line 4588 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp135_ = photo_get_raw_development_photo_rows (G_TYPE_CHECK_INSTANCE_CAST (_tmp134_, TYPE_PHOTO, Photo));
#line 4588 "/home/jens/Source/shotwell/src/Photo.vala"
				raw_rows = _tmp135_;
#line 4589 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp136_ = raw_rows;
#line 4589 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp136_ != NULL) {
#line 35337 "Photo.c"
					{
						GeeIterator* _row_it = NULL;
						GeeCollection* _tmp137_ = NULL;
						GeeIterator* _tmp138_ = NULL;
#line 4590 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp137_ = raw_rows;
#line 4590 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp138_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp137_, GEE_TYPE_ITERABLE, GeeIterable));
#line 4590 "/home/jens/Source/shotwell/src/Photo.vala"
						_row_it = _tmp138_;
#line 4590 "/home/jens/Source/shotwell/src/Photo.vala"
						while (TRUE) {
#line 35350 "Photo.c"
							GeeIterator* _tmp139_ = NULL;
							gboolean _tmp140_ = FALSE;
							BackingPhotoRow* row = NULL;
							GeeIterator* _tmp141_ = NULL;
							gpointer _tmp142_ = NULL;
							BackingPhotoRow* _tmp143_ = NULL;
							gint64 _tmp144_ = 0LL;
#line 4590 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp139_ = _row_it;
#line 4590 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp140_ = gee_iterator_next (_tmp139_);
#line 4590 "/home/jens/Source/shotwell/src/Photo.vala"
							if (!_tmp140_) {
#line 4590 "/home/jens/Source/shotwell/src/Photo.vala"
								break;
#line 35366 "Photo.c"
							}
#line 4590 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp141_ = _row_it;
#line 4590 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp142_ = gee_iterator_get (_tmp141_);
#line 4590 "/home/jens/Source/shotwell/src/Photo.vala"
							row = (BackingPhotoRow*) _tmp142_;
#line 4591 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp143_ = row;
#line 4591 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp144_ = _tmp143_->filesize;
#line 4591 "/home/jens/Source/shotwell/src/Photo.vala"
							if (_tmp144_ >= ((gint64) 0)) {
#line 35380 "Photo.c"
								GeeMultiMap* _tmp145_ = NULL;
								BackingPhotoRow* _tmp146_ = NULL;
								gint64 _tmp147_ = 0LL;
								LibraryPhoto* _tmp148_ = NULL;
								GeeMultiMap* _tmp149_ = NULL;
								LibraryPhoto* _tmp150_ = NULL;
								BackingPhotoRow* _tmp151_ = NULL;
								gint64 _tmp152_ = 0LL;
#line 4592 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp145_ = self->priv->filesize_to_photo;
#line 4592 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp146_ = row;
#line 4592 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp147_ = _tmp146_->filesize;
#line 4592 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp148_ = photo;
#line 4592 "/home/jens/Source/shotwell/src/Photo.vala"
								gee_multi_map_remove (_tmp145_, &_tmp147_, _tmp148_);
#line 4593 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp149_ = self->priv->photo_to_raw_development_filesize;
#line 4593 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp150_ = photo;
#line 4593 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp151_ = row;
#line 4593 "/home/jens/Source/shotwell/src/Photo.vala"
								_tmp152_ = _tmp151_->filesize;
#line 4593 "/home/jens/Source/shotwell/src/Photo.vala"
								gee_multi_map_remove (_tmp149_, _tmp150_, &_tmp152_);
#line 35409 "Photo.c"
							}
#line 4590 "/home/jens/Source/shotwell/src/Photo.vala"
							_backing_photo_row_unref0 (row);
#line 35413 "Photo.c"
						}
#line 4590 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_object_unref0 (_row_it);
#line 35417 "Photo.c"
					}
				}
#line 4561 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (raw_rows);
#line 4561 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (raw_list);
#line 4561 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (editable);
#line 4561 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (photo);
#line 4561 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (object);
#line 35430 "Photo.c"
			}
#line 4561 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_object_it);
#line 35434 "Photo.c"
		}
	}
#line 4600 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp153_ = added;
#line 4600 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp154_ = removed;
#line 4600 "/home/jens/Source/shotwell/src/Photo.vala"
	DATA_COLLECTION_CLASS (library_photo_source_collection_parent_class)->notify_contents_altered (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection), TYPE_DATA_COLLECTION, DataCollection), _tmp153_, _tmp154_);
#line 35443 "Photo.c"
}


static void library_photo_source_collection_on_editable_replaced (LibraryPhotoSourceCollection* self, Photo* photo, GFile* old_file, GFile* new_file) {
	GFile* _tmp0_ = NULL;
	GFile* _tmp5_ = NULL;
#line 4603 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self));
#line 4603 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (photo));
#line 4603 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((old_file == NULL) || G_IS_FILE (old_file));
#line 4603 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((new_file == NULL) || G_IS_FILE (new_file));
#line 4604 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = old_file;
#line 4604 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp0_ != NULL) {
#line 35462 "Photo.c"
		gboolean is_removed = FALSE;
		GeeHashMap* _tmp1_ = NULL;
		GFile* _tmp2_ = NULL;
		gboolean _tmp3_ = FALSE;
		gboolean _tmp4_ = FALSE;
#line 4605 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = self->priv->by_editable_file;
#line 4605 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = old_file;
#line 4605 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp2_, NULL);
#line 4605 "/home/jens/Source/shotwell/src/Photo.vala"
		is_removed = _tmp3_;
#line 4606 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = is_removed;
#line 4606 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_assert (_tmp4_, "is_removed");
#line 35480 "Photo.c"
	}
#line 4609 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = new_file;
#line 4609 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp5_ != NULL) {
#line 35486 "Photo.c"
		GeeHashMap* _tmp6_ = NULL;
		GFile* _tmp7_ = NULL;
		Photo* _tmp8_ = NULL;
#line 4610 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = self->priv->by_editable_file;
#line 4610 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = new_file;
#line 4610 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = photo;
#line 4610 "/home/jens/Source/shotwell/src/Photo.vala"
		gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp7_, G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_LIBRARY_PHOTO, LibraryPhoto));
#line 35498 "Photo.c"
	}
}


static void library_photo_source_collection_on_raw_development_modified (LibraryPhotoSourceCollection* self, Photo* _photo) {
	LibraryPhoto* photo = NULL;
	Photo* _tmp0_ = NULL;
	LibraryPhoto* _tmp1_ = NULL;
	LibraryPhoto* _tmp2_ = NULL;
	GeeMultiMap* _tmp3_ = NULL;
	LibraryPhoto* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	GeeCollection* raw_list = NULL;
	LibraryPhoto* _tmp23_ = NULL;
	GeeCollection* _tmp24_ = NULL;
	GeeCollection* _tmp25_ = NULL;
	GeeCollection* raw_rows = NULL;
	LibraryPhoto* _tmp35_ = NULL;
	GeeCollection* _tmp36_ = NULL;
	GeeCollection* _tmp37_ = NULL;
#line 4613 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self));
#line 4613 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (_photo));
#line 4614 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = _photo;
#line 4614 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, TYPE_LIBRARY_PHOTO) ? ((LibraryPhoto*) _tmp0_) : NULL);
#line 4614 "/home/jens/Source/shotwell/src/Photo.vala"
	photo = _tmp1_;
#line 4615 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo;
#line 4615 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp2_ == NULL) {
#line 4616 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (photo);
#line 4616 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 35537 "Photo.c"
	}
#line 4619 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = self->priv->photo_to_raw_development_filesize;
#line 4619 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = photo;
#line 4619 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = gee_multi_map_contains (_tmp3_, _tmp4_);
#line 4619 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp5_) {
#line 35547 "Photo.c"
		GeeMultiMap* _tmp21_ = NULL;
		LibraryPhoto* _tmp22_ = NULL;
		{
			GeeIterator* _s_it = NULL;
			GeeMultiMap* _tmp6_ = NULL;
			LibraryPhoto* _tmp7_ = NULL;
			GeeCollection* _tmp8_ = NULL;
			GeeCollection* _tmp9_ = NULL;
			GeeIterator* _tmp10_ = NULL;
			GeeIterator* _tmp11_ = NULL;
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = self->priv->photo_to_raw_development_filesize;
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = photo;
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = gee_multi_map_get (_tmp6_, _tmp7_);
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = _tmp8_;
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEE_TYPE_ITERABLE, GeeIterable));
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = _tmp10_;
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tmp9_);
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
			_s_it = _tmp11_;
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 35576 "Photo.c"
				GeeIterator* _tmp12_ = NULL;
				gboolean _tmp13_ = FALSE;
				gint64 s = 0LL;
				GeeIterator* _tmp14_ = NULL;
				gpointer _tmp15_ = NULL;
				gint64* _tmp16_ = NULL;
				gint64 _tmp17_ = 0LL;
				GeeMultiMap* _tmp18_ = NULL;
				gint64 _tmp19_ = 0LL;
				LibraryPhoto* _tmp20_ = NULL;
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = _s_it;
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = gee_iterator_next (_tmp12_);
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp13_) {
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 35595 "Photo.c"
				}
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = _s_it;
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = gee_iterator_get (_tmp14_);
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = (gint64*) _tmp15_;
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp17_ = *_tmp16_;
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (_tmp16_);
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
				s = _tmp17_;
#line 4621 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp18_ = self->priv->filesize_to_photo;
#line 4621 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp19_ = s;
#line 4621 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp20_ = photo;
#line 4621 "/home/jens/Source/shotwell/src/Photo.vala"
				gee_multi_map_remove (_tmp18_, &_tmp19_, _tmp20_);
#line 35617 "Photo.c"
			}
#line 4620 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_s_it);
#line 35621 "Photo.c"
		}
#line 4622 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = self->priv->photo_to_raw_development_filesize;
#line 4622 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp22_ = photo;
#line 4622 "/home/jens/Source/shotwell/src/Photo.vala"
		gee_multi_map_remove_all (_tmp21_, _tmp22_);
#line 35629 "Photo.c"
	}
#line 4626 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp23_ = photo;
#line 4626 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp24_ = photo_get_raw_developer_files (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, TYPE_PHOTO, Photo));
#line 4626 "/home/jens/Source/shotwell/src/Photo.vala"
	raw_list = _tmp24_;
#line 4627 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp25_ = raw_list;
#line 4627 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp25_ != NULL) {
#line 35641 "Photo.c"
		{
			GeeIterator* _f_it = NULL;
			GeeCollection* _tmp26_ = NULL;
			GeeIterator* _tmp27_ = NULL;
#line 4628 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp26_ = raw_list;
#line 4628 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp27_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, GEE_TYPE_ITERABLE, GeeIterable));
#line 4628 "/home/jens/Source/shotwell/src/Photo.vala"
			_f_it = _tmp27_;
#line 4628 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 35654 "Photo.c"
				GeeIterator* _tmp28_ = NULL;
				gboolean _tmp29_ = FALSE;
				GFile* f = NULL;
				GeeIterator* _tmp30_ = NULL;
				gpointer _tmp31_ = NULL;
				GeeHashMap* _tmp32_ = NULL;
				GFile* _tmp33_ = NULL;
				LibraryPhoto* _tmp34_ = NULL;
#line 4628 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp28_ = _f_it;
#line 4628 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp29_ = gee_iterator_next (_tmp28_);
#line 4628 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp29_) {
#line 4628 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 35671 "Photo.c"
				}
#line 4628 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp30_ = _f_it;
#line 4628 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp31_ = gee_iterator_get (_tmp30_);
#line 4628 "/home/jens/Source/shotwell/src/Photo.vala"
				f = (GFile*) _tmp31_;
#line 4629 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp32_ = self->priv->by_raw_development_file;
#line 4629 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp33_ = f;
#line 4629 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp34_ = photo;
#line 4629 "/home/jens/Source/shotwell/src/Photo.vala"
				gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp33_, _tmp34_);
#line 4628 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (f);
#line 35689 "Photo.c"
			}
#line 4628 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_f_it);
#line 35693 "Photo.c"
		}
	}
#line 4631 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp35_ = photo;
#line 4631 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp36_ = photo_get_raw_development_photo_rows (G_TYPE_CHECK_INSTANCE_CAST (_tmp35_, TYPE_PHOTO, Photo));
#line 4631 "/home/jens/Source/shotwell/src/Photo.vala"
	raw_rows = _tmp36_;
#line 4632 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp37_ = raw_rows;
#line 4632 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp37_ != NULL) {
#line 35706 "Photo.c"
		{
			GeeIterator* _row_it = NULL;
			GeeCollection* _tmp38_ = NULL;
			GeeIterator* _tmp39_ = NULL;
#line 4633 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp38_ = raw_rows;
#line 4633 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp39_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, GEE_TYPE_ITERABLE, GeeIterable));
#line 4633 "/home/jens/Source/shotwell/src/Photo.vala"
			_row_it = _tmp39_;
#line 4633 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 35719 "Photo.c"
				GeeIterator* _tmp40_ = NULL;
				gboolean _tmp41_ = FALSE;
				BackingPhotoRow* row = NULL;
				GeeIterator* _tmp42_ = NULL;
				gpointer _tmp43_ = NULL;
				BackingPhotoRow* _tmp44_ = NULL;
				gint64 _tmp45_ = 0LL;
#line 4633 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp40_ = _row_it;
#line 4633 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp41_ = gee_iterator_next (_tmp40_);
#line 4633 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp41_) {
#line 4633 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 35735 "Photo.c"
				}
#line 4633 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp42_ = _row_it;
#line 4633 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp43_ = gee_iterator_get (_tmp42_);
#line 4633 "/home/jens/Source/shotwell/src/Photo.vala"
				row = (BackingPhotoRow*) _tmp43_;
#line 4634 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp44_ = row;
#line 4634 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp45_ = _tmp44_->filesize;
#line 4634 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp45_ > ((gint64) 0)) {
#line 35749 "Photo.c"
					GeeMultiMap* _tmp46_ = NULL;
					BackingPhotoRow* _tmp47_ = NULL;
					gint64 _tmp48_ = 0LL;
					LibraryPhoto* _tmp49_ = NULL;
					GeeMultiMap* _tmp50_ = NULL;
					LibraryPhoto* _tmp51_ = NULL;
					BackingPhotoRow* _tmp52_ = NULL;
					gint64 _tmp53_ = 0LL;
#line 4635 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp46_ = self->priv->filesize_to_photo;
#line 4635 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp47_ = row;
#line 4635 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp48_ = _tmp47_->filesize;
#line 4635 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp49_ = photo;
#line 4635 "/home/jens/Source/shotwell/src/Photo.vala"
					gee_multi_map_set (_tmp46_, &_tmp48_, _tmp49_);
#line 4636 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp50_ = self->priv->photo_to_raw_development_filesize;
#line 4636 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp51_ = photo;
#line 4636 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp52_ = row;
#line 4636 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp53_ = _tmp52_->filesize;
#line 4636 "/home/jens/Source/shotwell/src/Photo.vala"
					gee_multi_map_set (_tmp50_, _tmp51_, &_tmp53_);
#line 35778 "Photo.c"
				}
#line 4633 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (row);
#line 35782 "Photo.c"
			}
#line 4633 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_row_it);
#line 35786 "Photo.c"
		}
	}
#line 4613 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (raw_rows);
#line 4613 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (raw_list);
#line 4613 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (photo);
#line 35795 "Photo.c"
}


static gpointer __int64_dup0 (gpointer self) {
#line 4652 "/home/jens/Source/shotwell/src/Photo.vala"
	return self ? _int64_dup (self) : NULL;
#line 35802 "Photo.c"
}


static void library_photo_source_collection_real_items_altered (DataCollection* base, GeeMap* items) {
	LibraryPhotoSourceCollection * self;
	GeeMap* _tmp72_ = NULL;
#line 4642 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollection);
#line 4642 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (GEE_IS_MAP (items));
#line 35813 "Photo.c"
	{
		GeeIterator* _object_it = NULL;
		GeeMap* _tmp0_ = NULL;
		GeeSet* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeIterator* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = items;
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = gee_map_get_keys (_tmp0_);
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = _tmp1_;
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = _tmp2_;
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ITERABLE, GeeIterable));
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = _tmp4_;
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp3_);
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
		_object_it = _tmp5_;
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
		while (TRUE) {
#line 35840 "Photo.c"
			GeeIterator* _tmp6_ = NULL;
			gboolean _tmp7_ = FALSE;
			DataObject* object = NULL;
			GeeIterator* _tmp8_ = NULL;
			gpointer _tmp9_ = NULL;
			Alteration* alteration = NULL;
			GeeMap* _tmp10_ = NULL;
			DataObject* _tmp11_ = NULL;
			gpointer _tmp12_ = NULL;
			LibraryPhoto* photo = NULL;
			DataObject* _tmp13_ = NULL;
			LibraryPhoto* _tmp14_ = NULL;
			gboolean _tmp15_ = FALSE;
			Alteration* _tmp16_ = NULL;
			gboolean _tmp17_ = FALSE;
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = _object_it;
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = gee_iterator_next (_tmp6_);
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
			if (!_tmp7_) {
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
				break;
#line 35864 "Photo.c"
			}
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = _object_it;
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = gee_iterator_get (_tmp8_);
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
			object = (DataObject*) _tmp9_;
#line 4644 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = items;
#line 4644 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = object;
#line 4644 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = gee_map_get (_tmp10_, _tmp11_);
#line 4644 "/home/jens/Source/shotwell/src/Photo.vala"
			alteration = (Alteration*) _tmp12_;
#line 4646 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = object;
#line 4646 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp14_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_LIBRARY_PHOTO, LibraryPhoto));
#line 4646 "/home/jens/Source/shotwell/src/Photo.vala"
			photo = _tmp14_;
#line 4648 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp16_ = alteration;
#line 4648 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp17_ = alteration_has_detail (_tmp16_, "image", "master");
#line 4648 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp17_) {
#line 4648 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = TRUE;
#line 35894 "Photo.c"
			} else {
				Alteration* _tmp18_ = NULL;
				gboolean _tmp19_ = FALSE;
#line 4648 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp18_ = alteration;
#line 4648 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp19_ = alteration_has_detail (_tmp18_, "image", "editable");
#line 4648 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = _tmp19_;
#line 35904 "Photo.c"
			}
#line 4648 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp15_) {
#line 35908 "Photo.c"
				gint64 old_master_filesize = 0LL;
				GeeHashMap* _tmp20_ = NULL;
				LibraryPhoto* _tmp21_ = NULL;
				gpointer _tmp22_ = NULL;
				gint64* _tmp23_ = NULL;
				gint64 _tmp24_ = 0LL;
				gint64* _tmp25_ = NULL;
				GeeHashMap* _tmp26_ = NULL;
				LibraryPhoto* _tmp27_ = NULL;
				gboolean _tmp28_ = FALSE;
				gint64 old_editable_filesize = 0LL;
				GeeHashMap* _tmp34_ = NULL;
				LibraryPhoto* _tmp35_ = NULL;
				GeeMultiMap* _tmp36_ = NULL;
				gint64 _tmp37_ = 0LL;
				LibraryPhoto* _tmp38_ = NULL;
				gint64 _tmp39_ = 0LL;
				gint64 master_filesize = 0LL;
				LibraryPhoto* _tmp45_ = NULL;
				BackingPhotoRow* _tmp46_ = NULL;
				BackingPhotoRow* _tmp47_ = NULL;
				gint64 _tmp48_ = 0LL;
				gint64 _tmp49_ = 0LL;
				gint64 _tmp50_ = 0LL;
				LibraryPhoto* _tmp51_ = NULL;
				BackingPhotoRow* _tmp52_ = NULL;
				BackingPhotoRow* _tmp53_ = NULL;
				gboolean _tmp54_ = FALSE;
				gint64 editable_filesize = 0LL;
				GeeHashMap* _tmp59_ = NULL;
				LibraryPhoto* _tmp60_ = NULL;
				gint64 _tmp61_ = 0LL;
				GeeMultiMap* _tmp62_ = NULL;
				gint64 _tmp63_ = 0LL;
				LibraryPhoto* _tmp64_ = NULL;
				gint64 _tmp65_ = 0LL;
#line 4649 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp20_ = self->priv->photo_to_master_filesize;
#line 4649 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp21_ = photo;
#line 4649 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp22_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp21_);
#line 4649 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp23_ = (gint64*) _tmp22_;
#line 4649 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp24_ = *_tmp23_;
#line 4649 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (_tmp23_);
#line 4649 "/home/jens/Source/shotwell/src/Photo.vala"
				old_master_filesize = _tmp24_;
#line 4650 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp26_ = self->priv->photo_to_editable_filesize;
#line 4650 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp27_ = photo;
#line 4650 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp28_ = gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp27_);
#line 4650 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp28_) {
#line 35967 "Photo.c"
					GeeHashMap* _tmp29_ = NULL;
					LibraryPhoto* _tmp30_ = NULL;
					gpointer _tmp31_ = NULL;
#line 4651 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp29_ = self->priv->photo_to_editable_filesize;
#line 4651 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp30_ = photo;
#line 4651 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp31_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp30_);
#line 4651 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_free0 (_tmp25_);
#line 4651 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp25_ = (gint64*) _tmp31_;
#line 35981 "Photo.c"
				} else {
					gint64 _tmp32_ = 0LL;
					gint64* _tmp33_ = NULL;
#line 4652 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp32_ = (gint64) -1;
#line 4652 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp33_ = __int64_dup0 (&_tmp32_);
#line 4652 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_free0 (_tmp25_);
#line 4652 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp25_ = _tmp33_;
#line 35993 "Photo.c"
				}
#line 4650 "/home/jens/Source/shotwell/src/Photo.vala"
				old_editable_filesize = *_tmp25_;
#line 4654 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp34_ = self->priv->photo_to_master_filesize;
#line 4654 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp35_ = photo;
#line 4654 "/home/jens/Source/shotwell/src/Photo.vala"
				gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp35_, NULL);
#line 4655 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp36_ = self->priv->filesize_to_photo;
#line 4655 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp37_ = old_master_filesize;
#line 4655 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp38_ = photo;
#line 4655 "/home/jens/Source/shotwell/src/Photo.vala"
				gee_multi_map_remove (_tmp36_, &_tmp37_, _tmp38_);
#line 4656 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp39_ = old_editable_filesize;
#line 4656 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp39_ >= ((gint64) 0)) {
#line 36015 "Photo.c"
					GeeHashMap* _tmp40_ = NULL;
					LibraryPhoto* _tmp41_ = NULL;
					GeeMultiMap* _tmp42_ = NULL;
					gint64 _tmp43_ = 0LL;
					LibraryPhoto* _tmp44_ = NULL;
#line 4657 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp40_ = self->priv->photo_to_editable_filesize;
#line 4657 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp41_ = photo;
#line 4657 "/home/jens/Source/shotwell/src/Photo.vala"
					gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp40_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp41_, NULL);
#line 4658 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp42_ = self->priv->filesize_to_photo;
#line 4658 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp43_ = old_editable_filesize;
#line 4658 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp44_ = photo;
#line 4658 "/home/jens/Source/shotwell/src/Photo.vala"
					gee_multi_map_remove (_tmp42_, &_tmp43_, _tmp44_);
#line 36035 "Photo.c"
				}
#line 4661 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp45_ = photo;
#line 4661 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp46_ = photo_get_master_photo_row (G_TYPE_CHECK_INSTANCE_CAST (_tmp45_, TYPE_PHOTO, Photo));
#line 4661 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp47_ = _tmp46_;
#line 4661 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp48_ = _tmp47_->filesize;
#line 4661 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp49_ = _tmp48_;
#line 4661 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (_tmp47_);
#line 4661 "/home/jens/Source/shotwell/src/Photo.vala"
				master_filesize = _tmp49_;
#line 4662 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp51_ = photo;
#line 4662 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp52_ = photo_get_editable_photo_row (G_TYPE_CHECK_INSTANCE_CAST (_tmp51_, TYPE_PHOTO, Photo));
#line 4662 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp53_ = _tmp52_;
#line 4662 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp54_ = _tmp53_ != NULL;
#line 4662 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (_tmp53_);
#line 4662 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp54_) {
#line 36063 "Photo.c"
					LibraryPhoto* _tmp55_ = NULL;
					BackingPhotoRow* _tmp56_ = NULL;
					BackingPhotoRow* _tmp57_ = NULL;
					gint64 _tmp58_ = 0LL;
#line 4663 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp55_ = photo;
#line 4663 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp56_ = photo_get_editable_photo_row (G_TYPE_CHECK_INSTANCE_CAST (_tmp55_, TYPE_PHOTO, Photo));
#line 4663 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp57_ = _tmp56_;
#line 4663 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp58_ = _tmp57_->filesize;
#line 4663 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp50_ = _tmp58_;
#line 4663 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (_tmp57_);
#line 36080 "Photo.c"
				} else {
#line 4664 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp50_ = (gint64) -1;
#line 36084 "Photo.c"
				}
#line 4662 "/home/jens/Source/shotwell/src/Photo.vala"
				editable_filesize = _tmp50_;
#line 4665 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp59_ = self->priv->photo_to_master_filesize;
#line 4665 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp60_ = photo;
#line 4665 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp61_ = master_filesize;
#line 4665 "/home/jens/Source/shotwell/src/Photo.vala"
				gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp59_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp60_, &_tmp61_);
#line 4666 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp62_ = self->priv->filesize_to_photo;
#line 4666 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp63_ = master_filesize;
#line 4666 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp64_ = photo;
#line 4666 "/home/jens/Source/shotwell/src/Photo.vala"
				gee_multi_map_set (_tmp62_, &_tmp63_, _tmp64_);
#line 4667 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp65_ = editable_filesize;
#line 4667 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp65_ >= ((gint64) 0)) {
#line 36108 "Photo.c"
					GeeHashMap* _tmp66_ = NULL;
					LibraryPhoto* _tmp67_ = NULL;
					gint64 _tmp68_ = 0LL;
					GeeMultiMap* _tmp69_ = NULL;
					gint64 _tmp70_ = 0LL;
					LibraryPhoto* _tmp71_ = NULL;
#line 4668 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp66_ = self->priv->photo_to_editable_filesize;
#line 4668 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp67_ = photo;
#line 4668 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp68_ = editable_filesize;
#line 4668 "/home/jens/Source/shotwell/src/Photo.vala"
					gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp66_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp67_, &_tmp68_);
#line 4669 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp69_ = self->priv->filesize_to_photo;
#line 4669 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp70_ = editable_filesize;
#line 4669 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp71_ = photo;
#line 4669 "/home/jens/Source/shotwell/src/Photo.vala"
					gee_multi_map_set (_tmp69_, &_tmp70_, _tmp71_);
#line 36131 "Photo.c"
				}
#line 4648 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (_tmp25_);
#line 36135 "Photo.c"
			}
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (photo);
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
			_alteration_unref0 (alteration);
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (object);
#line 36143 "Photo.c"
		}
#line 4643 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_object_it);
#line 36147 "Photo.c"
	}
#line 4674 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp72_ = items;
#line 4674 "/home/jens/Source/shotwell/src/Photo.vala"
	DATA_COLLECTION_CLASS (library_photo_source_collection_parent_class)->items_altered (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection), TYPE_DATA_COLLECTION, DataCollection), _tmp72_);
#line 36153 "Photo.c"
}


static void library_photo_source_collection_real_postprocess_imported_media (MediaSourceCollection* base, GeeCollection* media_sources) {
	LibraryPhotoSourceCollection * self;
	GeeHashMultiMap* map = NULL;
	GeeHashMultiMap* _tmp0_ = NULL;
	GeeCollection* _tmp97_ = NULL;
#line 4678 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollection);
#line 4678 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (GEE_IS_COLLECTION (media_sources));
#line 4679 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = gee_hash_multi_map_new (TYPE_TAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
#line 4679 "/home/jens/Source/shotwell/src/Photo.vala"
	map = _tmp0_;
#line 36170 "Photo.c"
	{
		GeeIterator* _media_it = NULL;
		GeeCollection* _tmp1_ = NULL;
		GeeIterator* _tmp2_ = NULL;
#line 4680 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = media_sources;
#line 4680 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ITERABLE, GeeIterable));
#line 4680 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_it = _tmp2_;
#line 4680 "/home/jens/Source/shotwell/src/Photo.vala"
		while (TRUE) {
#line 36183 "Photo.c"
			GeeIterator* _tmp3_ = NULL;
			gboolean _tmp4_ = FALSE;
			MediaSource* media = NULL;
			GeeIterator* _tmp5_ = NULL;
			gpointer _tmp6_ = NULL;
			LibraryPhoto* photo = NULL;
			MediaSource* _tmp7_ = NULL;
			LibraryPhoto* _tmp8_ = NULL;
			PhotoMetadata* metadata = NULL;
			LibraryPhoto* _tmp9_ = NULL;
			PhotoMetadata* _tmp10_ = NULL;
			HierarchicalTagIndex* global_index = NULL;
			HierarchicalTagIndex* _tmp11_ = NULL;
			HierarchicalTagIndex* htag_index = NULL;
			PhotoMetadata* _tmp12_ = NULL;
			gboolean _tmp13_ = FALSE;
			LibraryPhoto* _tmp18_ = NULL;
			GeeCollection* _tmp19_ = NULL;
			GeeCollection* _tmp20_ = NULL;
			gboolean _tmp21_ = FALSE;
			PhotoMetadata* _tmp55_ = NULL;
			gboolean _tmp56_ = FALSE;
#line 4680 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp3_ = _media_it;
#line 4680 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = gee_iterator_next (_tmp3_);
#line 4680 "/home/jens/Source/shotwell/src/Photo.vala"
			if (!_tmp4_) {
#line 4680 "/home/jens/Source/shotwell/src/Photo.vala"
				break;
#line 36214 "Photo.c"
			}
#line 4680 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = _media_it;
#line 4680 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = gee_iterator_get (_tmp5_);
#line 4680 "/home/jens/Source/shotwell/src/Photo.vala"
			media = (MediaSource*) _tmp6_;
#line 4681 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = media;
#line 4681 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, TYPE_LIBRARY_PHOTO, LibraryPhoto));
#line 4681 "/home/jens/Source/shotwell/src/Photo.vala"
			photo = _tmp8_;
#line 4682 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = photo;
#line 4682 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = photo_source_get_metadata (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_PHOTO_SOURCE, PhotoSource));
#line 4682 "/home/jens/Source/shotwell/src/Photo.vala"
			metadata = _tmp10_;
#line 4685 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = hierarchical_tag_index_get_global_index ();
#line 4685 "/home/jens/Source/shotwell/src/Photo.vala"
			global_index = _tmp11_;
#line 4692 "/home/jens/Source/shotwell/src/Photo.vala"
			htag_index = NULL;
#line 4693 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = metadata;
#line 4693 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = photo_metadata_has_hierarchical_keywords (_tmp12_);
#line 4693 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp13_) {
#line 36246 "Photo.c"
				PhotoMetadata* _tmp14_ = NULL;
				GeeSet* _tmp15_ = NULL;
				GeeSet* _tmp16_ = NULL;
				HierarchicalTagIndex* _tmp17_ = NULL;
#line 4694 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = metadata;
#line 4694 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = photo_metadata_get_hierarchical_keywords (_tmp14_);
#line 4694 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = _tmp15_;
#line 4694 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp17_ = hierarchical_tag_utilities_process_hierarchical_import_keywords (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, GEE_TYPE_COLLECTION, GeeCollection));
#line 4694 "/home/jens/Source/shotwell/src/Photo.vala"
				_hierarchical_tag_index_unref0 (htag_index);
#line 4694 "/home/jens/Source/shotwell/src/Photo.vala"
				htag_index = _tmp17_;
#line 4694 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (_tmp16_);
#line 36265 "Photo.c"
			}
#line 4698 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp18_ = photo;
#line 4698 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp19_ = library_photo_get_import_keywords (_tmp18_);
#line 4698 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp20_ = _tmp19_;
#line 4698 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp21_ = _tmp20_ != NULL;
#line 4698 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tmp20_);
#line 4698 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp21_) {
#line 36279 "Photo.c"
				{
					GeeIterator* _keyword_it = NULL;
					LibraryPhoto* _tmp22_ = NULL;
					GeeCollection* _tmp23_ = NULL;
					GeeCollection* _tmp24_ = NULL;
					GeeIterator* _tmp25_ = NULL;
					GeeIterator* _tmp26_ = NULL;
#line 4699 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp22_ = photo;
#line 4699 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp23_ = library_photo_get_import_keywords (_tmp22_);
#line 4699 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp24_ = _tmp23_;
#line 4699 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp25_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, GEE_TYPE_ITERABLE, GeeIterable));
#line 4699 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp26_ = _tmp25_;
#line 4699 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_tmp24_);
#line 4699 "/home/jens/Source/shotwell/src/Photo.vala"
					_keyword_it = _tmp26_;
#line 4699 "/home/jens/Source/shotwell/src/Photo.vala"
					while (TRUE) {
#line 36303 "Photo.c"
						GeeIterator* _tmp27_ = NULL;
						gboolean _tmp28_ = FALSE;
						gchar* keyword = NULL;
						GeeIterator* _tmp29_ = NULL;
						gpointer _tmp30_ = NULL;
						gboolean _tmp31_ = FALSE;
						HierarchicalTagIndex* _tmp32_ = NULL;
						gchar* name = NULL;
						const gchar* _tmp36_ = NULL;
						gchar* _tmp37_ = NULL;
						HierarchicalTagIndex* _tmp38_ = NULL;
						const gchar* _tmp39_ = NULL;
						gboolean _tmp40_ = FALSE;
						const gchar* _tmp49_ = NULL;
#line 4699 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp27_ = _keyword_it;
#line 4699 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp28_ = gee_iterator_next (_tmp27_);
#line 4699 "/home/jens/Source/shotwell/src/Photo.vala"
						if (!_tmp28_) {
#line 4699 "/home/jens/Source/shotwell/src/Photo.vala"
							break;
#line 36326 "Photo.c"
						}
#line 4699 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp29_ = _keyword_it;
#line 4699 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp30_ = gee_iterator_get (_tmp29_);
#line 4699 "/home/jens/Source/shotwell/src/Photo.vala"
						keyword = (gchar*) _tmp30_;
#line 4700 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp32_ = htag_index;
#line 4700 "/home/jens/Source/shotwell/src/Photo.vala"
						if (_tmp32_ != NULL) {
#line 36338 "Photo.c"
							HierarchicalTagIndex* _tmp33_ = NULL;
							const gchar* _tmp34_ = NULL;
							gboolean _tmp35_ = FALSE;
#line 4700 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp33_ = htag_index;
#line 4700 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp34_ = keyword;
#line 4700 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp35_ = hierarchical_tag_index_is_tag_in_index (_tmp33_, _tmp34_);
#line 4700 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp31_ = _tmp35_;
#line 36350 "Photo.c"
						} else {
#line 4700 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp31_ = FALSE;
#line 36354 "Photo.c"
						}
#line 4700 "/home/jens/Source/shotwell/src/Photo.vala"
						if (_tmp31_) {
#line 4701 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_free0 (keyword);
#line 4701 "/home/jens/Source/shotwell/src/Photo.vala"
							continue;
#line 36362 "Photo.c"
						}
#line 4703 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp36_ = keyword;
#line 4703 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp37_ = tag_prep_tag_name (_tmp36_);
#line 4703 "/home/jens/Source/shotwell/src/Photo.vala"
						name = _tmp37_;
#line 4705 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp38_ = global_index;
#line 4705 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp39_ = name;
#line 4705 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp40_ = hierarchical_tag_index_is_tag_in_index (_tmp38_, _tmp39_);
#line 4705 "/home/jens/Source/shotwell/src/Photo.vala"
						if (_tmp40_) {
#line 36378 "Photo.c"
							gchar* most_derived_path = NULL;
							HierarchicalTagIndex* _tmp41_ = NULL;
							const gchar* _tmp42_ = NULL;
							gchar* _tmp43_ = NULL;
							GeeHashMultiMap* _tmp44_ = NULL;
							const gchar* _tmp45_ = NULL;
							Tag* _tmp46_ = NULL;
							Tag* _tmp47_ = NULL;
							LibraryPhoto* _tmp48_ = NULL;
#line 4706 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp41_ = global_index;
#line 4706 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp42_ = name;
#line 4706 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp43_ = hierarchical_tag_index_get_path_for_name (_tmp41_, _tmp42_);
#line 4706 "/home/jens/Source/shotwell/src/Photo.vala"
							most_derived_path = _tmp43_;
#line 4707 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp44_ = map;
#line 4707 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp45_ = most_derived_path;
#line 4707 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp46_ = tag_for_path (_tmp45_);
#line 4707 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp47_ = _tmp46_;
#line 4707 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp48_ = photo;
#line 4707 "/home/jens/Source/shotwell/src/Photo.vala"
							gee_multi_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp44_, GEE_TYPE_MULTI_MAP, GeeMultiMap), _tmp47_, _tmp48_);
#line 4707 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_object_unref0 (_tmp47_);
#line 4708 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_free0 (most_derived_path);
#line 4708 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_free0 (name);
#line 4708 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_free0 (keyword);
#line 4708 "/home/jens/Source/shotwell/src/Photo.vala"
							continue;
#line 36418 "Photo.c"
						}
#line 4711 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp49_ = name;
#line 4711 "/home/jens/Source/shotwell/src/Photo.vala"
						if (_tmp49_ != NULL) {
#line 36424 "Photo.c"
							GeeHashMultiMap* _tmp50_ = NULL;
							const gchar* _tmp51_ = NULL;
							Tag* _tmp52_ = NULL;
							Tag* _tmp53_ = NULL;
							LibraryPhoto* _tmp54_ = NULL;
#line 4712 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp50_ = map;
#line 4712 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp51_ = name;
#line 4712 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp52_ = tag_for_path (_tmp51_);
#line 4712 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp53_ = _tmp52_;
#line 4712 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp54_ = photo;
#line 4712 "/home/jens/Source/shotwell/src/Photo.vala"
							gee_multi_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp50_, GEE_TYPE_MULTI_MAP, GeeMultiMap), _tmp53_, _tmp54_);
#line 4712 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_object_unref0 (_tmp53_);
#line 36444 "Photo.c"
						}
#line 4699 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_free0 (name);
#line 4699 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_free0 (keyword);
#line 36450 "Photo.c"
					}
#line 4699 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_keyword_it);
#line 36454 "Photo.c"
				}
			}
#line 4716 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp55_ = metadata;
#line 4716 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp56_ = photo_metadata_has_hierarchical_keywords (_tmp55_);
#line 4716 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp56_) {
#line 36463 "Photo.c"
				{
					GeeIterator* _path_it = NULL;
					HierarchicalTagIndex* _tmp57_ = NULL;
					GeeCollection* _tmp58_ = NULL;
					GeeCollection* _tmp59_ = NULL;
					GeeIterator* _tmp60_ = NULL;
					GeeIterator* _tmp61_ = NULL;
#line 4717 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp57_ = htag_index;
#line 4717 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp58_ = hierarchical_tag_index_get_all_paths (_tmp57_);
#line 4717 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp59_ = _tmp58_;
#line 4717 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp60_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp59_, GEE_TYPE_ITERABLE, GeeIterable));
#line 4717 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp61_ = _tmp60_;
#line 4717 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_tmp59_);
#line 4717 "/home/jens/Source/shotwell/src/Photo.vala"
					_path_it = _tmp61_;
#line 4717 "/home/jens/Source/shotwell/src/Photo.vala"
					while (TRUE) {
#line 36487 "Photo.c"
						GeeIterator* _tmp62_ = NULL;
						gboolean _tmp63_ = FALSE;
						gchar* path = NULL;
						GeeIterator* _tmp64_ = NULL;
						gpointer _tmp65_ = NULL;
						gchar* name = NULL;
						const gchar* _tmp66_ = NULL;
						gchar* _tmp67_ = NULL;
						const gchar* _tmp68_ = NULL;
#line 4717 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp62_ = _path_it;
#line 4717 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp63_ = gee_iterator_next (_tmp62_);
#line 4717 "/home/jens/Source/shotwell/src/Photo.vala"
						if (!_tmp63_) {
#line 4717 "/home/jens/Source/shotwell/src/Photo.vala"
							break;
#line 36505 "Photo.c"
						}
#line 4717 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp64_ = _path_it;
#line 4717 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp65_ = gee_iterator_get (_tmp64_);
#line 4717 "/home/jens/Source/shotwell/src/Photo.vala"
						path = (gchar*) _tmp65_;
#line 4718 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp66_ = path;
#line 4718 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp67_ = tag_prep_tag_name (_tmp66_);
#line 4718 "/home/jens/Source/shotwell/src/Photo.vala"
						name = _tmp67_;
#line 4719 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp68_ = name;
#line 4719 "/home/jens/Source/shotwell/src/Photo.vala"
						if (_tmp68_ != NULL) {
#line 36523 "Photo.c"
							GeeHashMultiMap* _tmp69_ = NULL;
							const gchar* _tmp70_ = NULL;
							Tag* _tmp71_ = NULL;
							Tag* _tmp72_ = NULL;
							LibraryPhoto* _tmp73_ = NULL;
#line 4720 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp69_ = map;
#line 4720 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp70_ = name;
#line 4720 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp71_ = tag_for_path (_tmp70_);
#line 4720 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp72_ = _tmp71_;
#line 4720 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp73_ = photo;
#line 4720 "/home/jens/Source/shotwell/src/Photo.vala"
							gee_multi_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp69_, GEE_TYPE_MULTI_MAP, GeeMultiMap), _tmp72_, _tmp73_);
#line 4720 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_object_unref0 (_tmp72_);
#line 36543 "Photo.c"
						}
#line 4717 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_free0 (name);
#line 4717 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_free0 (path);
#line 36549 "Photo.c"
					}
#line 4717 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_path_it);
#line 36553 "Photo.c"
				}
			}
#line 4680 "/home/jens/Source/shotwell/src/Photo.vala"
			_hierarchical_tag_index_unref0 (htag_index);
#line 4680 "/home/jens/Source/shotwell/src/Photo.vala"
			_hierarchical_tag_index_unref0 (global_index);
#line 4680 "/home/jens/Source/shotwell/src/Photo.vala"
			_media_metadata_unref0 (metadata);
#line 4680 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (photo);
#line 4680 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (media);
#line 36566 "Photo.c"
		}
#line 4680 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_media_it);
#line 36570 "Photo.c"
	}
	{
		GeeIterator* _media_it = NULL;
		GeeCollection* _tmp74_ = NULL;
		GeeIterator* _tmp75_ = NULL;
#line 4725 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp74_ = media_sources;
#line 4725 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp75_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp74_, GEE_TYPE_ITERABLE, GeeIterable));
#line 4725 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_it = _tmp75_;
#line 4725 "/home/jens/Source/shotwell/src/Photo.vala"
		while (TRUE) {
#line 36584 "Photo.c"
			GeeIterator* _tmp76_ = NULL;
			gboolean _tmp77_ = FALSE;
			MediaSource* media = NULL;
			GeeIterator* _tmp78_ = NULL;
			gpointer _tmp79_ = NULL;
			LibraryPhoto* photo = NULL;
			MediaSource* _tmp80_ = NULL;
			LibraryPhoto* _tmp81_ = NULL;
			LibraryPhoto* _tmp82_ = NULL;
#line 4725 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp76_ = _media_it;
#line 4725 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp77_ = gee_iterator_next (_tmp76_);
#line 4725 "/home/jens/Source/shotwell/src/Photo.vala"
			if (!_tmp77_) {
#line 4725 "/home/jens/Source/shotwell/src/Photo.vala"
				break;
#line 36602 "Photo.c"
			}
#line 4725 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp78_ = _media_it;
#line 4725 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp79_ = gee_iterator_get (_tmp78_);
#line 4725 "/home/jens/Source/shotwell/src/Photo.vala"
			media = (MediaSource*) _tmp79_;
#line 4726 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp80_ = media;
#line 4726 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp81_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp80_, TYPE_LIBRARY_PHOTO, LibraryPhoto));
#line 4726 "/home/jens/Source/shotwell/src/Photo.vala"
			photo = _tmp81_;
#line 4727 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp82_ = photo;
#line 4727 "/home/jens/Source/shotwell/src/Photo.vala"
			library_photo_clear_import_keywords (_tmp82_);
#line 4725 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (photo);
#line 4725 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (media);
#line 36624 "Photo.c"
		}
#line 4725 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_media_it);
#line 36628 "Photo.c"
	}
	{
		GeeIterator* _tag_it = NULL;
		GeeHashMultiMap* _tmp83_ = NULL;
		GeeSet* _tmp84_ = NULL;
		GeeSet* _tmp85_ = NULL;
		GeeIterator* _tmp86_ = NULL;
		GeeIterator* _tmp87_ = NULL;
#line 4730 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp83_ = map;
#line 4730 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp84_ = gee_multi_map_get_keys (G_TYPE_CHECK_INSTANCE_CAST (_tmp83_, GEE_TYPE_MULTI_MAP, GeeMultiMap));
#line 4730 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp85_ = _tmp84_;
#line 4730 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp86_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp85_, GEE_TYPE_ITERABLE, GeeIterable));
#line 4730 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp87_ = _tmp86_;
#line 4730 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp85_);
#line 4730 "/home/jens/Source/shotwell/src/Photo.vala"
		_tag_it = _tmp87_;
#line 4730 "/home/jens/Source/shotwell/src/Photo.vala"
		while (TRUE) {
#line 36653 "Photo.c"
			GeeIterator* _tmp88_ = NULL;
			gboolean _tmp89_ = FALSE;
			Tag* tag = NULL;
			GeeIterator* _tmp90_ = NULL;
			gpointer _tmp91_ = NULL;
			Tag* _tmp92_ = NULL;
			GeeHashMultiMap* _tmp93_ = NULL;
			Tag* _tmp94_ = NULL;
			GeeCollection* _tmp95_ = NULL;
			GeeCollection* _tmp96_ = NULL;
#line 4730 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp88_ = _tag_it;
#line 4730 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp89_ = gee_iterator_next (_tmp88_);
#line 4730 "/home/jens/Source/shotwell/src/Photo.vala"
			if (!_tmp89_) {
#line 4730 "/home/jens/Source/shotwell/src/Photo.vala"
				break;
#line 36672 "Photo.c"
			}
#line 4730 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp90_ = _tag_it;
#line 4730 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp91_ = gee_iterator_get (_tmp90_);
#line 4730 "/home/jens/Source/shotwell/src/Photo.vala"
			tag = (Tag*) _tmp91_;
#line 4731 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp92_ = tag;
#line 4731 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp93_ = map;
#line 4731 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp94_ = tag;
#line 4731 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp95_ = gee_multi_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp93_, GEE_TYPE_MULTI_MAP, GeeMultiMap), _tmp94_);
#line 4731 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp96_ = _tmp95_;
#line 4731 "/home/jens/Source/shotwell/src/Photo.vala"
			tag_attach_many (_tmp92_, _tmp96_);
#line 4731 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tmp96_);
#line 4730 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (tag);
#line 36696 "Photo.c"
		}
#line 4730 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tag_it);
#line 36700 "Photo.c"
	}
#line 4733 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp97_ = media_sources;
#line 4733 "/home/jens/Source/shotwell/src/Photo.vala"
	MEDIA_SOURCE_COLLECTION_CLASS (library_photo_source_collection_parent_class)->postprocess_imported_media (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection), _tmp97_);
#line 4678 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (map);
#line 36708 "Photo.c"
}


static void library_photo_source_collection_real_notify_master_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata) {
	LibraryPhoto* _tmp0_ = NULL;
	PhotoMetadata* _tmp1_ = NULL;
#line 4737 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO (photo));
#line 4737 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 4738 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo;
#line 4738 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = metadata;
#line 4738 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_emit_by_name (self, "master-reimported", _tmp0_, _tmp1_);
#line 36725 "Photo.c"
}


void library_photo_source_collection_notify_master_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata) {
#line 4737 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self));
#line 4737 "/home/jens/Source/shotwell/src/Photo.vala"
	LIBRARY_PHOTO_SOURCE_COLLECTION_GET_CLASS (self)->notify_master_reimported (self, photo, metadata);
#line 36734 "Photo.c"
}


static void library_photo_source_collection_real_notify_editable_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata) {
	LibraryPhoto* _tmp0_ = NULL;
	PhotoMetadata* _tmp1_ = NULL;
#line 4742 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO (photo));
#line 4742 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 4743 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo;
#line 4743 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = metadata;
#line 4743 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_emit_by_name (self, "editable-reimported", _tmp0_, _tmp1_);
#line 36751 "Photo.c"
}


void library_photo_source_collection_notify_editable_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata) {
#line 4742 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self));
#line 4742 "/home/jens/Source/shotwell/src/Photo.vala"
	LIBRARY_PHOTO_SOURCE_COLLECTION_GET_CLASS (self)->notify_editable_reimported (self, photo, metadata);
#line 36760 "Photo.c"
}


static void library_photo_source_collection_real_notify_source_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata) {
	LibraryPhoto* _tmp0_ = NULL;
	PhotoMetadata* _tmp1_ = NULL;
#line 4747 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO (photo));
#line 4747 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 4748 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo;
#line 4748 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = metadata;
#line 4748 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_emit_by_name (self, "source-reimported", _tmp0_, _tmp1_);
#line 36777 "Photo.c"
}


void library_photo_source_collection_notify_source_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata) {
#line 4747 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self));
#line 4747 "/home/jens/Source/shotwell/src/Photo.vala"
	LIBRARY_PHOTO_SOURCE_COLLECTION_GET_CLASS (self)->notify_source_reimported (self, photo, metadata);
#line 36786 "Photo.c"
}


static void library_photo_source_collection_real_notify_baseline_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata) {
	LibraryPhoto* _tmp0_ = NULL;
	PhotoMetadata* _tmp1_ = NULL;
#line 4752 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO (photo));
#line 4752 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 4753 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo;
#line 4753 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = metadata;
#line 4753 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_emit_by_name (self, "baseline-reimported", _tmp0_, _tmp1_);
#line 36803 "Photo.c"
}


void library_photo_source_collection_notify_baseline_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata) {
#line 4752 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self));
#line 4752 "/home/jens/Source/shotwell/src/Photo.vala"
	LIBRARY_PHOTO_SOURCE_COLLECTION_GET_CLASS (self)->notify_baseline_reimported (self, photo, metadata);
#line 36812 "Photo.c"
}


static MediaSource* library_photo_source_collection_real_fetch_by_numeric_id (MediaSourceCollection* base, gint64 numeric_id) {
	LibraryPhotoSourceCollection * self;
	MediaSource* result = NULL;
	gint64 _tmp0_ = 0LL;
	PhotoID _tmp1_ = {0};
	LibraryPhoto* _tmp2_ = NULL;
#line 4756 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollection);
#line 4757 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = numeric_id;
#line 4757 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_id_init (&_tmp1_, _tmp0_);
#line 4757 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = library_photo_source_collection_fetch (self, &_tmp1_);
#line 4757 "/home/jens/Source/shotwell/src/Photo.vala"
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_MEDIA_SOURCE, MediaSource);
#line 4757 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 36834 "Photo.c"
}


static void library_photo_source_collection_on_trashcan_contents_altered (LibraryPhotoSourceCollection* self, GeeCollection* added, GeeCollection* removed) {
	GeeCollection* _tmp0_ = NULL;
	GeeCollection* _tmp1_ = NULL;
#line 4760 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self));
#line 4760 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((added == NULL) || GEE_IS_COLLECTION (added));
#line 4760 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((removed == NULL) || GEE_IS_COLLECTION (removed));
#line 4762 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = added;
#line 4762 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = removed;
#line 4762 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection), "trashcan-contents-altered", G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_COLLECTION, GeeCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_COLLECTION, GeeCollection));
#line 36853 "Photo.c"
}


static gboolean library_photo_source_collection_check_if_trashed_photo (LibraryPhotoSourceCollection* self, DataSource* source, Alteration* alteration) {
	gboolean result = FALSE;
	DataSource* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
#line 4766 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self), FALSE);
#line 4766 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_DATA_SOURCE (source), FALSE);
#line 4766 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_ALTERATION (alteration), FALSE);
#line 4767 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = source;
#line 4767 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = media_source_is_trashed (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_LIBRARY_PHOTO, LibraryPhoto), TYPE_MEDIA_SOURCE, MediaSource));
#line 4767 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp1_;
#line 4767 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 36875 "Photo.c"
}


static void library_photo_source_collection_on_offline_contents_altered (LibraryPhotoSourceCollection* self, GeeCollection* added, GeeCollection* removed) {
	GeeCollection* _tmp0_ = NULL;
	GeeCollection* _tmp1_ = NULL;
#line 4770 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self));
#line 4770 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((added == NULL) || GEE_IS_COLLECTION (added));
#line 4770 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((removed == NULL) || GEE_IS_COLLECTION (removed));
#line 4772 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = added;
#line 4772 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = removed;
#line 4772 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection), "offline-contents-altered", G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_COLLECTION, GeeCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_COLLECTION, GeeCollection));
#line 36894 "Photo.c"
}


static gboolean library_photo_source_collection_check_if_offline_photo (LibraryPhotoSourceCollection* self, DataSource* source, Alteration* alteration) {
	gboolean result = FALSE;
	DataSource* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
#line 4776 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self), FALSE);
#line 4776 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_DATA_SOURCE (source), FALSE);
#line 4776 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_ALTERATION (alteration), FALSE);
#line 4777 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = source;
#line 4777 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = media_source_is_offline (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_LIBRARY_PHOTO, LibraryPhoto), TYPE_MEDIA_SOURCE, MediaSource));
#line 4777 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp1_;
#line 4777 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 36916 "Photo.c"
}


static glong string_strnlen (gchar* str, glong maxlen) {
	glong result = 0L;
	gchar* end = NULL;
	gchar* _tmp0_ = NULL;
	glong _tmp1_ = 0L;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp0_ = str;
#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp1_ = maxlen;
#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_);
#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	end = _tmp2_;
#line 1296 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp3_ = end;
#line 1296 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp3_ == NULL) {
#line 36939 "Photo.c"
		glong _tmp4_ = 0L;
#line 1297 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp4_ = maxlen;
#line 1297 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		result = _tmp4_;
#line 1297 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		return result;
#line 36947 "Photo.c"
	} else {
		gchar* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp5_ = end;
#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp6_ = str;
#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		result = (glong) (_tmp5_ - _tmp6_);
#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		return result;
#line 36959 "Photo.c"
	}
}


static gchar* string_substring (const gchar* self, glong offset, glong len) {
	gchar* result = NULL;
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	glong _tmp1_ = 0L;
	glong _tmp8_ = 0L;
	glong _tmp14_ = 0L;
	glong _tmp17_ = 0L;
	glong _tmp18_ = 0L;
	glong _tmp19_ = 0L;
	glong _tmp20_ = 0L;
	glong _tmp21_ = 0L;
	gchar* _tmp22_ = NULL;
#line 1306 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp1_ = offset;
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp1_ >= ((glong) 0)) {
#line 36983 "Photo.c"
		glong _tmp2_ = 0L;
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp2_ = len;
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp0_ = _tmp2_ >= ((glong) 0);
#line 36989 "Photo.c"
	} else {
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp0_ = FALSE;
#line 36993 "Photo.c"
	}
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp0_) {
#line 36997 "Photo.c"
		glong _tmp3_ = 0L;
		glong _tmp4_ = 0L;
		glong _tmp5_ = 0L;
#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp3_ = offset;
#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp4_ = len;
#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp5_ = string_strnlen ((gchar*) self, _tmp3_ + _tmp4_);
#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		string_length = _tmp5_;
#line 37009 "Photo.c"
	} else {
		gint _tmp6_ = 0;
		gint _tmp7_ = 0;
#line 1312 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp6_ = strlen (self);
#line 1312 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp7_ = _tmp6_;
#line 1312 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		string_length = (glong) _tmp7_;
#line 37019 "Photo.c"
	}
#line 1315 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp8_ = offset;
#line 1315 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp8_ < ((glong) 0)) {
#line 37025 "Photo.c"
		glong _tmp9_ = 0L;
		glong _tmp10_ = 0L;
		glong _tmp11_ = 0L;
#line 1316 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp9_ = string_length;
#line 1316 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp10_ = offset;
#line 1316 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		offset = _tmp9_ + _tmp10_;
#line 1317 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp11_ = offset;
#line 1317 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		g_return_val_if_fail (_tmp11_ >= ((glong) 0), NULL);
#line 37039 "Photo.c"
	} else {
		glong _tmp12_ = 0L;
		glong _tmp13_ = 0L;
#line 1319 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp12_ = offset;
#line 1319 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp13_ = string_length;
#line 1319 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		g_return_val_if_fail (_tmp12_ <= _tmp13_, NULL);
#line 37049 "Photo.c"
	}
#line 1321 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp14_ = len;
#line 1321 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp14_ < ((glong) 0)) {
#line 37055 "Photo.c"
		glong _tmp15_ = 0L;
		glong _tmp16_ = 0L;
#line 1322 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp15_ = string_length;
#line 1322 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp16_ = offset;
#line 1322 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		len = _tmp15_ - _tmp16_;
#line 37064 "Photo.c"
	}
#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp17_ = offset;
#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp18_ = len;
#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp19_ = string_length;
#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_return_val_if_fail ((_tmp17_ + _tmp18_) <= _tmp19_, NULL);
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp20_ = offset;
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp21_ = len;
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp22_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) _tmp21_);
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	result = _tmp22_;
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	return result;
#line 37084 "Photo.c"
}


static MediaSource* library_photo_source_collection_real_fetch_by_source_id (MediaSourceCollection* base, const gchar* source_id) {
	LibraryPhotoSourceCollection * self;
	MediaSource* result = NULL;
	const gchar* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	gchar* numeric_only = NULL;
	const gchar* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	gint _tmp4_ = 0;
	gchar* _tmp5_ = NULL;
	gint64 _tmp6_ = 0LL;
	MediaSource* _tmp7_ = NULL;
#line 4780 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollection);
#line 4780 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (source_id != NULL, NULL);
#line 4781 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = source_id;
#line 4781 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = g_str_has_prefix (_tmp0_, PHOTO_TYPENAME);
#line 4781 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_assert (_tmp1_, "source_id.has_prefix(Photo.TYPENAME)");
#line 4782 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = source_id;
#line 4782 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = strlen (PHOTO_TYPENAME);
#line 4782 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = _tmp3_;
#line 4782 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = string_substring (_tmp2_, (glong) _tmp4_, (glong) -1);
#line 4782 "/home/jens/Source/shotwell/src/Photo.vala"
	numeric_only = _tmp5_;
#line 4784 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = parse_int64 (numeric_only, 16);
#line 4784 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = media_source_collection_fetch_by_numeric_id (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection), _tmp6_);
#line 4784 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp7_;
#line 4784 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (numeric_only);
#line 4784 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 37130 "Photo.c"
}


static GeeCollection* library_photo_source_collection_real_get_event_source_ids (MediaSourceCollection* base, EventID* event_id) {
	LibraryPhotoSourceCollection * self;
	GeeCollection* result = NULL;
	PhotoTable* _tmp0_ = NULL;
	PhotoTable* _tmp1_ = NULL;
	EventID _tmp2_ = {0};
	GeeArrayList* _tmp3_ = NULL;
	GeeCollection* _tmp4_ = NULL;
#line 4787 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollection);
#line 4787 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (event_id != NULL, NULL);
#line 4788 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_table_get_instance ();
#line 4788 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 4788 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = *event_id;
#line 4788 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = photo_table_get_event_source_ids (_tmp1_, &_tmp2_);
#line 4788 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_COLLECTION, GeeCollection);
#line 4788 "/home/jens/Source/shotwell/src/Photo.vala"
	_database_table_unref0 (_tmp1_);
#line 4788 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp4_;
#line 4788 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 37162 "Photo.c"
}


LibraryPhoto* library_photo_source_collection_fetch (LibraryPhotoSourceCollection* self, PhotoID* photo_id) {
	LibraryPhoto* result = NULL;
	PhotoID _tmp0_ = {0};
	gint64 _tmp1_ = 0LL;
	DataSource* _tmp2_ = NULL;
#line 4791 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self), NULL);
#line 4791 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (photo_id != NULL, NULL);
#line 4792 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = *photo_id;
#line 4792 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_.id;
#line 4792 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = database_source_collection_fetch_by_key (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATABASE_SOURCE_COLLECTION, DatabaseSourceCollection), _tmp1_);
#line 4792 "/home/jens/Source/shotwell/src/Photo.vala"
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 4792 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 37185 "Photo.c"
}


LibraryPhoto* library_photo_source_collection_fetch_by_editable_file (LibraryPhotoSourceCollection* self, GFile* file) {
	LibraryPhoto* result = NULL;
	GeeHashMap* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	gpointer _tmp2_ = NULL;
#line 4795 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self), NULL);
#line 4795 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_IS_FILE (file), NULL);
#line 4796 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = self->priv->by_editable_file;
#line 4796 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = file;
#line 4796 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp1_);
#line 4796 "/home/jens/Source/shotwell/src/Photo.vala"
	result = (LibraryPhoto*) _tmp2_;
#line 4796 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 37208 "Photo.c"
}


LibraryPhoto* library_photo_source_collection_fetch_by_raw_development_file (LibraryPhotoSourceCollection* self, GFile* file) {
	LibraryPhoto* result = NULL;
	GeeHashMap* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	gpointer _tmp2_ = NULL;
#line 4799 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self), NULL);
#line 4799 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_IS_FILE (file), NULL);
#line 4800 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = self->priv->by_raw_development_file;
#line 4800 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = file;
#line 4800 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp1_);
#line 4800 "/home/jens/Source/shotwell/src/Photo.vala"
	result = (LibraryPhoto*) _tmp2_;
#line 4800 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 37231 "Photo.c"
}


static void library_photo_source_collection_compare_backing (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, GFileInfo* info, GeeCollection* matches_master, GeeCollection* matches_editable, GeeCollection* matches_development) {
	LibraryPhoto* _tmp0_ = NULL;
	BackingPhotoRow* _tmp1_ = NULL;
	BackingPhotoRow* _tmp2_ = NULL;
	GFileInfo* _tmp3_ = NULL;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	BackingPhotoRow* editable = NULL;
	LibraryPhoto* _tmp8_ = NULL;
	BackingPhotoRow* _tmp9_ = NULL;
	gboolean _tmp10_ = FALSE;
	BackingPhotoRow* _tmp11_ = NULL;
	GeeCollection* development = NULL;
	LibraryPhoto* _tmp17_ = NULL;
	GeeCollection* _tmp18_ = NULL;
	GeeCollection* _tmp19_ = NULL;
#line 4803 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self));
#line 4803 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO (photo));
#line 4803 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_IS_FILE_INFO (info));
#line 4803 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (GEE_IS_COLLECTION (matches_master));
#line 4803 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (GEE_IS_COLLECTION (matches_editable));
#line 4803 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (GEE_IS_COLLECTION (matches_development));
#line 4806 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo;
#line 4806 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = photo_get_master_photo_row (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_PHOTO, Photo));
#line 4806 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = _tmp1_;
#line 4806 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = info;
#line 4806 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = backing_photo_row_matches_file_info (_tmp2_, _tmp3_);
#line 4806 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = _tmp4_;
#line 4806 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (_tmp2_);
#line 4806 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp5_) {
#line 37279 "Photo.c"
		GeeCollection* _tmp6_ = NULL;
		LibraryPhoto* _tmp7_ = NULL;
#line 4807 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = matches_master;
#line 4807 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = photo;
#line 4807 "/home/jens/Source/shotwell/src/Photo.vala"
		gee_collection_add (_tmp6_, _tmp7_);
#line 37288 "Photo.c"
	}
#line 4809 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = photo;
#line 4809 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = photo_get_editable_photo_row (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_PHOTO, Photo));
#line 4809 "/home/jens/Source/shotwell/src/Photo.vala"
	editable = _tmp9_;
#line 4810 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = editable;
#line 4810 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp11_ != NULL) {
#line 37300 "Photo.c"
		BackingPhotoRow* _tmp12_ = NULL;
		GFileInfo* _tmp13_ = NULL;
		gboolean _tmp14_ = FALSE;
#line 4810 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = editable;
#line 4810 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp13_ = info;
#line 4810 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp14_ = backing_photo_row_matches_file_info (_tmp12_, _tmp13_);
#line 4810 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp10_ = _tmp14_;
#line 37312 "Photo.c"
	} else {
#line 4810 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp10_ = FALSE;
#line 37316 "Photo.c"
	}
#line 4810 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp10_) {
#line 37320 "Photo.c"
		GeeCollection* _tmp15_ = NULL;
		LibraryPhoto* _tmp16_ = NULL;
#line 4811 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp15_ = matches_editable;
#line 4811 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = photo;
#line 4811 "/home/jens/Source/shotwell/src/Photo.vala"
		gee_collection_add (_tmp15_, _tmp16_);
#line 37329 "Photo.c"
	}
#line 4813 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = photo;
#line 4813 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp18_ = photo_get_raw_development_photo_rows (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, TYPE_PHOTO, Photo));
#line 4813 "/home/jens/Source/shotwell/src/Photo.vala"
	development = _tmp18_;
#line 4814 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp19_ = development;
#line 4814 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp19_ != NULL) {
#line 37341 "Photo.c"
		{
			GeeIterator* _row_it = NULL;
			GeeCollection* _tmp20_ = NULL;
			GeeIterator* _tmp21_ = NULL;
#line 4815 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp20_ = development;
#line 4815 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp21_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, GEE_TYPE_ITERABLE, GeeIterable));
#line 4815 "/home/jens/Source/shotwell/src/Photo.vala"
			_row_it = _tmp21_;
#line 4815 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 37354 "Photo.c"
				GeeIterator* _tmp22_ = NULL;
				gboolean _tmp23_ = FALSE;
				BackingPhotoRow* row = NULL;
				GeeIterator* _tmp24_ = NULL;
				gpointer _tmp25_ = NULL;
				BackingPhotoRow* _tmp26_ = NULL;
				GFileInfo* _tmp27_ = NULL;
				gboolean _tmp28_ = FALSE;
#line 4815 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp22_ = _row_it;
#line 4815 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp23_ = gee_iterator_next (_tmp22_);
#line 4815 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp23_) {
#line 4815 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 37371 "Photo.c"
				}
#line 4815 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp24_ = _row_it;
#line 4815 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp25_ = gee_iterator_get (_tmp24_);
#line 4815 "/home/jens/Source/shotwell/src/Photo.vala"
				row = (BackingPhotoRow*) _tmp25_;
#line 4816 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp26_ = row;
#line 4816 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp27_ = info;
#line 4816 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp28_ = backing_photo_row_matches_file_info (_tmp26_, _tmp27_);
#line 4816 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp28_) {
#line 37387 "Photo.c"
					GeeCollection* _tmp29_ = NULL;
					LibraryPhoto* _tmp30_ = NULL;
#line 4817 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp29_ = matches_development;
#line 4817 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp30_ = photo;
#line 4817 "/home/jens/Source/shotwell/src/Photo.vala"
					gee_collection_add (_tmp29_, _tmp30_);
#line 4819 "/home/jens/Source/shotwell/src/Photo.vala"
					_backing_photo_row_unref0 (row);
#line 4819 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 37400 "Photo.c"
				}
#line 4815 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (row);
#line 37404 "Photo.c"
			}
#line 4815 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_row_it);
#line 37408 "Photo.c"
		}
	}
#line 4803 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (development);
#line 4803 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (editable);
#line 37415 "Photo.c"
}


void library_photo_source_collection_fetch_by_matching_backing (LibraryPhotoSourceCollection* self, GFileInfo* info, GeeCollection* matches_master, GeeCollection* matches_editable, GeeCollection* matched_development) {
#line 4827 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self));
#line 4827 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (G_IS_FILE_INFO (info));
#line 4827 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (GEE_IS_COLLECTION (matches_master));
#line 4827 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (GEE_IS_COLLECTION (matches_editable));
#line 4827 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (GEE_IS_COLLECTION (matched_development));
#line 37430 "Photo.c"
	{
		GeeIterator* _photo_it = NULL;
		GeeMultiMap* _tmp0_ = NULL;
		GFileInfo* _tmp1_ = NULL;
		gint64 _tmp2_ = 0LL;
		GeeCollection* _tmp3_ = NULL;
		GeeCollection* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
#line 4829 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->filesize_to_photo;
#line 4829 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = info;
#line 4829 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = g_file_info_get_size (_tmp1_);
#line 4829 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = gee_multi_map_get (_tmp0_, &_tmp2_);
#line 4829 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = _tmp3_;
#line 4829 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_ITERABLE, GeeIterable));
#line 4829 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = _tmp5_;
#line 4829 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp4_);
#line 4829 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_it = _tmp6_;
#line 4829 "/home/jens/Source/shotwell/src/Photo.vala"
		while (TRUE) {
#line 37460 "Photo.c"
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			LibraryPhoto* photo = NULL;
			GeeIterator* _tmp9_ = NULL;
			gpointer _tmp10_ = NULL;
			LibraryPhoto* _tmp11_ = NULL;
			GFileInfo* _tmp12_ = NULL;
			GeeCollection* _tmp13_ = NULL;
			GeeCollection* _tmp14_ = NULL;
			GeeCollection* _tmp15_ = NULL;
#line 4829 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = _photo_it;
#line 4829 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = gee_iterator_next (_tmp7_);
#line 4829 "/home/jens/Source/shotwell/src/Photo.vala"
			if (!_tmp8_) {
#line 4829 "/home/jens/Source/shotwell/src/Photo.vala"
				break;
#line 37479 "Photo.c"
			}
#line 4829 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = _photo_it;
#line 4829 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = gee_iterator_get (_tmp9_);
#line 4829 "/home/jens/Source/shotwell/src/Photo.vala"
			photo = (LibraryPhoto*) _tmp10_;
#line 4830 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = photo;
#line 4830 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = info;
#line 4830 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = matches_master;
#line 4830 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp14_ = matches_editable;
#line 4830 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp15_ = matched_development;
#line 4830 "/home/jens/Source/shotwell/src/Photo.vala"
			library_photo_source_collection_compare_backing (self, _tmp11_, _tmp12_, _tmp13_, _tmp14_, _tmp15_);
#line 4829 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (photo);
#line 37501 "Photo.c"
		}
#line 4829 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_photo_it);
#line 37505 "Photo.c"
	}
	{
		GeeIterator* _media_it = NULL;
		GeeCollection* _tmp16_ = NULL;
		GeeCollection* _tmp17_ = NULL;
		GeeIterator* _tmp18_ = NULL;
		GeeIterator* _tmp19_ = NULL;
#line 4832 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = media_source_collection_get_offline_bin_contents (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
#line 4832 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp17_ = _tmp16_;
#line 4832 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp18_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, GEE_TYPE_ITERABLE, GeeIterable));
#line 4832 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp19_ = _tmp18_;
#line 4832 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp17_);
#line 4832 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_it = _tmp19_;
#line 4832 "/home/jens/Source/shotwell/src/Photo.vala"
		while (TRUE) {
#line 37527 "Photo.c"
			GeeIterator* _tmp20_ = NULL;
			gboolean _tmp21_ = FALSE;
			MediaSource* media = NULL;
			GeeIterator* _tmp22_ = NULL;
			gpointer _tmp23_ = NULL;
			MediaSource* _tmp24_ = NULL;
			GFileInfo* _tmp25_ = NULL;
			GeeCollection* _tmp26_ = NULL;
			GeeCollection* _tmp27_ = NULL;
			GeeCollection* _tmp28_ = NULL;
#line 4832 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp20_ = _media_it;
#line 4832 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp21_ = gee_iterator_next (_tmp20_);
#line 4832 "/home/jens/Source/shotwell/src/Photo.vala"
			if (!_tmp21_) {
#line 4832 "/home/jens/Source/shotwell/src/Photo.vala"
				break;
#line 37546 "Photo.c"
			}
#line 4832 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp22_ = _media_it;
#line 4832 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp23_ = gee_iterator_get (_tmp22_);
#line 4832 "/home/jens/Source/shotwell/src/Photo.vala"
			media = (MediaSource*) _tmp23_;
#line 4833 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp24_ = media;
#line 4833 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp25_ = info;
#line 4833 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp26_ = matches_master;
#line 4833 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp27_ = matches_editable;
#line 4833 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp28_ = matched_development;
#line 4833 "/home/jens/Source/shotwell/src/Photo.vala"
			library_photo_source_collection_compare_backing (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, TYPE_LIBRARY_PHOTO, LibraryPhoto), _tmp25_, _tmp26_, _tmp27_, _tmp28_);
#line 4832 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (media);
#line 37568 "Photo.c"
		}
#line 4832 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_media_it);
#line 37572 "Photo.c"
	}
}


void library_photo_source_collection_get_basename_filesize_duplicate (LibraryPhotoSourceCollection* self, const gchar* basename, gint64 filesize, PhotoID* result) {
	PhotoID _tmp19_ = {0};
#line 4836 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self));
#line 4836 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (basename != NULL);
#line 37583 "Photo.c"
	{
		GeeIterator* _photo_it = NULL;
		GeeMultiMap* _tmp0_ = NULL;
		gint64 _tmp1_ = 0LL;
		GeeCollection* _tmp2_ = NULL;
		GeeCollection* _tmp3_ = NULL;
		GeeIterator* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
#line 4837 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = self->priv->filesize_to_photo;
#line 4837 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = filesize;
#line 4837 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = gee_multi_map_get (_tmp0_, &_tmp1_);
#line 4837 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = _tmp2_;
#line 4837 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ITERABLE, GeeIterable));
#line 4837 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = _tmp4_;
#line 4837 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp3_);
#line 4837 "/home/jens/Source/shotwell/src/Photo.vala"
		_photo_it = _tmp5_;
#line 4837 "/home/jens/Source/shotwell/src/Photo.vala"
		while (TRUE) {
#line 37610 "Photo.c"
			GeeIterator* _tmp6_ = NULL;
			gboolean _tmp7_ = FALSE;
			LibraryPhoto* photo = NULL;
			GeeIterator* _tmp8_ = NULL;
			gpointer _tmp9_ = NULL;
			LibraryPhoto* _tmp10_ = NULL;
			GFile* _tmp11_ = NULL;
			GFile* _tmp12_ = NULL;
			gchar* _tmp13_ = NULL;
			const gchar* _tmp14_ = NULL;
			gint _tmp15_ = 0;
			gboolean _tmp16_ = FALSE;
#line 4837 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = _photo_it;
#line 4837 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = gee_iterator_next (_tmp6_);
#line 4837 "/home/jens/Source/shotwell/src/Photo.vala"
			if (!_tmp7_) {
#line 4837 "/home/jens/Source/shotwell/src/Photo.vala"
				break;
#line 37631 "Photo.c"
			}
#line 4837 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = _photo_it;
#line 4837 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = gee_iterator_get (_tmp8_);
#line 4837 "/home/jens/Source/shotwell/src/Photo.vala"
			photo = (LibraryPhoto*) _tmp9_;
#line 4838 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = photo;
#line 4838 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = media_source_get_master_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TYPE_MEDIA_SOURCE, MediaSource));
#line 4838 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp12_ = _tmp11_;
#line 4838 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp13_ = g_file_get_basename (_tmp12_);
#line 4838 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp14_ = basename;
#line 4838 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp15_ = utf8_ci_compare (_tmp13_, _tmp14_);
#line 4838 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp16_ = _tmp15_ == 0;
#line 4838 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tmp12_);
#line 4838 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_tmp16_) {
#line 37657 "Photo.c"
				LibraryPhoto* _tmp17_ = NULL;
				PhotoID _tmp18_ = {0};
#line 4839 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp17_ = photo;
#line 4839 "/home/jens/Source/shotwell/src/Photo.vala"
				photo_get_photo_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, TYPE_PHOTO, Photo), &_tmp18_);
#line 4839 "/home/jens/Source/shotwell/src/Photo.vala"
				*result = _tmp18_;
#line 4839 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (photo);
#line 4839 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (_photo_it);
#line 4839 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 37672 "Photo.c"
			}
#line 4837 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (photo);
#line 37676 "Photo.c"
		}
#line 4837 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_photo_it);
#line 37680 "Photo.c"
	}
#line 4842 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_id_init (&_tmp19_, PHOTO_ID_INVALID);
#line 4842 "/home/jens/Source/shotwell/src/Photo.vala"
	*result = _tmp19_;
#line 4842 "/home/jens/Source/shotwell/src/Photo.vala"
	return;
#line 37688 "Photo.c"
}


gboolean library_photo_source_collection_has_basename_filesize_duplicate (LibraryPhotoSourceCollection* self, const gchar* basename, gint64 filesize) {
	gboolean result = FALSE;
	const gchar* _tmp0_ = NULL;
	gint64 _tmp1_ = 0LL;
	PhotoID _tmp2_ = {0};
	gboolean _tmp3_ = FALSE;
#line 4846 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self), FALSE);
#line 4846 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (basename != NULL, FALSE);
#line 4847 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = basename;
#line 4847 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = filesize;
#line 4847 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_source_collection_get_basename_filesize_duplicate (self, _tmp0_, _tmp1_, &_tmp2_);
#line 4847 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = photo_id_is_valid (&_tmp2_);
#line 4847 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp3_;
#line 4847 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 37714 "Photo.c"
}


LibraryPhoto* library_photo_source_collection_get_trashed_by_file (LibraryPhotoSourceCollection* self, GFile* file) {
	LibraryPhoto* result = NULL;
	LibraryPhoto* photo = NULL;
	MediaSourceHoldingTank* _tmp0_ = NULL;
	MediaSourceHoldingTank* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	MediaSource* _tmp3_ = NULL;
	LibraryPhoto* _tmp4_ = NULL;
	LibraryPhoto* _tmp5_ = NULL;
#line 4850 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self), NULL);
#line 4850 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_IS_FILE (file), NULL);
#line 4851 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = media_source_collection_get_trashcan (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
#line 4851 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 4851 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = file;
#line 4851 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = media_source_holding_tank_fetch_by_master_file (_tmp1_, _tmp2_);
#line 4851 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 4851 "/home/jens/Source/shotwell/src/Photo.vala"
	_source_holding_tank_unref0 (_tmp1_);
#line 4851 "/home/jens/Source/shotwell/src/Photo.vala"
	photo = _tmp4_;
#line 4852 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = photo;
#line 4852 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp5_ == NULL) {
#line 37749 "Photo.c"
		MediaSourceHoldingTank* _tmp6_ = NULL;
		LibraryPhotoSourceHoldingTank* _tmp7_ = NULL;
		GFile* _tmp8_ = NULL;
		LibraryPhoto* _tmp9_ = NULL;
#line 4853 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = media_source_collection_get_trashcan (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
#line 4853 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_LIBRARY_PHOTO_SOURCE_HOLDING_TANK, LibraryPhotoSourceHoldingTank);
#line 4853 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = file;
#line 4853 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp9_ = library_photo_source_holding_tank_fetch_by_backing_file (_tmp7_, _tmp8_);
#line 4853 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (photo);
#line 4853 "/home/jens/Source/shotwell/src/Photo.vala"
		photo = G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 4853 "/home/jens/Source/shotwell/src/Photo.vala"
		_source_holding_tank_unref0 (_tmp7_);
#line 37768 "Photo.c"
	}
#line 4856 "/home/jens/Source/shotwell/src/Photo.vala"
	result = photo;
#line 4856 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 37774 "Photo.c"
}


LibraryPhoto* library_photo_source_collection_get_trashed_by_md5 (LibraryPhotoSourceCollection* self, const gchar* md5) {
	LibraryPhoto* result = NULL;
	MediaSourceHoldingTank* _tmp0_ = NULL;
	MediaSourceHoldingTank* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	MediaSource* _tmp3_ = NULL;
	LibraryPhoto* _tmp4_ = NULL;
#line 4859 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self), NULL);
#line 4859 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (md5 != NULL, NULL);
#line 4860 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = media_source_collection_get_trashcan (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
#line 4860 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 4860 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = md5;
#line 4860 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = media_source_holding_tank_fetch_by_md5 (_tmp1_, _tmp2_);
#line 4860 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 4860 "/home/jens/Source/shotwell/src/Photo.vala"
	_source_holding_tank_unref0 (_tmp1_);
#line 4860 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp4_;
#line 4860 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 37805 "Photo.c"
}


LibraryPhoto* library_photo_source_collection_get_offline_by_file (LibraryPhotoSourceCollection* self, GFile* file) {
	LibraryPhoto* result = NULL;
	LibraryPhoto* photo = NULL;
	MediaSourceHoldingTank* _tmp0_ = NULL;
	MediaSourceHoldingTank* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	MediaSource* _tmp3_ = NULL;
	LibraryPhoto* _tmp4_ = NULL;
	LibraryPhoto* _tmp5_ = NULL;
#line 4863 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self), NULL);
#line 4863 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_IS_FILE (file), NULL);
#line 4864 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = media_source_collection_get_offline_bin (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
#line 4864 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 4864 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = file;
#line 4864 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = media_source_holding_tank_fetch_by_master_file (_tmp1_, _tmp2_);
#line 4864 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 4864 "/home/jens/Source/shotwell/src/Photo.vala"
	_source_holding_tank_unref0 (_tmp1_);
#line 4864 "/home/jens/Source/shotwell/src/Photo.vala"
	photo = _tmp4_;
#line 4865 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = photo;
#line 4865 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp5_ == NULL) {
#line 37840 "Photo.c"
		MediaSourceHoldingTank* _tmp6_ = NULL;
		LibraryPhotoSourceHoldingTank* _tmp7_ = NULL;
		GFile* _tmp8_ = NULL;
		LibraryPhoto* _tmp9_ = NULL;
#line 4866 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = media_source_collection_get_offline_bin (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
#line 4866 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_LIBRARY_PHOTO_SOURCE_HOLDING_TANK, LibraryPhotoSourceHoldingTank);
#line 4866 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = file;
#line 4866 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp9_ = library_photo_source_holding_tank_fetch_by_backing_file (_tmp7_, _tmp8_);
#line 4866 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (photo);
#line 4866 "/home/jens/Source/shotwell/src/Photo.vala"
		photo = G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 4866 "/home/jens/Source/shotwell/src/Photo.vala"
		_source_holding_tank_unref0 (_tmp7_);
#line 37859 "Photo.c"
	}
#line 4869 "/home/jens/Source/shotwell/src/Photo.vala"
	result = photo;
#line 4869 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 37865 "Photo.c"
}


LibraryPhoto* library_photo_source_collection_get_offline_by_md5 (LibraryPhotoSourceCollection* self, const gchar* md5) {
	LibraryPhoto* result = NULL;
	MediaSourceHoldingTank* _tmp0_ = NULL;
	MediaSourceHoldingTank* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	MediaSource* _tmp3_ = NULL;
	LibraryPhoto* _tmp4_ = NULL;
#line 4872 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self), NULL);
#line 4872 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (md5 != NULL, NULL);
#line 4873 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = media_source_collection_get_offline_bin (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
#line 4873 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 4873 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = md5;
#line 4873 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = media_source_holding_tank_fetch_by_md5 (_tmp1_, _tmp2_);
#line 4873 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 4873 "/home/jens/Source/shotwell/src/Photo.vala"
	_source_holding_tank_unref0 (_tmp1_);
#line 4873 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp4_;
#line 4873 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 37896 "Photo.c"
}


gint library_photo_source_collection_get_offline_count (LibraryPhotoSourceCollection* self) {
	gint result = 0;
	MediaSourceHoldingTank* _tmp0_ = NULL;
	MediaSourceHoldingTank* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
#line 4876 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self), 0);
#line 4877 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = media_source_collection_get_offline_bin (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
#line 4877 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 4877 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = source_holding_tank_get_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_SOURCE_HOLDING_TANK, SourceHoldingTank));
#line 4877 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp2_;
#line 4877 "/home/jens/Source/shotwell/src/Photo.vala"
	_source_holding_tank_unref0 (_tmp1_);
#line 4877 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp3_;
#line 4877 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 37922 "Photo.c"
}


LibraryPhoto* library_photo_source_collection_get_state_by_file (LibraryPhotoSourceCollection* self, GFile* file, LibraryPhotoSourceCollectionState* state) {
	LibraryPhotoSourceCollectionState _vala_state = 0;
	LibraryPhoto* result = NULL;
	LibraryPhoto* photo = NULL;
	GFile* _tmp0_ = NULL;
	MediaSource* _tmp1_ = NULL;
	LibraryPhoto* _tmp2_ = NULL;
	GFile* _tmp3_ = NULL;
	LibraryPhoto* _tmp4_ = NULL;
	LibraryPhoto* _tmp5_ = NULL;
	GFile* _tmp6_ = NULL;
	LibraryPhoto* _tmp7_ = NULL;
	LibraryPhoto* _tmp8_ = NULL;
	GFile* _tmp9_ = NULL;
	LibraryPhoto* _tmp10_ = NULL;
	LibraryPhoto* _tmp11_ = NULL;
	LibraryPhoto* _tmp12_ = NULL;
	GFile* _tmp13_ = NULL;
	LibraryPhoto* _tmp14_ = NULL;
	LibraryPhoto* _tmp15_ = NULL;
	LibraryPhoto* _tmp16_ = NULL;
#line 4880 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (self), NULL);
#line 4880 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_IS_FILE (file), NULL);
#line 4881 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = file;
#line 4881 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = media_source_collection_fetch_by_master_file (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection), _tmp0_);
#line 4881 "/home/jens/Source/shotwell/src/Photo.vala"
	photo = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 4882 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo;
#line 4882 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp2_ != NULL) {
#line 4883 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_state = LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_ONLINE;
#line 4885 "/home/jens/Source/shotwell/src/Photo.vala"
		result = photo;
#line 4885 "/home/jens/Source/shotwell/src/Photo.vala"
		if (state) {
#line 4885 "/home/jens/Source/shotwell/src/Photo.vala"
			*state = _vala_state;
#line 37969 "Photo.c"
		}
#line 4885 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 37973 "Photo.c"
	}
#line 4888 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = file;
#line 4888 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = library_photo_source_collection_fetch_by_editable_file (self, _tmp3_);
#line 4888 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (photo);
#line 4888 "/home/jens/Source/shotwell/src/Photo.vala"
	photo = _tmp4_;
#line 4889 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = photo;
#line 4889 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp5_ != NULL) {
#line 4890 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_state = LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_EDITABLE;
#line 4892 "/home/jens/Source/shotwell/src/Photo.vala"
		result = photo;
#line 4892 "/home/jens/Source/shotwell/src/Photo.vala"
		if (state) {
#line 4892 "/home/jens/Source/shotwell/src/Photo.vala"
			*state = _vala_state;
#line 37995 "Photo.c"
		}
#line 4892 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 37999 "Photo.c"
	}
#line 4895 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = file;
#line 4895 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = library_photo_source_collection_fetch_by_raw_development_file (self, _tmp6_);
#line 4895 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (photo);
#line 4895 "/home/jens/Source/shotwell/src/Photo.vala"
	photo = _tmp7_;
#line 4896 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = photo;
#line 4896 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp8_ != NULL) {
#line 4897 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_state = LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_DEVELOPER;
#line 4899 "/home/jens/Source/shotwell/src/Photo.vala"
		result = photo;
#line 4899 "/home/jens/Source/shotwell/src/Photo.vala"
		if (state) {
#line 4899 "/home/jens/Source/shotwell/src/Photo.vala"
			*state = _vala_state;
#line 38021 "Photo.c"
		}
#line 4899 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 38025 "Photo.c"
	}
#line 4902 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = file;
#line 4902 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = library_photo_source_collection_get_trashed_by_file (self, _tmp9_);
#line 4902 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, TYPE_LIBRARY_PHOTO) ? ((LibraryPhoto*) _tmp10_) : NULL;
#line 4902 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp11_ == NULL) {
#line 4902 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp10_);
#line 38037 "Photo.c"
	}
#line 4902 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (photo);
#line 4902 "/home/jens/Source/shotwell/src/Photo.vala"
	photo = _tmp11_;
#line 4903 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = photo;
#line 4903 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp12_ != NULL) {
#line 4904 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_state = LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_TRASH;
#line 4906 "/home/jens/Source/shotwell/src/Photo.vala"
		result = photo;
#line 4906 "/home/jens/Source/shotwell/src/Photo.vala"
		if (state) {
#line 4906 "/home/jens/Source/shotwell/src/Photo.vala"
			*state = _vala_state;
#line 38055 "Photo.c"
		}
#line 4906 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 38059 "Photo.c"
	}
#line 4909 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = file;
#line 4909 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = library_photo_source_collection_get_offline_by_file (self, _tmp13_);
#line 4909 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, TYPE_LIBRARY_PHOTO) ? ((LibraryPhoto*) _tmp14_) : NULL;
#line 4909 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp15_ == NULL) {
#line 4909 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp14_);
#line 38071 "Photo.c"
	}
#line 4909 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (photo);
#line 4909 "/home/jens/Source/shotwell/src/Photo.vala"
	photo = _tmp15_;
#line 4910 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_ = photo;
#line 4910 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp16_ != NULL) {
#line 4911 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_state = LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_OFFLINE;
#line 4913 "/home/jens/Source/shotwell/src/Photo.vala"
		result = photo;
#line 4913 "/home/jens/Source/shotwell/src/Photo.vala"
		if (state) {
#line 4913 "/home/jens/Source/shotwell/src/Photo.vala"
			*state = _vala_state;
#line 38089 "Photo.c"
		}
#line 4913 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 38093 "Photo.c"
	}
#line 4916 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_state = LIBRARY_PHOTO_SOURCE_COLLECTION_STATE_UNKNOWN;
#line 4918 "/home/jens/Source/shotwell/src/Photo.vala"
	result = NULL;
#line 4918 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (photo);
#line 4918 "/home/jens/Source/shotwell/src/Photo.vala"
	if (state) {
#line 4918 "/home/jens/Source/shotwell/src/Photo.vala"
		*state = _vala_state;
#line 38105 "Photo.c"
	}
#line 4918 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 38109 "Photo.c"
}


static gboolean library_photo_source_collection_real_has_backlink (SourceCollection* base, SourceBacklink* backlink) {
	LibraryPhotoSourceCollection * self;
	gboolean result = FALSE;
	SourceBacklink* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	MediaSourceHoldingTank* _tmp2_ = NULL;
	MediaSourceHoldingTank* _tmp3_ = NULL;
	SourceBacklink* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	MediaSourceHoldingTank* _tmp7_ = NULL;
	MediaSourceHoldingTank* _tmp8_ = NULL;
	SourceBacklink* _tmp9_ = NULL;
	gboolean _tmp10_ = FALSE;
	gboolean _tmp11_ = FALSE;
#line 4921 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollection);
#line 4921 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_SOURCE_BACKLINK (backlink), FALSE);
#line 4922 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = backlink;
#line 4922 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = SOURCE_COLLECTION_CLASS (library_photo_source_collection_parent_class)->has_backlink (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection), TYPE_SOURCE_COLLECTION, SourceCollection), _tmp0_);
#line 4922 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_) {
#line 4923 "/home/jens/Source/shotwell/src/Photo.vala"
		result = TRUE;
#line 4923 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 38142 "Photo.c"
	}
#line 4925 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = media_source_collection_get_trashcan (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
#line 4925 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp2_;
#line 4925 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = backlink;
#line 4925 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = source_holding_tank_has_backlink (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_SOURCE_HOLDING_TANK, SourceHoldingTank), _tmp4_);
#line 4925 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = _tmp5_;
#line 4925 "/home/jens/Source/shotwell/src/Photo.vala"
	_source_holding_tank_unref0 (_tmp3_);
#line 4925 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp6_) {
#line 4926 "/home/jens/Source/shotwell/src/Photo.vala"
		result = TRUE;
#line 4926 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 38162 "Photo.c"
	}
#line 4928 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = media_source_collection_get_offline_bin (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
#line 4928 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = _tmp7_;
#line 4928 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = backlink;
#line 4928 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = source_holding_tank_has_backlink (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_SOURCE_HOLDING_TANK, SourceHoldingTank), _tmp9_);
#line 4928 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = _tmp10_;
#line 4928 "/home/jens/Source/shotwell/src/Photo.vala"
	_source_holding_tank_unref0 (_tmp8_);
#line 4928 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp11_) {
#line 4929 "/home/jens/Source/shotwell/src/Photo.vala"
		result = TRUE;
#line 4929 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 38182 "Photo.c"
	}
#line 4931 "/home/jens/Source/shotwell/src/Photo.vala"
	result = FALSE;
#line 4931 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 38188 "Photo.c"
}


static void library_photo_source_collection_real_remove_backlink (SourceCollection* base, SourceBacklink* backlink) {
	LibraryPhotoSourceCollection * self;
	MediaSourceHoldingTank* _tmp0_ = NULL;
	MediaSourceHoldingTank* _tmp1_ = NULL;
	SourceBacklink* _tmp2_ = NULL;
	MediaSourceHoldingTank* _tmp3_ = NULL;
	MediaSourceHoldingTank* _tmp4_ = NULL;
	SourceBacklink* _tmp5_ = NULL;
	SourceBacklink* _tmp6_ = NULL;
#line 4934 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollection);
#line 4934 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_SOURCE_BACKLINK (backlink));
#line 4935 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = media_source_collection_get_trashcan (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
#line 4935 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 4935 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = backlink;
#line 4935 "/home/jens/Source/shotwell/src/Photo.vala"
	source_holding_tank_remove_backlink (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_SOURCE_HOLDING_TANK, SourceHoldingTank), _tmp2_);
#line 4935 "/home/jens/Source/shotwell/src/Photo.vala"
	_source_holding_tank_unref0 (_tmp1_);
#line 4936 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = media_source_collection_get_offline_bin (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
#line 4936 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = _tmp3_;
#line 4936 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = backlink;
#line 4936 "/home/jens/Source/shotwell/src/Photo.vala"
	source_holding_tank_remove_backlink (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_SOURCE_HOLDING_TANK, SourceHoldingTank), _tmp5_);
#line 4936 "/home/jens/Source/shotwell/src/Photo.vala"
	_source_holding_tank_unref0 (_tmp4_);
#line 4938 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = backlink;
#line 4938 "/home/jens/Source/shotwell/src/Photo.vala"
	SOURCE_COLLECTION_CLASS (library_photo_source_collection_parent_class)->remove_backlink (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection), TYPE_SOURCE_COLLECTION, SourceCollection), _tmp6_);
#line 38229 "Photo.c"
}


static TransactionController* library_photo_source_collection_real_get_transaction_controller (MediaSourceCollection* base) {
	TransactionController* result;
	LibraryPhotoSourceCollection* self;
	TransactionController* _tmp0_ = NULL;
	TransactionController* _tmp2_ = NULL;
#line 4455 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollection);
#line 4456 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = self->priv->_transaction_controller;
#line 4456 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp0_ == NULL) {
#line 38244 "Photo.c"
		MediaSourceTransactionController* _tmp1_ = NULL;
#line 4457 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = media_source_transaction_controller_new (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
#line 4457 "/home/jens/Source/shotwell/src/Photo.vala"
		_transaction_controller_unref0 (self->priv->_transaction_controller);
#line 4457 "/home/jens/Source/shotwell/src/Photo.vala"
		self->priv->_transaction_controller = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_TRANSACTION_CONTROLLER, TransactionController);
#line 38252 "Photo.c"
	}
#line 4459 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = self->priv->_transaction_controller;
#line 4459 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp2_;
#line 4459 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 38260 "Photo.c"
}


static void library_photo_source_collection_real_master_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata) {
#line 4477 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO (photo));
#line 4477 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 38269 "Photo.c"
}


static void g_cclosure_user_marshal_VOID__OBJECT_MEDIA_METADATA (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
	typedef void (*GMarshalFunc_VOID__OBJECT_MEDIA_METADATA) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2);
	register GMarshalFunc_VOID__OBJECT_MEDIA_METADATA callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (n_param_values == 3);
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_CCLOSURE_SWAP_DATA (closure)) {
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
		data1 = closure->data;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
		data2 = param_values->data[0].v_pointer;
#line 38288 "Photo.c"
	} else {
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
		data1 = param_values->data[0].v_pointer;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
		data2 = closure->data;
#line 38294 "Photo.c"
	}
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	callback = (GMarshalFunc_VOID__OBJECT_MEDIA_METADATA) (marshal_data ? marshal_data : cc->callback);
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	callback (data1, g_value_get_object (param_values + 1), value_get_media_metadata (param_values + 2), data2);
#line 38300 "Photo.c"
}


static void library_photo_source_collection_real_editable_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata) {
#line 4480 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO (photo));
#line 4480 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 38309 "Photo.c"
}


static void library_photo_source_collection_real_baseline_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata) {
#line 4483 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO (photo));
#line 4483 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 38318 "Photo.c"
}


static void library_photo_source_collection_real_source_reimported (LibraryPhotoSourceCollection* self, LibraryPhoto* photo, PhotoMetadata* metadata) {
#line 4486 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO (photo));
#line 4486 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 38327 "Photo.c"
}


static void library_photo_source_collection_class_init (LibraryPhotoSourceCollectionClass * klass) {
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_source_collection_parent_class = g_type_class_peek_parent (klass);
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((DataCollectionClass *) klass)->finalize = library_photo_source_collection_finalize;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	g_type_class_add_private (klass, sizeof (LibraryPhotoSourceCollectionPrivate));
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceCollectionClass *) klass)->create_trashcan = (MediaSourceHoldingTank* (*)(MediaSourceCollection*)) library_photo_source_collection_real_create_trashcan;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceCollectionClass *) klass)->create_offline_bin = (MediaSourceHoldingTank* (*)(MediaSourceCollection*)) library_photo_source_collection_real_create_offline_bin;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceCollectionClass *) klass)->create_media_monitor = (MediaMonitor* (*)(MediaSourceCollection*, Workers*, GCancellable*)) library_photo_source_collection_real_create_media_monitor;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((SourceCollectionClass *) klass)->holds_type_of_source = (gboolean (*)(SourceCollection*, DataSource*)) library_photo_source_collection_real_holds_type_of_source;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceCollectionClass *) klass)->get_typename = (gchar* (*)(MediaSourceCollection*)) library_photo_source_collection_real_get_typename;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceCollectionClass *) klass)->is_file_recognized = (gboolean (*)(MediaSourceCollection*, GFile*)) library_photo_source_collection_real_is_file_recognized;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((DataCollectionClass *) klass)->notify_contents_altered = (void (*)(DataCollection*, GeeIterable*, GeeIterable*)) library_photo_source_collection_real_notify_contents_altered;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((DataCollectionClass *) klass)->items_altered = (void (*)(DataCollection*, GeeMap*)) library_photo_source_collection_real_items_altered;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceCollectionClass *) klass)->postprocess_imported_media = (void (*)(MediaSourceCollection*, GeeCollection*)) library_photo_source_collection_real_postprocess_imported_media;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((LibraryPhotoSourceCollectionClass *) klass)->notify_master_reimported = (void (*)(LibraryPhotoSourceCollection*, LibraryPhoto*, PhotoMetadata*)) library_photo_source_collection_real_notify_master_reimported;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((LibraryPhotoSourceCollectionClass *) klass)->notify_editable_reimported = (void (*)(LibraryPhotoSourceCollection*, LibraryPhoto*, PhotoMetadata*)) library_photo_source_collection_real_notify_editable_reimported;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((LibraryPhotoSourceCollectionClass *) klass)->notify_source_reimported = (void (*)(LibraryPhotoSourceCollection*, LibraryPhoto*, PhotoMetadata*)) library_photo_source_collection_real_notify_source_reimported;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((LibraryPhotoSourceCollectionClass *) klass)->notify_baseline_reimported = (void (*)(LibraryPhotoSourceCollection*, LibraryPhoto*, PhotoMetadata*)) library_photo_source_collection_real_notify_baseline_reimported;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceCollectionClass *) klass)->fetch_by_numeric_id = (MediaSource* (*)(MediaSourceCollection*, gint64)) library_photo_source_collection_real_fetch_by_numeric_id;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceCollectionClass *) klass)->fetch_by_source_id = (MediaSource* (*)(MediaSourceCollection*, const gchar*)) library_photo_source_collection_real_fetch_by_source_id;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceCollectionClass *) klass)->get_event_source_ids = (GeeCollection* (*)(MediaSourceCollection*, EventID*)) library_photo_source_collection_real_get_event_source_ids;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((SourceCollectionClass *) klass)->has_backlink = (gboolean (*)(SourceCollection*, SourceBacklink*)) library_photo_source_collection_real_has_backlink;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((SourceCollectionClass *) klass)->remove_backlink = (void (*)(SourceCollection*, SourceBacklink*)) library_photo_source_collection_real_remove_backlink;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((LibraryPhotoSourceCollectionClass *) klass)->master_reimported = library_photo_source_collection_real_master_reimported;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((LibraryPhotoSourceCollectionClass *) klass)->editable_reimported = library_photo_source_collection_real_editable_reimported;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((LibraryPhotoSourceCollectionClass *) klass)->baseline_reimported = library_photo_source_collection_real_baseline_reimported;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	((LibraryPhotoSourceCollectionClass *) klass)->source_reimported = library_photo_source_collection_real_source_reimported;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	MEDIA_SOURCE_COLLECTION_CLASS (klass)->get_transaction_controller = library_photo_source_collection_real_get_transaction_controller;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_new ("master_reimported", TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (LibraryPhotoSourceCollectionClass, master_reimported), NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_MEDIA_METADATA, G_TYPE_NONE, 2, TYPE_LIBRARY_PHOTO, TYPE_PHOTO_METADATA);
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_new ("editable_reimported", TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (LibraryPhotoSourceCollectionClass, editable_reimported), NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_MEDIA_METADATA, G_TYPE_NONE, 2, TYPE_LIBRARY_PHOTO, TYPE_PHOTO_METADATA);
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_new ("baseline_reimported", TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (LibraryPhotoSourceCollectionClass, baseline_reimported), NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_MEDIA_METADATA, G_TYPE_NONE, 2, TYPE_LIBRARY_PHOTO, TYPE_PHOTO_METADATA);
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	g_signal_new ("source_reimported", TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (LibraryPhotoSourceCollectionClass, source_reimported), NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_MEDIA_METADATA, G_TYPE_NONE, 2, TYPE_LIBRARY_PHOTO, TYPE_PHOTO_METADATA);
#line 38392 "Photo.c"
}


static void library_photo_source_collection_instance_init (LibraryPhotoSourceCollection * self) {
	GeeHashMap* _tmp0_ = NULL;
	GeeHashMap* _tmp1_ = NULL;
	GeeTreeMultiMap* _tmp2_ = NULL;
	GeeHashMap* _tmp3_ = NULL;
	GeeHashMap* _tmp4_ = NULL;
	GeeTreeMultiMap* _tmp5_ = NULL;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv = LIBRARY_PHOTO_SOURCE_COLLECTION_GET_PRIVATE (self);
#line 4463 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->_transaction_controller = NULL;
#line 4464 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = gee_hash_map_new (g_file_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _file_hash_gee_hash_data_func, NULL, NULL, _file_equal_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
#line 4464 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->by_editable_file = _tmp0_;
#line 4466 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = gee_hash_map_new (g_file_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _file_hash_gee_hash_data_func, NULL, NULL, _file_equal_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
#line 4466 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->by_raw_development_file = _tmp1_;
#line 4468 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = gee_tree_multi_map_new (G_TYPE_INT64, (GBoxedCopyFunc) _int64_dup, (GDestroyNotify) g_free, TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _int64_compare_gcompare_data_func, NULL, NULL, NULL, NULL, NULL);
#line 4468 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->filesize_to_photo = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_MULTI_MAP, GeeMultiMap);
#line 4470 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = gee_hash_map_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, G_TYPE_INT64, (GBoxedCopyFunc) _int64_dup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL, _int64_equal_gee_equal_data_func, NULL, NULL);
#line 4470 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->photo_to_master_filesize = _tmp3_;
#line 4472 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = gee_hash_map_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, G_TYPE_INT64, (GBoxedCopyFunc) _int64_dup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL, _int64_equal_gee_equal_data_func, NULL, NULL);
#line 4472 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->photo_to_editable_filesize = _tmp4_;
#line 4474 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = gee_tree_multi_map_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, G_TYPE_INT64, (GBoxedCopyFunc) _int64_dup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
#line 4474 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->photo_to_raw_development_filesize = G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_MULTI_MAP, GeeMultiMap);
#line 38431 "Photo.c"
}


static void library_photo_source_collection_finalize (DataCollection* obj) {
	LibraryPhotoSourceCollection * self;
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollection);
#line 4463 "/home/jens/Source/shotwell/src/Photo.vala"
	_transaction_controller_unref0 (self->priv->_transaction_controller);
#line 4464 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->by_editable_file);
#line 4466 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->by_raw_development_file);
#line 4468 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->filesize_to_photo);
#line 4470 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->photo_to_master_filesize);
#line 4472 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->photo_to_editable_filesize);
#line 4474 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->photo_to_raw_development_filesize);
#line 4444 "/home/jens/Source/shotwell/src/Photo.vala"
	DATA_COLLECTION_CLASS (library_photo_source_collection_parent_class)->finalize (obj);
#line 38455 "Photo.c"
}


GType library_photo_source_collection_get_type (void) {
	static volatile gsize library_photo_source_collection_type_id__volatile = 0;
	if (g_once_init_enter (&library_photo_source_collection_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (LibraryPhotoSourceCollectionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) library_photo_source_collection_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LibraryPhotoSourceCollection), 0, (GInstanceInitFunc) library_photo_source_collection_instance_init, NULL };
		GType library_photo_source_collection_type_id;
		library_photo_source_collection_type_id = g_type_register_static (TYPE_MEDIA_SOURCE_COLLECTION, "LibraryPhotoSourceCollection", &g_define_type_info, 0);
		g_once_init_leave (&library_photo_source_collection_type_id__volatile, library_photo_source_collection_type_id);
	}
	return library_photo_source_collection_type_id__volatile;
}


static void _library_photo_generate_thumbnails_one_shot_callback (gpointer self) {
#line 4966 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_generate_thumbnails ((LibraryPhoto*) self);
#line 38474 "Photo.c"
}


static LibraryPhoto* library_photo_construct (GType object_type, PhotoRow* row) {
	LibraryPhoto * self = NULL;
	PhotoRow* _tmp0_ = NULL;
	OneShotScheduler* _tmp1_ = NULL;
	PhotoRow* _tmp2_ = NULL;
	guint64 _tmp3_ = 0ULL;
	PhotoRow* _tmp7_ = NULL;
	guint64 _tmp8_ = 0ULL;
#line 4961 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO_ROW (row), NULL);
#line 4962 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = row;
#line 4962 "/home/jens/Source/shotwell/src/Photo.vala"
	self = (LibraryPhoto*) photo_construct (object_type, _tmp0_);
#line 4964 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->import_keywords);
#line 4964 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->import_keywords = NULL;
#line 4966 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = one_shot_scheduler_new ("LibraryPhoto", _library_photo_generate_thumbnails_one_shot_callback, self);
#line 4966 "/home/jens/Source/shotwell/src/Photo.vala"
	_one_shot_scheduler_unref0 (self->priv->thumbnail_scheduler);
#line 4966 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->thumbnail_scheduler = _tmp1_;
#line 4969 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = row;
#line 4969 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp2_->flags;
#line 4969 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((_tmp3_ & (LIBRARY_PHOTO_FLAG_TRASH | LIBRARY_PHOTO_FLAG_OFFLINE)) != ((guint64) 0)) {
#line 38508 "Photo.c"
		LibraryPhotoSourceCollection* _tmp4_ = NULL;
		PhotoRow* _tmp5_ = NULL;
		const gchar* _tmp6_ = NULL;
#line 4970 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = library_photo_global;
#line 4970 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = row;
#line 4970 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = _tmp5_->backlinks;
#line 4970 "/home/jens/Source/shotwell/src/Photo.vala"
		data_source_rehydrate_backlinks (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_SOURCE, DataSource), G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_SOURCE_COLLECTION, SourceCollection), _tmp6_);
#line 38520 "Photo.c"
	}
#line 4972 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = row;
#line 4972 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = _tmp7_->flags;
#line 4972 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((_tmp8_ & (LIBRARY_PHOTO_FLAG_HIDDEN | LIBRARY_PHOTO_FLAG_FAVORITE)) != ((guint64) 0)) {
#line 38528 "Photo.c"
		PhotoRow* _tmp9_ = NULL;
		guint64 _tmp10_ = 0ULL;
#line 4973 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp9_ = row;
#line 4973 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp10_ = _tmp9_->flags;
#line 4973 "/home/jens/Source/shotwell/src/Photo.vala"
		library_photo_upgrade_rating_flags (self, _tmp10_);
#line 38537 "Photo.c"
	}
#line 4961 "/home/jens/Source/shotwell/src/Photo.vala"
	return self;
#line 38541 "Photo.c"
}


static LibraryPhoto* library_photo_new (PhotoRow* row) {
#line 4961 "/home/jens/Source/shotwell/src/Photo.vala"
	return library_photo_construct (TYPE_LIBRARY_PHOTO, row);
#line 38548 "Photo.c"
}


static LibraryPhoto* library_photo_construct_from_import_params (GType object_type, PhotoImportParams* import_params) {
	LibraryPhoto * self = NULL;
	PhotoImportParams* _tmp0_ = NULL;
	PhotoRow* _tmp1_ = NULL;
	PhotoImportParams* _tmp2_ = NULL;
	GeeCollection* _tmp3_ = NULL;
	GeeCollection* _tmp4_ = NULL;
	OneShotScheduler* _tmp5_ = NULL;
	PhotoImportParams* _tmp6_ = NULL;
	PhotoRow* _tmp7_ = NULL;
	guint64 _tmp8_ = 0ULL;
	PhotoImportParams* _tmp13_ = NULL;
	PhotoRow* _tmp14_ = NULL;
	guint64 _tmp15_ = 0ULL;
#line 4976 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO_IMPORT_PARAMS (import_params), NULL);
#line 4977 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = import_params;
#line 4977 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_->row;
#line 4977 "/home/jens/Source/shotwell/src/Photo.vala"
	self = (LibraryPhoto*) photo_construct (object_type, _tmp1_);
#line 4979 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = import_params;
#line 4979 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp2_->keywords;
#line 4979 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = _g_object_ref0 (_tmp3_);
#line 4979 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->import_keywords);
#line 4979 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->import_keywords = _tmp4_;
#line 4980 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = one_shot_scheduler_new ("LibraryPhoto", _library_photo_generate_thumbnails_one_shot_callback, self);
#line 4980 "/home/jens/Source/shotwell/src/Photo.vala"
	_one_shot_scheduler_unref0 (self->priv->thumbnail_scheduler);
#line 4980 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->thumbnail_scheduler = _tmp5_;
#line 4983 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = import_params;
#line 4983 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = _tmp6_->row;
#line 4983 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = _tmp7_->flags;
#line 4983 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((_tmp8_ & (LIBRARY_PHOTO_FLAG_TRASH | LIBRARY_PHOTO_FLAG_OFFLINE)) != ((guint64) 0)) {
#line 38598 "Photo.c"
		LibraryPhotoSourceCollection* _tmp9_ = NULL;
		PhotoImportParams* _tmp10_ = NULL;
		PhotoRow* _tmp11_ = NULL;
		const gchar* _tmp12_ = NULL;
#line 4984 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp9_ = library_photo_global;
#line 4984 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp10_ = import_params;
#line 4984 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = _tmp10_->row;
#line 4984 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = _tmp11_->backlinks;
#line 4984 "/home/jens/Source/shotwell/src/Photo.vala"
		data_source_rehydrate_backlinks (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_SOURCE, DataSource), G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_SOURCE_COLLECTION, SourceCollection), _tmp12_);
#line 38613 "Photo.c"
	}
#line 4986 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = import_params;
#line 4986 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = _tmp13_->row;
#line 4986 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = _tmp14_->flags;
#line 4986 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((_tmp15_ & (LIBRARY_PHOTO_FLAG_HIDDEN | LIBRARY_PHOTO_FLAG_FAVORITE)) != ((guint64) 0)) {
#line 38623 "Photo.c"
		PhotoImportParams* _tmp16_ = NULL;
		PhotoRow* _tmp17_ = NULL;
		guint64 _tmp18_ = 0ULL;
#line 4987 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = import_params;
#line 4987 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp17_ = _tmp16_->row;
#line 4987 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp18_ = _tmp17_->flags;
#line 4987 "/home/jens/Source/shotwell/src/Photo.vala"
		library_photo_upgrade_rating_flags (self, _tmp18_);
#line 38635 "Photo.c"
	}
#line 4976 "/home/jens/Source/shotwell/src/Photo.vala"
	return self;
#line 38639 "Photo.c"
}


static LibraryPhoto* library_photo_new_from_import_params (PhotoImportParams* import_params) {
#line 4976 "/home/jens/Source/shotwell/src/Photo.vala"
	return library_photo_construct_from_import_params (TYPE_LIBRARY_PHOTO, import_params);
#line 38646 "Photo.c"
}


void library_photo_init (ProgressMonitor monitor, void* monitor_target) {
	LibraryPhotoSourceCollection* _tmp0_ = NULL;
	GeeArrayList* all = NULL;
	PhotoTable* _tmp1_ = NULL;
	PhotoTable* _tmp2_ = NULL;
	GeeArrayList* _tmp3_ = NULL;
	GeeArrayList* _tmp4_ = NULL;
	GeeArrayList* all_photos = NULL;
	GeeArrayList* _tmp5_ = NULL;
	GeeArrayList* trashed_photos = NULL;
	GeeArrayList* _tmp6_ = NULL;
	GeeArrayList* offline_photos = NULL;
	GeeArrayList* _tmp7_ = NULL;
	gint count = 0;
	GeeArrayList* _tmp8_ = NULL;
	gint _tmp9_ = 0;
	gint _tmp10_ = 0;
	LibraryPhotoSourceCollection* _tmp34_ = NULL;
	GeeArrayList* _tmp35_ = NULL;
	GeeCollection* _tmp36_ = NULL;
	GeeCollection* _tmp37_ = NULL;
	LibraryPhotoSourceCollection* _tmp38_ = NULL;
	GeeArrayList* _tmp39_ = NULL;
	LibraryPhotoSourceCollection* _tmp40_ = NULL;
	GeeArrayList* _tmp41_ = NULL;
#line 4991 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_init_photo ();
#line 4993 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = library_photo_source_collection_new ();
#line 4993 "/home/jens/Source/shotwell/src/Photo.vala"
	_data_collection_unref0 (library_photo_global);
#line 4993 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_global = _tmp0_;
#line 4997 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = photo_table_get_instance ();
#line 4997 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = _tmp1_;
#line 4997 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = photo_table_get_all (_tmp2_);
#line 4997 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = _tmp3_;
#line 4997 "/home/jens/Source/shotwell/src/Photo.vala"
	_database_table_unref0 (_tmp2_);
#line 4997 "/home/jens/Source/shotwell/src/Photo.vala"
	all = _tmp4_;
#line 4998 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = gee_array_list_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
#line 4998 "/home/jens/Source/shotwell/src/Photo.vala"
	all_photos = _tmp5_;
#line 4999 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = gee_array_list_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
#line 4999 "/home/jens/Source/shotwell/src/Photo.vala"
	trashed_photos = _tmp6_;
#line 5000 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = gee_array_list_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
#line 5000 "/home/jens/Source/shotwell/src/Photo.vala"
	offline_photos = _tmp7_;
#line 5001 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = all;
#line 5001 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
#line 5001 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = _tmp9_;
#line 5001 "/home/jens/Source/shotwell/src/Photo.vala"
	count = _tmp10_;
#line 38715 "Photo.c"
	{
		gint ctr = 0;
#line 5002 "/home/jens/Source/shotwell/src/Photo.vala"
		ctr = 0;
#line 38720 "Photo.c"
		{
			gboolean _tmp11_ = FALSE;
#line 5002 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = TRUE;
#line 5002 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 38727 "Photo.c"
				gint _tmp13_ = 0;
				gint _tmp14_ = 0;
				PhotoRow* row = NULL;
				GeeArrayList* _tmp15_ = NULL;
				gint _tmp16_ = 0;
				gpointer _tmp17_ = NULL;
				LibraryPhoto* photo = NULL;
				PhotoRow* _tmp18_ = NULL;
				LibraryPhoto* _tmp19_ = NULL;
				guint64 flags = 0ULL;
				PhotoRow* _tmp20_ = NULL;
				guint64 _tmp21_ = 0ULL;
				guint64 _tmp22_ = 0ULL;
				ProgressMonitor _tmp30_ = NULL;
				void* _tmp30__target = NULL;
#line 5002 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp11_) {
#line 38745 "Photo.c"
					gint _tmp12_ = 0;
#line 5002 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp12_ = ctr;
#line 5002 "/home/jens/Source/shotwell/src/Photo.vala"
					ctr = _tmp12_ + 1;
#line 38751 "Photo.c"
				}
#line 5002 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = FALSE;
#line 5002 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = ctr;
#line 5002 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = count;
#line 5002 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!(_tmp13_ < _tmp14_)) {
#line 5002 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 38763 "Photo.c"
				}
#line 5003 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = all;
#line 5003 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = ctr;
#line 5003 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp17_ = gee_abstract_list_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), _tmp16_);
#line 5003 "/home/jens/Source/shotwell/src/Photo.vala"
				row = (PhotoRow*) _tmp17_;
#line 5004 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp18_ = row;
#line 5004 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp19_ = library_photo_new (_tmp18_);
#line 5004 "/home/jens/Source/shotwell/src/Photo.vala"
				photo = _tmp19_;
#line 5005 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp20_ = row;
#line 5005 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp21_ = _tmp20_->flags;
#line 5005 "/home/jens/Source/shotwell/src/Photo.vala"
				flags = _tmp21_;
#line 5007 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp22_ = flags;
#line 5007 "/home/jens/Source/shotwell/src/Photo.vala"
				if ((_tmp22_ & LIBRARY_PHOTO_FLAG_TRASH) != ((guint64) 0)) {
#line 38789 "Photo.c"
					GeeArrayList* _tmp23_ = NULL;
					LibraryPhoto* _tmp24_ = NULL;
#line 5008 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp23_ = trashed_photos;
#line 5008 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp24_ = photo;
#line 5008 "/home/jens/Source/shotwell/src/Photo.vala"
					gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp24_);
#line 38798 "Photo.c"
				} else {
					guint64 _tmp25_ = 0ULL;
#line 5009 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp25_ = flags;
#line 5009 "/home/jens/Source/shotwell/src/Photo.vala"
					if ((_tmp25_ & LIBRARY_PHOTO_FLAG_OFFLINE) != ((guint64) 0)) {
#line 38805 "Photo.c"
						GeeArrayList* _tmp26_ = NULL;
						LibraryPhoto* _tmp27_ = NULL;
#line 5010 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp26_ = offline_photos;
#line 5010 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp27_ = photo;
#line 5010 "/home/jens/Source/shotwell/src/Photo.vala"
						gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp27_);
#line 38814 "Photo.c"
					} else {
						GeeArrayList* _tmp28_ = NULL;
						LibraryPhoto* _tmp29_ = NULL;
#line 5012 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp28_ = all_photos;
#line 5012 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp29_ = photo;
#line 5012 "/home/jens/Source/shotwell/src/Photo.vala"
						gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp29_);
#line 38824 "Photo.c"
					}
				}
#line 5014 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp30_ = monitor;
#line 5014 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp30__target = monitor_target;
#line 5014 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp30_ != NULL) {
#line 38833 "Photo.c"
					ProgressMonitor _tmp31_ = NULL;
					void* _tmp31__target = NULL;
					gint _tmp32_ = 0;
					gint _tmp33_ = 0;
#line 5015 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp31_ = monitor;
#line 5015 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp31__target = monitor_target;
#line 5015 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp32_ = ctr;
#line 5015 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp33_ = count;
#line 5015 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp31_ ((guint64) _tmp32_, (guint64) _tmp33_, TRUE, _tmp31__target);
#line 38848 "Photo.c"
				}
#line 5002 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (photo);
#line 5002 "/home/jens/Source/shotwell/src/Photo.vala"
				_photo_row_unref0 (row);
#line 38854 "Photo.c"
			}
		}
	}
#line 5018 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp34_ = library_photo_global;
#line 5018 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp35_ = all_photos;
#line 5018 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp36_ = data_collection_add_many (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, TYPE_DATA_COLLECTION, DataCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp35_, GEE_TYPE_COLLECTION, GeeCollection), NULL, NULL);
#line 5018 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp37_ = _tmp36_;
#line 5018 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp37_);
#line 5019 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp38_ = library_photo_global;
#line 5019 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp39_ = trashed_photos;
#line 5019 "/home/jens/Source/shotwell/src/Photo.vala"
	media_source_collection_add_many_to_trash (G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, GEE_TYPE_COLLECTION, GeeCollection));
#line 5020 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp40_ = library_photo_global;
#line 5020 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp41_ = offline_photos;
#line 5020 "/home/jens/Source/shotwell/src/Photo.vala"
	media_source_collection_add_many_to_offline (G_TYPE_CHECK_INSTANCE_CAST (_tmp40_, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, GEE_TYPE_COLLECTION, GeeCollection));
#line 4990 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (offline_photos);
#line 4990 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (trashed_photos);
#line 4990 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (all_photos);
#line 4990 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (all);
#line 38888 "Photo.c"
}


void library_photo_terminate (void) {
#line 5024 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_terminate_photo ();
#line 38895 "Photo.c"
}


ImportResult library_photo_import_create (PhotoImportParams* params, LibraryPhoto** photo) {
	LibraryPhoto* _vala_photo = NULL;
	ImportResult result = 0;
	PhotoID photo_id = {0};
	PhotoTable* _tmp0_ = NULL;
	PhotoTable* _tmp1_ = NULL;
	PhotoImportParams* _tmp2_ = NULL;
	PhotoRow* _tmp3_ = NULL;
	PhotoID _tmp4_ = {0};
	PhotoID _tmp5_ = {0};
	gboolean _tmp6_ = FALSE;
	PhotoImportParams* _tmp7_ = NULL;
	LibraryPhoto* _tmp8_ = NULL;
#line 5031 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_PHOTO_IMPORT_PARAMS (params), 0);
#line 5033 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_table_get_instance ();
#line 5033 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 5033 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = params;
#line 5033 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp2_->row;
#line 5033 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_table_add (_tmp1_, _tmp3_, &_tmp4_);
#line 5033 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = _tmp4_;
#line 5033 "/home/jens/Source/shotwell/src/Photo.vala"
	_database_table_unref0 (_tmp1_);
#line 5033 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_id = _tmp5_;
#line 5034 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = photo_id_is_invalid (&photo_id);
#line 5034 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp6_) {
#line 5035 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_vala_photo);
#line 5035 "/home/jens/Source/shotwell/src/Photo.vala"
		_vala_photo = NULL;
#line 5037 "/home/jens/Source/shotwell/src/Photo.vala"
		result = IMPORT_RESULT_DATABASE_ERROR;
#line 5037 "/home/jens/Source/shotwell/src/Photo.vala"
		if (photo) {
#line 5037 "/home/jens/Source/shotwell/src/Photo.vala"
			*photo = _vala_photo;
#line 38944 "Photo.c"
		} else {
#line 5037 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_vala_photo);
#line 38948 "Photo.c"
		}
#line 5037 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 38952 "Photo.c"
	}
#line 5041 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = params;
#line 5041 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = library_photo_new_from_import_params (_tmp7_);
#line 5041 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_vala_photo);
#line 5041 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_photo = _tmp8_;
#line 5043 "/home/jens/Source/shotwell/src/Photo.vala"
	result = IMPORT_RESULT_SUCCESS;
#line 5043 "/home/jens/Source/shotwell/src/Photo.vala"
	if (photo) {
#line 5043 "/home/jens/Source/shotwell/src/Photo.vala"
		*photo = _vala_photo;
#line 38968 "Photo.c"
	} else {
#line 5043 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_vala_photo);
#line 38972 "Photo.c"
	}
#line 5043 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 38976 "Photo.c"
}


void library_photo_import_failed (LibraryPhoto* photo) {
	GError * _inner_error_ = NULL;
#line 5046 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO (photo));
#line 38984 "Photo.c"
	{
		PhotoTable* _tmp0_ = NULL;
		PhotoTable* _tmp1_ = NULL;
		LibraryPhoto* _tmp2_ = NULL;
		PhotoID _tmp3_ = {0};
#line 5048 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = photo_table_get_instance ();
#line 5048 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = _tmp0_;
#line 5048 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = photo;
#line 5048 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_get_photo_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_PHOTO, Photo), &_tmp3_);
#line 5048 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_table_remove (_tmp1_, &_tmp3_, &_inner_error_);
#line 5048 "/home/jens/Source/shotwell/src/Photo.vala"
		_database_table_unref0 (_tmp1_);
#line 5048 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5048 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_inner_error_->domain == DATABASE_ERROR) {
#line 39006 "Photo.c"
				goto __catch409_database_error;
			}
#line 5048 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 5048 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 5048 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 39015 "Photo.c"
		}
	}
	goto __finally409;
	__catch409_database_error:
	{
		GError* err = NULL;
		GError* _tmp4_ = NULL;
#line 5047 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 5047 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 5050 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = err;
#line 5050 "/home/jens/Source/shotwell/src/Photo.vala"
		app_window_database_error (_tmp4_);
#line 5047 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 39033 "Photo.c"
	}
	__finally409:
#line 5047 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5047 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 5047 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 5047 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 39044 "Photo.c"
	}
}


static void library_photo_real_notify_master_reimported (Photo* base, PhotoMetadata* metadata) {
	LibraryPhoto * self;
	PhotoMetadata* _tmp0_ = NULL;
	LibraryPhotoSourceCollection* _tmp1_ = NULL;
	PhotoMetadata* _tmp2_ = NULL;
#line 5054 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5054 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 5055 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = metadata;
#line 5055 "/home/jens/Source/shotwell/src/Photo.vala"
	PHOTO_CLASS (library_photo_parent_class)->notify_master_reimported (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), _tmp0_);
#line 5057 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = library_photo_global;
#line 5057 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = metadata;
#line 5057 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_source_collection_notify_master_reimported (_tmp1_, self, _tmp2_);
#line 39068 "Photo.c"
}


static void library_photo_real_notify_editable_reimported (Photo* base, PhotoMetadata* metadata) {
	LibraryPhoto * self;
	PhotoMetadata* _tmp0_ = NULL;
	LibraryPhotoSourceCollection* _tmp1_ = NULL;
	PhotoMetadata* _tmp2_ = NULL;
#line 5060 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5060 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 5061 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = metadata;
#line 5061 "/home/jens/Source/shotwell/src/Photo.vala"
	PHOTO_CLASS (library_photo_parent_class)->notify_editable_reimported (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), _tmp0_);
#line 5063 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = library_photo_global;
#line 5063 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = metadata;
#line 5063 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_source_collection_notify_editable_reimported (_tmp1_, self, _tmp2_);
#line 39091 "Photo.c"
}


static void library_photo_real_notify_source_reimported (Photo* base, PhotoMetadata* metadata) {
	LibraryPhoto * self;
	PhotoMetadata* _tmp0_ = NULL;
	LibraryPhotoSourceCollection* _tmp1_ = NULL;
	PhotoMetadata* _tmp2_ = NULL;
#line 5066 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5066 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 5067 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = metadata;
#line 5067 "/home/jens/Source/shotwell/src/Photo.vala"
	PHOTO_CLASS (library_photo_parent_class)->notify_source_reimported (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), _tmp0_);
#line 5069 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = library_photo_global;
#line 5069 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = metadata;
#line 5069 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_source_collection_notify_source_reimported (_tmp1_, self, _tmp2_);
#line 39114 "Photo.c"
}


static void library_photo_real_notify_baseline_reimported (Photo* base, PhotoMetadata* metadata) {
	LibraryPhoto * self;
	PhotoMetadata* _tmp0_ = NULL;
	LibraryPhotoSourceCollection* _tmp1_ = NULL;
	PhotoMetadata* _tmp2_ = NULL;
#line 5072 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5072 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
#line 5073 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = metadata;
#line 5073 "/home/jens/Source/shotwell/src/Photo.vala"
	PHOTO_CLASS (library_photo_parent_class)->notify_baseline_reimported (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), _tmp0_);
#line 5075 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = library_photo_global;
#line 5075 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = metadata;
#line 5075 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_source_collection_notify_baseline_reimported (_tmp1_, self, _tmp2_);
#line 39137 "Photo.c"
}


static void library_photo_generate_thumbnails (LibraryPhoto* self) {
	GError * _inner_error_ = NULL;
#line 5078 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO (self));
#line 39145 "Photo.c"
	{
#line 5080 "/home/jens/Source/shotwell/src/Photo.vala"
		thumbnail_cache_import_from_source (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_THUMBNAIL_SOURCE, ThumbnailSource), TRUE, &_inner_error_);
#line 5080 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 39151 "Photo.c"
			goto __catch410_g_error;
		}
	}
	goto __finally410;
	__catch410_g_error:
	{
		GError* err = NULL;
		gchar* _tmp0_ = NULL;
		gchar* _tmp1_ = NULL;
		GError* _tmp2_ = NULL;
		const gchar* _tmp3_ = NULL;
#line 5079 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 5079 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 5082 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 5082 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = _tmp0_;
#line 5082 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = err;
#line 5082 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = _tmp2_->message;
#line 5082 "/home/jens/Source/shotwell/src/Photo.vala"
		g_warning ("Photo.vala:5082: Unable to generate thumbnails for %s: %s", _tmp1_, _tmp3_);
#line 5082 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp1_);
#line 5079 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 39181 "Photo.c"
	}
	__finally410:
#line 5079 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5079 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 5079 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 5079 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 39192 "Photo.c"
	}
#line 5086 "/home/jens/Source/shotwell/src/Photo.vala"
	thumbnail_source_notify_thumbnail_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_THUMBNAIL_SOURCE, ThumbnailSource));
#line 39196 "Photo.c"
}


GeeCollection* library_photo_get_import_keywords (LibraryPhoto* self) {
	GeeCollection* result = NULL;
	GeeCollection* _tmp0_ = NULL;
	GeeCollection* _tmp1_ = NULL;
#line 5090 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_LIBRARY_PHOTO (self), NULL);
#line 5091 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = self->priv->import_keywords;
#line 5091 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 5091 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp1_;
#line 5091 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 39214 "Photo.c"
}


void library_photo_clear_import_keywords (LibraryPhoto* self) {
#line 5094 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO (self));
#line 5095 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->import_keywords);
#line 5095 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->import_keywords = NULL;
#line 39225 "Photo.c"
}


static void library_photo_real_notify_altered (DataObject* base, Alteration* alteration) {
	LibraryPhoto * self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	Alteration* _tmp5_ = NULL;
#line 5098 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5098 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_ALTERATION (alteration));
#line 5100 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = self->priv->block_thumbnail_generation;
#line 5100 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp1_) {
#line 39242 "Photo.c"
		Alteration* _tmp2_ = NULL;
		gboolean _tmp3_ = FALSE;
#line 5100 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = alteration;
#line 5100 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = alteration_has_subject (_tmp2_, "image");
#line 5100 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = _tmp3_;
#line 39251 "Photo.c"
	} else {
#line 5100 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = FALSE;
#line 39255 "Photo.c"
	}
#line 5100 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp0_) {
#line 39259 "Photo.c"
		OneShotScheduler* _tmp4_ = NULL;
#line 5101 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = self->priv->thumbnail_scheduler;
#line 5101 "/home/jens/Source/shotwell/src/Photo.vala"
		one_shot_scheduler_at_priority_idle (_tmp4_, G_PRIORITY_LOW);
#line 39265 "Photo.c"
	}
#line 5103 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = alteration;
#line 5103 "/home/jens/Source/shotwell/src/Photo.vala"
	DATA_OBJECT_CLASS (library_photo_parent_class)->notify_altered (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), TYPE_DATA_OBJECT, DataObject), _tmp5_);
#line 39271 "Photo.c"
}


static GdkPixbuf* library_photo_real_get_preview_pixbuf (MediaSource* base, Scaling* scaling, GError** error) {
	LibraryPhoto * self;
	GdkPixbuf* result = NULL;
	GdkPixbuf* pixbuf = NULL;
	GdkPixbuf* _tmp0_ = NULL;
	GdkPixbuf* _tmp1_ = NULL;
	GError * _inner_error_ = NULL;
#line 5106 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5106 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (scaling != NULL, NULL);
#line 5107 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = thumbnail_source_get_thumbnail (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_THUMBNAIL_SOURCE, ThumbnailSource), (gint) THUMBNAIL_CACHE_SIZE_BIG, &_inner_error_);
#line 5107 "/home/jens/Source/shotwell/src/Photo.vala"
	pixbuf = _tmp0_;
#line 5107 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5107 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 5107 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 39296 "Photo.c"
	}
#line 5109 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = scaling_perform_on_pixbuf (scaling, pixbuf, GDK_INTERP_BILINEAR, TRUE);
#line 5109 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp1_;
#line 5109 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (pixbuf);
#line 5109 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 39306 "Photo.c"
}


static void library_photo_real_rotate (Photo* base, Rotation rotation) {
	LibraryPhoto * self;
	Rotation _tmp0_ = 0;
	GError * _inner_error_ = NULL;
#line 5112 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5114 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->block_thumbnail_generation = TRUE;
#line 5115 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = rotation;
#line 5115 "/home/jens/Source/shotwell/src/Photo.vala"
	PHOTO_CLASS (library_photo_parent_class)->rotate (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), _tmp0_);
#line 5116 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->block_thumbnail_generation = FALSE;
#line 39324 "Photo.c"
	{
		Rotation _tmp1_ = 0;
#line 5124 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = rotation;
#line 5124 "/home/jens/Source/shotwell/src/Photo.vala"
		thumbnail_cache_rotate (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_THUMBNAIL_SOURCE, ThumbnailSource), _tmp1_, &_inner_error_);
#line 5124 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 39333 "Photo.c"
			goto __catch411_g_error;
		}
	}
	goto __finally411;
	__catch411_g_error:
	{
		GError* err = NULL;
		gchar* _tmp2_ = NULL;
		gchar* _tmp3_ = NULL;
		GError* _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
#line 5123 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 5123 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 5127 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
#line 5127 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = _tmp2_;
#line 5127 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = err;
#line 5127 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = _tmp4_->message;
#line 5127 "/home/jens/Source/shotwell/src/Photo.vala"
		g_warning ("Photo.vala:5127: Unable to update thumbnails for %s: %s", _tmp3_, _tmp5_);
#line 5127 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_free0 (_tmp3_);
#line 5123 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 39363 "Photo.c"
	}
	__finally411:
#line 5123 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5123 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 5123 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 5123 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 39374 "Photo.c"
	}
#line 5130 "/home/jens/Source/shotwell/src/Photo.vala"
	thumbnail_source_notify_thumbnail_altered (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_THUMBNAIL_SOURCE, ThumbnailSource));
#line 39378 "Photo.c"
}


static GdkPixbuf* library_photo_real_get_thumbnail (ThumbnailSource* base, gint scale, GError** error) {
	LibraryPhoto * self;
	GdkPixbuf* result = NULL;
	GdkPixbuf* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	GdkPixbuf* _tmp2_ = NULL;
	GdkPixbuf* _tmp3_ = NULL;
	GError * _inner_error_ = NULL;
#line 5134 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5135 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = scale;
#line 5135 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = thumbnail_cache_fetch (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_THUMBNAIL_SOURCE, ThumbnailSource), _tmp1_, &_inner_error_);
#line 5135 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = _tmp2_;
#line 5135 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5135 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 5135 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 39404 "Photo.c"
	}
#line 5135 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp0_;
#line 5135 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = NULL;
#line 5135 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp3_;
#line 5135 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp0_);
#line 5135 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 39416 "Photo.c"
}


static void _library_photo_on_duplicate_progress_gfile_progress_callback (gint64 current_num_bytes, gint64 total_num_bytes, gpointer self) {
#line 5147 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_on_duplicate_progress ((LibraryPhoto*) self, current_num_bytes, total_num_bytes);
#line 39423 "Photo.c"
}


static void library_photo_duplicate_backing_photo (LibraryPhoto* self, BackingPhotoRow* backing, BackingPhotoID* result, GError** error) {
	BackingPhotoID backing_id = {0};
	gboolean _tmp0_ = FALSE;
	BackingPhotoRow* _tmp1_ = NULL;
	GFile* file = NULL;
	BackingPhotoRow* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	GFile* _tmp6_ = NULL;
	GFile* _tmp7_ = NULL;
	gboolean _tmp8_ = FALSE;
	GError * _inner_error_ = NULL;
#line 5140 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO (self));
#line 5140 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((backing == NULL) || IS_BACKING_PHOTO_ROW (backing));
#line 5141 "/home/jens/Source/shotwell/src/Photo.vala"
	backing_photo_id_init (&backing_id, BACKING_PHOTO_ID_INVALID);
#line 5142 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = backing;
#line 5142 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_ == NULL) {
#line 5142 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = TRUE;
#line 39450 "Photo.c"
	} else {
		BackingPhotoRow* _tmp2_ = NULL;
		const gchar* _tmp3_ = NULL;
#line 5142 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = backing;
#line 5142 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = _tmp2_->filepath;
#line 5142 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp0_ = _tmp3_ == NULL;
#line 39460 "Photo.c"
	}
#line 5142 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp0_) {
#line 5143 "/home/jens/Source/shotwell/src/Photo.vala"
		*result = backing_id;
#line 5143 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 39468 "Photo.c"
	}
#line 5145 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = backing;
#line 5145 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = _tmp4_->filepath;
#line 5145 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = g_file_new_for_path (_tmp5_);
#line 5145 "/home/jens/Source/shotwell/src/Photo.vala"
	file = _tmp6_;
#line 5146 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = file;
#line 5146 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = g_file_query_exists (_tmp7_, NULL);
#line 5146 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp8_) {
#line 39484 "Photo.c"
		GFile* dupe_file = NULL;
		GFile* _tmp9_ = NULL;
		GFile* _tmp10_ = NULL;
		DetectedPhotoInformation* detected = NULL;
		BackingPhotoRow* state = NULL;
		GFile* _tmp11_ = NULL;
		DetectedPhotoInformation* _tmp12_ = NULL;
		BackingPhotoRow* _tmp13_ = NULL;
		BackingPhotoRow* _tmp14_ = NULL;
#line 5147 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp9_ = file;
#line 5147 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp10_ = library_files_duplicate (_tmp9_, _library_photo_on_duplicate_progress_gfile_progress_callback, self, TRUE, &_inner_error_);
#line 5147 "/home/jens/Source/shotwell/src/Photo.vala"
		dupe_file = _tmp10_;
#line 5147 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5147 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 5147 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (file);
#line 5147 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 39508 "Photo.c"
		}
#line 5150 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = dupe_file;
#line 5150 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp13_ = photo_query_backing_photo_row (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), _tmp11_, PHOTO_FILE_SNIFFER_OPTIONS_NO_MD5, &_tmp12_, &_inner_error_);
#line 5150 "/home/jens/Source/shotwell/src/Photo.vala"
		_detected_photo_information_unref0 (detected);
#line 5150 "/home/jens/Source/shotwell/src/Photo.vala"
		detected = _tmp12_;
#line 5150 "/home/jens/Source/shotwell/src/Photo.vala"
		state = _tmp13_;
#line 5150 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5150 "/home/jens/Source/shotwell/src/Photo.vala"
			g_propagate_error (error, _inner_error_);
#line 5150 "/home/jens/Source/shotwell/src/Photo.vala"
			_detected_photo_information_unref0 (detected);
#line 5150 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (dupe_file);
#line 5150 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (file);
#line 5150 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 39532 "Photo.c"
		}
#line 5152 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp14_ = state;
#line 5152 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp14_ != NULL) {
#line 39538 "Photo.c"
			BackingPhotoTable* _tmp15_ = NULL;
			BackingPhotoTable* _tmp16_ = NULL;
			BackingPhotoRow* _tmp17_ = NULL;
			BackingPhotoRow* _tmp18_ = NULL;
			BackingPhotoID _tmp19_ = {0};
#line 5153 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp15_ = backing_photo_table_get_instance ();
#line 5153 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp16_ = _tmp15_;
#line 5153 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp17_ = state;
#line 5153 "/home/jens/Source/shotwell/src/Photo.vala"
			backing_photo_table_add (_tmp16_, _tmp17_, &_inner_error_);
#line 5153 "/home/jens/Source/shotwell/src/Photo.vala"
			_database_table_unref0 (_tmp16_);
#line 5153 "/home/jens/Source/shotwell/src/Photo.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5153 "/home/jens/Source/shotwell/src/Photo.vala"
				g_propagate_error (error, _inner_error_);
#line 5153 "/home/jens/Source/shotwell/src/Photo.vala"
				_backing_photo_row_unref0 (state);
#line 5153 "/home/jens/Source/shotwell/src/Photo.vala"
				_detected_photo_information_unref0 (detected);
#line 5153 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (dupe_file);
#line 5153 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (file);
#line 5153 "/home/jens/Source/shotwell/src/Photo.vala"
				return;
#line 39568 "Photo.c"
			}
#line 5154 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp18_ = state;
#line 5154 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp19_ = _tmp18_->id;
#line 5154 "/home/jens/Source/shotwell/src/Photo.vala"
			backing_id = _tmp19_;
#line 39576 "Photo.c"
		}
#line 5146 "/home/jens/Source/shotwell/src/Photo.vala"
		_backing_photo_row_unref0 (state);
#line 5146 "/home/jens/Source/shotwell/src/Photo.vala"
		_detected_photo_information_unref0 (detected);
#line 5146 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (dupe_file);
#line 39584 "Photo.c"
	}
#line 5158 "/home/jens/Source/shotwell/src/Photo.vala"
	*result = backing_id;
#line 5158 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (file);
#line 5158 "/home/jens/Source/shotwell/src/Photo.vala"
	return;
#line 39592 "Photo.c"
}


LibraryPhoto* library_photo_duplicate (LibraryPhoto* self, GError** error) {
	LibraryPhoto* result = NULL;
	GFile* dupe_file = NULL;
	GFile* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	GFile* _tmp3_ = NULL;
	BackingPhotoID dupe_editable_id = {0};
	BackingPhotoRow* _tmp4_ = NULL;
	BackingPhotoRow* _tmp5_ = NULL;
	BackingPhotoID _tmp6_ = {0};
	BackingPhotoID _tmp7_ = {0};
	BackingPhotoID dupe_raw_shotwell_id = {0};
	BackingPhotoRow* _tmp8_ = NULL;
	BackingPhotoRow* _tmp9_ = NULL;
	BackingPhotoID _tmp10_ = {0};
	BackingPhotoID _tmp11_ = {0};
	BackingPhotoID dupe_raw_camera_id = {0};
	BackingPhotoRow* _tmp12_ = NULL;
	BackingPhotoRow* _tmp13_ = NULL;
	BackingPhotoID _tmp14_ = {0};
	BackingPhotoID _tmp15_ = {0};
	BackingPhotoID dupe_raw_embedded_id = {0};
	BackingPhotoRow* _tmp16_ = NULL;
	BackingPhotoRow* _tmp17_ = NULL;
	BackingPhotoID _tmp18_ = {0};
	BackingPhotoID _tmp19_ = {0};
	PhotoID dupe_id = {0};
	PhotoTable* _tmp20_ = NULL;
	PhotoTable* _tmp21_ = NULL;
	PhotoID _tmp22_ = {0};
	GFile* _tmp23_ = NULL;
	gchar* _tmp24_ = NULL;
	gchar* _tmp25_ = NULL;
	BackingPhotoID _tmp26_ = {0};
	BackingPhotoID _tmp27_ = {0};
	BackingPhotoID _tmp28_ = {0};
	BackingPhotoID _tmp29_ = {0};
	PhotoID _tmp30_ = {0};
	PhotoID _tmp31_ = {0};
	PhotoRow* dupe_row = NULL;
	PhotoTable* _tmp32_ = NULL;
	PhotoTable* _tmp33_ = NULL;
	PhotoID _tmp34_ = {0};
	PhotoRow* _tmp35_ = NULL;
	PhotoRow* _tmp36_ = NULL;
	LibraryPhoto* dupe = NULL;
	PhotoRow* _tmp37_ = NULL;
	LibraryPhoto* _tmp38_ = NULL;
	LibraryPhoto* _tmp39_ = NULL;
	LibraryPhotoSourceCollection* _tmp40_ = NULL;
	LibraryPhoto* _tmp41_ = NULL;
	LibraryPhoto* _tmp42_ = NULL;
	Event* _tmp43_ = NULL;
	Event* _tmp44_ = NULL;
	gboolean _tmp45_ = FALSE;
	GeeCollection* tags = NULL;
	TagSourceCollection* _tmp50_ = NULL;
	GeeList* _tmp51_ = NULL;
	GeeCollection* _tmp52_ = NULL;
	GError * _inner_error_ = NULL;
#line 5161 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_LIBRARY_PHOTO (self), NULL);
#line 5163 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = media_source_get_master_file (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 5163 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 5163 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = library_files_duplicate (_tmp1_, _library_photo_on_duplicate_progress_gfile_progress_callback, self, TRUE, &_inner_error_);
#line 5163 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = _tmp2_;
#line 5163 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp1_);
#line 5163 "/home/jens/Source/shotwell/src/Photo.vala"
	dupe_file = _tmp3_;
#line 5163 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5163 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 5163 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 39677 "Photo.c"
	}
#line 5166 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = photo_get_editable_photo_row (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo));
#line 5166 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = _tmp4_;
#line 5166 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_duplicate_backing_photo (self, _tmp5_, &_tmp6_, &_inner_error_);
#line 5166 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = _tmp6_;
#line 5166 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (_tmp5_);
#line 5166 "/home/jens/Source/shotwell/src/Photo.vala"
	dupe_editable_id = _tmp7_;
#line 5166 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5166 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 5166 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (dupe_file);
#line 5166 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 39699 "Photo.c"
	}
#line 5167 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = photo_get_raw_development_photo_row (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), RAW_DEVELOPER_SHOTWELL);
#line 5167 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = _tmp8_;
#line 5167 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_duplicate_backing_photo (self, _tmp9_, &_tmp10_, &_inner_error_);
#line 5167 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = _tmp10_;
#line 5167 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (_tmp9_);
#line 5167 "/home/jens/Source/shotwell/src/Photo.vala"
	dupe_raw_shotwell_id = _tmp11_;
#line 5167 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5167 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 5167 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (dupe_file);
#line 5167 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 39721 "Photo.c"
	}
#line 5169 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = photo_get_raw_development_photo_row (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), RAW_DEVELOPER_CAMERA);
#line 5169 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = _tmp12_;
#line 5169 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_duplicate_backing_photo (self, _tmp13_, &_tmp14_, &_inner_error_);
#line 5169 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = _tmp14_;
#line 5169 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (_tmp13_);
#line 5169 "/home/jens/Source/shotwell/src/Photo.vala"
	dupe_raw_camera_id = _tmp15_;
#line 5169 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5169 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 5169 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (dupe_file);
#line 5169 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 39743 "Photo.c"
	}
#line 5171 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp16_ = photo_get_raw_development_photo_row (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), RAW_DEVELOPER_EMBEDDED);
#line 5171 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = _tmp16_;
#line 5171 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_duplicate_backing_photo (self, _tmp17_, &_tmp18_, &_inner_error_);
#line 5171 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp19_ = _tmp18_;
#line 5171 "/home/jens/Source/shotwell/src/Photo.vala"
	_backing_photo_row_unref0 (_tmp17_);
#line 5171 "/home/jens/Source/shotwell/src/Photo.vala"
	dupe_raw_embedded_id = _tmp19_;
#line 5171 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5171 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 5171 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (dupe_file);
#line 5171 "/home/jens/Source/shotwell/src/Photo.vala"
		return NULL;
#line 39765 "Photo.c"
	}
#line 5175 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp20_ = photo_table_get_instance ();
#line 5175 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp21_ = _tmp20_;
#line 5175 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_get_photo_id (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), &_tmp22_);
#line 5175 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp23_ = dupe_file;
#line 5175 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp24_ = g_file_get_path (_tmp23_);
#line 5175 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp25_ = _tmp24_;
#line 5175 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp26_ = dupe_editable_id;
#line 5175 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp27_ = dupe_raw_shotwell_id;
#line 5175 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp28_ = dupe_raw_camera_id;
#line 5175 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp29_ = dupe_raw_embedded_id;
#line 5175 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_table_duplicate (_tmp21_, &_tmp22_, _tmp25_, &_tmp26_, &_tmp27_, &_tmp28_, &_tmp29_, &_tmp30_);
#line 5175 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp31_ = _tmp30_;
#line 5175 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_free0 (_tmp25_);
#line 5175 "/home/jens/Source/shotwell/src/Photo.vala"
	_database_table_unref0 (_tmp21_);
#line 5175 "/home/jens/Source/shotwell/src/Photo.vala"
	dupe_id = _tmp31_;
#line 5177 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp32_ = photo_table_get_instance ();
#line 5177 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp33_ = _tmp32_;
#line 5177 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp34_ = dupe_id;
#line 5177 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp35_ = photo_table_get_row (_tmp33_, &_tmp34_);
#line 5177 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp36_ = _tmp35_;
#line 5177 "/home/jens/Source/shotwell/src/Photo.vala"
	_database_table_unref0 (_tmp33_);
#line 5177 "/home/jens/Source/shotwell/src/Photo.vala"
	dupe_row = _tmp36_;
#line 5180 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp37_ = dupe_row;
#line 5180 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp38_ = library_photo_new (_tmp37_);
#line 5180 "/home/jens/Source/shotwell/src/Photo.vala"
	dupe = _tmp38_;
#line 5183 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp39_ = dupe;
#line 5183 "/home/jens/Source/shotwell/src/Photo.vala"
	thumbnail_cache_duplicate (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_THUMBNAIL_SOURCE, ThumbnailSource), G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, TYPE_THUMBNAIL_SOURCE, ThumbnailSource));
#line 5186 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp40_ = library_photo_global;
#line 5186 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp41_ = dupe;
#line 5186 "/home/jens/Source/shotwell/src/Photo.vala"
	data_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp40_, TYPE_DATA_COLLECTION, DataCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, TYPE_DATA_OBJECT, DataObject));
#line 5189 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp42_ = dupe;
#line 5189 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp43_ = media_source_get_event (G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, TYPE_MEDIA_SOURCE, MediaSource));
#line 5189 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp44_ = _tmp43_;
#line 5189 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp45_ = _tmp44_ != NULL;
#line 5189 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (_tmp44_);
#line 5189 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp45_) {
#line 39839 "Photo.c"
		LibraryPhoto* _tmp46_ = NULL;
		Event* _tmp47_ = NULL;
		Event* _tmp48_ = NULL;
		LibraryPhoto* _tmp49_ = NULL;
#line 5190 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp46_ = dupe;
#line 5190 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp47_ = media_source_get_event (G_TYPE_CHECK_INSTANCE_CAST (_tmp46_, TYPE_MEDIA_SOURCE, MediaSource));
#line 5190 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp48_ = _tmp47_;
#line 5190 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp49_ = dupe;
#line 5190 "/home/jens/Source/shotwell/src/Photo.vala"
		event_attach (_tmp48_, G_TYPE_CHECK_INSTANCE_CAST (_tmp49_, TYPE_MEDIA_SOURCE, MediaSource));
#line 5190 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp48_);
#line 39856 "Photo.c"
	}
#line 5193 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp50_ = tag_global;
#line 5193 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp51_ = tag_source_collection_fetch_for_source (_tmp50_, G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 5193 "/home/jens/Source/shotwell/src/Photo.vala"
	tags = G_TYPE_CHECK_INSTANCE_CAST (_tmp51_, GEE_TYPE_COLLECTION, GeeCollection);
#line 5194 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp52_ = tags;
#line 5194 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp52_ != NULL) {
#line 39868 "Photo.c"
		{
			GeeIterator* _tag_it = NULL;
			GeeCollection* _tmp53_ = NULL;
			GeeIterator* _tmp54_ = NULL;
#line 5195 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp53_ = tags;
#line 5195 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp54_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, GEE_TYPE_ITERABLE, GeeIterable));
#line 5195 "/home/jens/Source/shotwell/src/Photo.vala"
			_tag_it = _tmp54_;
#line 5195 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 39881 "Photo.c"
				GeeIterator* _tmp55_ = NULL;
				gboolean _tmp56_ = FALSE;
				Tag* tag = NULL;
				GeeIterator* _tmp57_ = NULL;
				gpointer _tmp58_ = NULL;
				Tag* _tmp59_ = NULL;
				LibraryPhoto* _tmp60_ = NULL;
#line 5195 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp55_ = _tag_it;
#line 5195 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp56_ = gee_iterator_next (_tmp55_);
#line 5195 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp56_) {
#line 5195 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 39897 "Photo.c"
				}
#line 5195 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp57_ = _tag_it;
#line 5195 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp58_ = gee_iterator_get (_tmp57_);
#line 5195 "/home/jens/Source/shotwell/src/Photo.vala"
				tag = (Tag*) _tmp58_;
#line 5196 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp59_ = tag;
#line 5196 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp60_ = dupe;
#line 5196 "/home/jens/Source/shotwell/src/Photo.vala"
				tag_attach (_tmp59_, G_TYPE_CHECK_INSTANCE_CAST (_tmp60_, TYPE_MEDIA_SOURCE, MediaSource));
#line 5195 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (tag);
#line 39913 "Photo.c"
			}
#line 5195 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tag_it);
#line 39917 "Photo.c"
		}
	}
#line 5200 "/home/jens/Source/shotwell/src/Photo.vala"
	result = dupe;
#line 5200 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (tags);
#line 5200 "/home/jens/Source/shotwell/src/Photo.vala"
	_photo_row_unref0 (dupe_row);
#line 5200 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (dupe_file);
#line 5200 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 39930 "Photo.c"
}


static void library_photo_on_duplicate_progress (LibraryPhoto* self, gint64 current, gint64 total) {
#line 5203 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO (self));
#line 5204 "/home/jens/Source/shotwell/src/Photo.vala"
	spin_event_loop ();
#line 39939 "Photo.c"
}


static void library_photo_upgrade_rating_flags (LibraryPhoto* self, guint64 flags) {
	guint64 _tmp0_ = 0ULL;
	guint64 _tmp1_ = 0ULL;
#line 5207 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO (self));
#line 5208 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = flags;
#line 5208 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((_tmp0_ & LIBRARY_PHOTO_FLAG_HIDDEN) != ((guint64) 0)) {
#line 5209 "/home/jens/Source/shotwell/src/Photo.vala"
		media_source_set_rating (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), RATING_REJECTED);
#line 5210 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_remove_flags (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), LIBRARY_PHOTO_FLAG_HIDDEN, NULL);
#line 39956 "Photo.c"
	}
#line 5213 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = flags;
#line 5213 "/home/jens/Source/shotwell/src/Photo.vala"
	if ((_tmp1_ & LIBRARY_PHOTO_FLAG_FAVORITE) != ((guint64) 0)) {
#line 5214 "/home/jens/Source/shotwell/src/Photo.vala"
		media_source_set_rating (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource), RATING_FIVE);
#line 5215 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_remove_flags (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), LIBRARY_PHOTO_FLAG_FAVORITE, NULL);
#line 39966 "Photo.c"
	}
}


static gboolean library_photo_real_is_trashed (MediaSource* base) {
	LibraryPhoto * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
#line 5220 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5221 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_is_flag_set (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), LIBRARY_PHOTO_FLAG_TRASH);
#line 5221 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 5221 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 39983 "Photo.c"
}


static void library_photo_real_trash (MediaSource* base) {
	LibraryPhoto * self;
#line 5224 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5225 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_add_flags (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), LIBRARY_PHOTO_FLAG_TRASH, NULL);
#line 39993 "Photo.c"
}


static void library_photo_real_untrash (MediaSource* base) {
	LibraryPhoto * self;
#line 5228 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5229 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_remove_flags (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), LIBRARY_PHOTO_FLAG_TRASH, NULL);
#line 40003 "Photo.c"
}


static gboolean library_photo_real_is_offline (Monitorable* base) {
	LibraryPhoto * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
#line 5232 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5233 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_is_flag_set (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), LIBRARY_PHOTO_FLAG_OFFLINE);
#line 5233 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 5233 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 40019 "Photo.c"
}


static void library_photo_real_mark_offline (Monitorable* base) {
	LibraryPhoto * self;
#line 5236 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5237 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_add_flags (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), LIBRARY_PHOTO_FLAG_OFFLINE, NULL);
#line 40029 "Photo.c"
}


static void library_photo_real_mark_online (Monitorable* base) {
	LibraryPhoto * self;
#line 5240 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5241 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_remove_flags (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), LIBRARY_PHOTO_FLAG_OFFLINE, NULL);
#line 40039 "Photo.c"
}


static gboolean library_photo_real_is_flagged (Flaggable* base) {
	LibraryPhoto * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
#line 5244 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5245 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = photo_is_flag_set (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), LIBRARY_PHOTO_FLAG_FLAGGED);
#line 5245 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp0_;
#line 5245 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 40055 "Photo.c"
}


static void library_photo_real_mark_flagged (Flaggable* base) {
	LibraryPhoto * self;
	Alteration* _tmp0_ = NULL;
	Alteration* _tmp1_ = NULL;
#line 5248 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5249 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = alteration_new ("metadata", "flagged");
#line 5249 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 5249 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_add_flags (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), LIBRARY_PHOTO_FLAG_FLAGGED, _tmp1_);
#line 5249 "/home/jens/Source/shotwell/src/Photo.vala"
	_alteration_unref0 (_tmp1_);
#line 40073 "Photo.c"
}


static void library_photo_real_mark_unflagged (Flaggable* base) {
	LibraryPhoto * self;
	Alteration* _tmp0_ = NULL;
	Alteration* _tmp1_ = NULL;
#line 5252 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5253 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = alteration_new ("metadata", "flagged");
#line 5253 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _tmp0_;
#line 5253 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_remove_flags (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), LIBRARY_PHOTO_FLAG_FLAGGED, _tmp1_);
#line 5253 "/home/jens/Source/shotwell/src/Photo.vala"
	_alteration_unref0 (_tmp1_);
#line 40091 "Photo.c"
}


static gboolean library_photo_real_internal_delete_backing (DataSource* base, GError** error) {
	LibraryPhoto * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp3_ = FALSE;
	GError * _inner_error_ = NULL;
#line 5256 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5259 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = DATA_SOURCE_CLASS (library_photo_parent_class)->internal_delete_backing (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), TYPE_DATA_SOURCE, DataSource), &_inner_error_);
#line 5259 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = _tmp1_;
#line 5259 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 40110 "Photo.c"
		gboolean _tmp2_ = FALSE;
#line 5259 "/home/jens/Source/shotwell/src/Photo.vala"
		g_propagate_error (error, _inner_error_);
#line 5259 "/home/jens/Source/shotwell/src/Photo.vala"
		return _tmp2_;
#line 40116 "Photo.c"
	}
#line 5259 "/home/jens/Source/shotwell/src/Photo.vala"
	if (!_tmp0_) {
#line 5260 "/home/jens/Source/shotwell/src/Photo.vala"
		result = FALSE;
#line 5260 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 40124 "Photo.c"
	}
#line 5262 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = media_source_delete_original_file (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 5262 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp3_;
#line 5262 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 40132 "Photo.c"
}


static void library_photo_real_destroy (DataSource* base) {
	LibraryPhoto * self;
	PhotoID photo_id = {0};
	PhotoID _tmp0_ = {0};
	GError * _inner_error_ = NULL;
#line 5265 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5266 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_get_photo_id (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), &_tmp0_);
#line 5266 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_id = _tmp0_;
#line 5269 "/home/jens/Source/shotwell/src/Photo.vala"
	thumbnail_cache_remove (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_THUMBNAIL_SOURCE, ThumbnailSource));
#line 40149 "Photo.c"
	{
		PhotoTable* _tmp1_ = NULL;
		PhotoTable* _tmp2_ = NULL;
		PhotoID _tmp3_ = {0};
#line 5275 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp1_ = photo_table_get_instance ();
#line 5275 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = _tmp1_;
#line 5275 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = photo_id;
#line 5275 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_table_remove (_tmp2_, &_tmp3_, &_inner_error_);
#line 5275 "/home/jens/Source/shotwell/src/Photo.vala"
		_database_table_unref0 (_tmp2_);
#line 5275 "/home/jens/Source/shotwell/src/Photo.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5275 "/home/jens/Source/shotwell/src/Photo.vala"
			if (_inner_error_->domain == DATABASE_ERROR) {
#line 40168 "Photo.c"
				goto __catch412_database_error;
			}
#line 5275 "/home/jens/Source/shotwell/src/Photo.vala"
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 5275 "/home/jens/Source/shotwell/src/Photo.vala"
			g_clear_error (&_inner_error_);
#line 5275 "/home/jens/Source/shotwell/src/Photo.vala"
			return;
#line 40177 "Photo.c"
		}
	}
	goto __finally412;
	__catch412_database_error:
	{
		GError* err = NULL;
		GError* _tmp4_ = NULL;
#line 5274 "/home/jens/Source/shotwell/src/Photo.vala"
		err = _inner_error_;
#line 5274 "/home/jens/Source/shotwell/src/Photo.vala"
		_inner_error_ = NULL;
#line 5277 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = err;
#line 5277 "/home/jens/Source/shotwell/src/Photo.vala"
		app_window_database_error (_tmp4_);
#line 5274 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_error_free0 (err);
#line 40195 "Photo.c"
	}
	__finally412:
#line 5274 "/home/jens/Source/shotwell/src/Photo.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5274 "/home/jens/Source/shotwell/src/Photo.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 5274 "/home/jens/Source/shotwell/src/Photo.vala"
		g_clear_error (&_inner_error_);
#line 5274 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 40206 "Photo.c"
	}
#line 5280 "/home/jens/Source/shotwell/src/Photo.vala"
	DATA_SOURCE_CLASS (library_photo_parent_class)->destroy (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO, Photo), TYPE_DATA_SOURCE, DataSource));
#line 40210 "Photo.c"
}


gboolean library_photo_has_nontrash_duplicate (GFile* file, const gchar* thumbnail_md5, const gchar* full_md5, PhotoFileFormat file_format) {
	gboolean result = FALSE;
	GFile* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	PhotoFileFormat _tmp3_ = 0;
	PhotoID _tmp4_ = {0};
	gboolean _tmp5_ = FALSE;
#line 5283 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail ((file == NULL) || G_IS_FILE (file), FALSE);
#line 5285 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = file;
#line 5285 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = thumbnail_md5;
#line 5285 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = full_md5;
#line 5285 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = file_format;
#line 5285 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_get_nontrash_duplicate (_tmp0_, _tmp1_, _tmp2_, _tmp3_, &_tmp4_);
#line 5285 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = photo_id_is_valid (&_tmp4_);
#line 5285 "/home/jens/Source/shotwell/src/Photo.vala"
	result = _tmp5_;
#line 5285 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 40240 "Photo.c"
}


void library_photo_get_nontrash_duplicate (GFile* file, const gchar* thumbnail_md5, const gchar* full_md5, PhotoFileFormat file_format, PhotoID* result) {
	PhotoID* ids = NULL;
	GFile* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	PhotoFileFormat _tmp3_ = 0;
	gint _tmp4_ = 0;
	PhotoID* _tmp5_ = NULL;
	gint ids_length1 = 0;
	gint _ids_size_ = 0;
	gboolean _tmp6_ = FALSE;
	PhotoID* _tmp7_ = NULL;
	gint _tmp7__length1 = 0;
	PhotoID* _tmp10_ = NULL;
	gint _tmp10__length1 = 0;
	PhotoID _tmp18_ = {0};
#line 5288 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((file == NULL) || G_IS_FILE (file));
#line 5290 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = file;
#line 5290 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = thumbnail_md5;
#line 5290 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = full_md5;
#line 5290 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = file_format;
#line 5290 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = photo_get_duplicate_ids (_tmp0_, _tmp1_, _tmp2_, _tmp3_, &_tmp4_);
#line 5290 "/home/jens/Source/shotwell/src/Photo.vala"
	ids = _tmp5_;
#line 5290 "/home/jens/Source/shotwell/src/Photo.vala"
	ids_length1 = _tmp4_;
#line 5290 "/home/jens/Source/shotwell/src/Photo.vala"
	_ids_size_ = ids_length1;
#line 5292 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = ids;
#line 5292 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7__length1 = ids_length1;
#line 5292 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp7_ == NULL) {
#line 5292 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = TRUE;
#line 40286 "Photo.c"
	} else {
		PhotoID* _tmp8_ = NULL;
		gint _tmp8__length1 = 0;
#line 5292 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = ids;
#line 5292 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8__length1 = ids_length1;
#line 5292 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = _tmp8__length1 == 0;
#line 40296 "Photo.c"
	}
#line 5292 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp6_) {
#line 40300 "Photo.c"
		PhotoID _tmp9_ = {0};
#line 5293 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_id_init (&_tmp9_, PHOTO_ID_INVALID);
#line 5293 "/home/jens/Source/shotwell/src/Photo.vala"
		*result = _tmp9_;
#line 5293 "/home/jens/Source/shotwell/src/Photo.vala"
		ids = (g_free (ids), NULL);
#line 5293 "/home/jens/Source/shotwell/src/Photo.vala"
		return;
#line 40310 "Photo.c"
	}
#line 5295 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10_ = ids;
#line 5295 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp10__length1 = ids_length1;
#line 40316 "Photo.c"
	{
		PhotoID* id_collection = NULL;
		gint id_collection_length1 = 0;
		gint _id_collection_size_ = 0;
		gint id_it = 0;
#line 5295 "/home/jens/Source/shotwell/src/Photo.vala"
		id_collection = _tmp10_;
#line 5295 "/home/jens/Source/shotwell/src/Photo.vala"
		id_collection_length1 = _tmp10__length1;
#line 5295 "/home/jens/Source/shotwell/src/Photo.vala"
		for (id_it = 0; id_it < _tmp10__length1; id_it = id_it + 1) {
#line 40328 "Photo.c"
			PhotoID id = {0};
#line 5295 "/home/jens/Source/shotwell/src/Photo.vala"
			id = id_collection[id_it];
#line 40332 "Photo.c"
			{
				LibraryPhoto* photo = NULL;
				LibraryPhotoSourceCollection* _tmp11_ = NULL;
				PhotoID _tmp12_ = {0};
				LibraryPhoto* _tmp13_ = NULL;
				gboolean _tmp14_ = FALSE;
				LibraryPhoto* _tmp15_ = NULL;
#line 5296 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = library_photo_global;
#line 5296 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = id;
#line 5296 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = library_photo_source_collection_fetch (_tmp11_, &_tmp12_);
#line 5296 "/home/jens/Source/shotwell/src/Photo.vala"
				photo = _tmp13_;
#line 5297 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = photo;
#line 5297 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp15_ != NULL) {
#line 40352 "Photo.c"
					LibraryPhoto* _tmp16_ = NULL;
					gboolean _tmp17_ = FALSE;
#line 5297 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp16_ = photo;
#line 5297 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp17_ = media_source_is_trashed (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, TYPE_MEDIA_SOURCE, MediaSource));
#line 5297 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp14_ = !_tmp17_;
#line 40361 "Photo.c"
				} else {
#line 5297 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp14_ = FALSE;
#line 40365 "Photo.c"
				}
#line 5297 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp14_) {
#line 5298 "/home/jens/Source/shotwell/src/Photo.vala"
					*result = id;
#line 5298 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (photo);
#line 5298 "/home/jens/Source/shotwell/src/Photo.vala"
					ids = (g_free (ids), NULL);
#line 5298 "/home/jens/Source/shotwell/src/Photo.vala"
					return;
#line 40377 "Photo.c"
				}
#line 5295 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (photo);
#line 40381 "Photo.c"
			}
		}
	}
#line 5301 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_id_init (&_tmp18_, PHOTO_ID_INVALID);
#line 5301 "/home/jens/Source/shotwell/src/Photo.vala"
	*result = _tmp18_;
#line 5301 "/home/jens/Source/shotwell/src/Photo.vala"
	ids = (g_free (ids), NULL);
#line 5301 "/home/jens/Source/shotwell/src/Photo.vala"
	return;
#line 40393 "Photo.c"
}


static gboolean library_photo_real_has_user_generated_metadata (Photo* base) {
	LibraryPhoto * self;
	gboolean result = FALSE;
	GeeList* tags = NULL;
	TagSourceCollection* _tmp0_ = NULL;
	GeeList* _tmp1_ = NULL;
	PhotoMetadata* metadata = NULL;
	PhotoMetadata* _tmp2_ = NULL;
	PhotoMetadata* _tmp3_ = NULL;
	Rating _tmp11_ = 0;
	PhotoMetadata* _tmp12_ = NULL;
	Rating _tmp13_ = 0;
	GeeSet* keywords = NULL;
	PhotoMetadata* _tmp14_ = NULL;
	GeeSet* _tmp15_ = NULL;
	gint _tmp16_ = 0;
	GeeList* _tmp17_ = NULL;
	gint tags_count = 0;
	gint _tmp21_ = 0;
	GeeSet* _tmp22_ = NULL;
	gint keywords_count = 0;
	gint _tmp26_ = 0;
	gint _tmp27_ = 0;
	gboolean _tmp28_ = FALSE;
	GeeList* _tmp29_ = NULL;
#line 5304 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5305 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = tag_global;
#line 5305 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = tag_source_collection_fetch_for_source (_tmp0_, G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 5305 "/home/jens/Source/shotwell/src/Photo.vala"
	tags = _tmp1_;
#line 5307 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_source_get_metadata (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_SOURCE, PhotoSource));
#line 5307 "/home/jens/Source/shotwell/src/Photo.vala"
	metadata = _tmp2_;
#line 5308 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = metadata;
#line 5308 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp3_ == NULL) {
#line 40438 "Photo.c"
		gboolean _tmp4_ = FALSE;
		gboolean _tmp5_ = FALSE;
		GeeList* _tmp6_ = NULL;
#line 5309 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = tags;
#line 5309 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp6_ != NULL) {
#line 5309 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = TRUE;
#line 40448 "Photo.c"
		} else {
			GeeList* _tmp7_ = NULL;
			gint _tmp8_ = 0;
			gint _tmp9_ = 0;
#line 5309 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = tags;
#line 5309 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_COLLECTION, GeeCollection));
#line 5309 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = _tmp8_;
#line 5309 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = _tmp9_ > 0;
#line 40461 "Photo.c"
		}
#line 5309 "/home/jens/Source/shotwell/src/Photo.vala"
		if (_tmp5_) {
#line 5309 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = TRUE;
#line 40467 "Photo.c"
		} else {
			Rating _tmp10_ = 0;
#line 5309 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = media_source_get_rating (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 5309 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = _tmp10_ != RATING_UNRATED;
#line 40474 "Photo.c"
		}
#line 5309 "/home/jens/Source/shotwell/src/Photo.vala"
		result = _tmp4_;
#line 5309 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (metadata);
#line 5309 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (tags);
#line 5309 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 40484 "Photo.c"
	}
#line 5311 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp11_ = media_source_get_rating (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 5311 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp12_ = metadata;
#line 5311 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = photo_metadata_get_rating (_tmp12_);
#line 5311 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp11_ != _tmp13_) {
#line 5312 "/home/jens/Source/shotwell/src/Photo.vala"
		result = TRUE;
#line 5312 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (metadata);
#line 5312 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (tags);
#line 5312 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 40502 "Photo.c"
	}
#line 5314 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = metadata;
#line 5314 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = photo_metadata_get_keywords (_tmp14_, NULL, NULL, NULL);
#line 5314 "/home/jens/Source/shotwell/src/Photo.vala"
	keywords = _tmp15_;
#line 5315 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp17_ = tags;
#line 5315 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp17_ != NULL) {
#line 40514 "Photo.c"
		GeeList* _tmp18_ = NULL;
		gint _tmp19_ = 0;
		gint _tmp20_ = 0;
#line 5315 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp18_ = tags;
#line 5315 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp19_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, GEE_TYPE_COLLECTION, GeeCollection));
#line 5315 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = _tmp19_;
#line 5315 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = _tmp20_;
#line 40526 "Photo.c"
	} else {
#line 5315 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp16_ = 0;
#line 40530 "Photo.c"
	}
#line 5315 "/home/jens/Source/shotwell/src/Photo.vala"
	tags_count = _tmp16_;
#line 5316 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_ = keywords;
#line 5316 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp22_ != NULL) {
#line 40538 "Photo.c"
		GeeSet* _tmp23_ = NULL;
		gint _tmp24_ = 0;
		gint _tmp25_ = 0;
#line 5316 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp23_ = keywords;
#line 5316 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp24_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, GEE_TYPE_COLLECTION, GeeCollection));
#line 5316 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp25_ = _tmp24_;
#line 5316 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = _tmp25_;
#line 40550 "Photo.c"
	} else {
#line 5316 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = 0;
#line 40554 "Photo.c"
	}
#line 5316 "/home/jens/Source/shotwell/src/Photo.vala"
	keywords_count = _tmp21_;
#line 5318 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp26_ = tags_count;
#line 5318 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp27_ = keywords_count;
#line 5318 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp26_ != _tmp27_) {
#line 5319 "/home/jens/Source/shotwell/src/Photo.vala"
		result = TRUE;
#line 5319 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (keywords);
#line 5319 "/home/jens/Source/shotwell/src/Photo.vala"
		_media_metadata_unref0 (metadata);
#line 5319 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (tags);
#line 5319 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 40574 "Photo.c"
	}
#line 5321 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp29_ = tags;
#line 5321 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp29_ != NULL) {
#line 40580 "Photo.c"
		GeeSet* _tmp30_ = NULL;
#line 5321 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp30_ = keywords;
#line 5321 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp28_ = _tmp30_ != NULL;
#line 40586 "Photo.c"
	} else {
#line 5321 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp28_ = FALSE;
#line 40590 "Photo.c"
	}
#line 5321 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp28_) {
#line 40594 "Photo.c"
		{
			GeeList* _tag_list = NULL;
			GeeList* _tmp31_ = NULL;
			GeeList* _tmp32_ = NULL;
			gint _tag_size = 0;
			GeeList* _tmp33_ = NULL;
			gint _tmp34_ = 0;
			gint _tmp35_ = 0;
			gint _tag_index = 0;
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp31_ = tags;
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp32_ = _g_object_ref0 (_tmp31_);
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
			_tag_list = _tmp32_;
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp33_ = _tag_list;
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp34_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, GEE_TYPE_COLLECTION, GeeCollection));
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp35_ = _tmp34_;
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
			_tag_size = _tmp35_;
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
			_tag_index = -1;
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 40622 "Photo.c"
				gint _tmp36_ = 0;
				gint _tmp37_ = 0;
				gint _tmp38_ = 0;
				Tag* tag = NULL;
				GeeList* _tmp39_ = NULL;
				gint _tmp40_ = 0;
				gpointer _tmp41_ = NULL;
				GeeSet* _tmp42_ = NULL;
				Tag* _tmp43_ = NULL;
				gchar* _tmp44_ = NULL;
				gchar* _tmp45_ = NULL;
				gchar* _tmp46_ = NULL;
				gchar* _tmp47_ = NULL;
				gboolean _tmp48_ = FALSE;
				gboolean _tmp49_ = FALSE;
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp36_ = _tag_index;
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
				_tag_index = _tmp36_ + 1;
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp37_ = _tag_index;
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp38_ = _tag_size;
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!(_tmp37_ < _tmp38_)) {
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 40650 "Photo.c"
				}
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp39_ = _tag_list;
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp40_ = _tag_index;
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp41_ = gee_list_get (_tmp39_, _tmp40_);
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
				tag = (Tag*) _tmp41_;
#line 5323 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp42_ = keywords;
#line 5323 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp43_ = tag;
#line 5323 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp44_ = data_object_get_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp43_, TYPE_DATA_OBJECT, DataObject));
#line 5323 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp45_ = _tmp44_;
#line 5323 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp46_ = g_utf8_normalize (_tmp45_, (gssize) -1, G_NORMALIZE_DEFAULT);
#line 5323 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp47_ = _tmp46_;
#line 5323 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp48_ = gee_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, GEE_TYPE_COLLECTION, GeeCollection), _tmp47_);
#line 5323 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp49_ = !_tmp48_;
#line 5323 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (_tmp47_);
#line 5323 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (_tmp45_);
#line 5323 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp49_) {
#line 5324 "/home/jens/Source/shotwell/src/Photo.vala"
					result = TRUE;
#line 5324 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (tag);
#line 5324 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_tag_list);
#line 5324 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (keywords);
#line 5324 "/home/jens/Source/shotwell/src/Photo.vala"
					_media_metadata_unref0 (metadata);
#line 5324 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (tags);
#line 5324 "/home/jens/Source/shotwell/src/Photo.vala"
					return result;
#line 40696 "Photo.c"
				}
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (tag);
#line 40700 "Photo.c"
			}
#line 5322 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tag_list);
#line 40704 "Photo.c"
		}
	}
#line 5328 "/home/jens/Source/shotwell/src/Photo.vala"
	result = FALSE;
#line 5328 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (keywords);
#line 5328 "/home/jens/Source/shotwell/src/Photo.vala"
	_media_metadata_unref0 (metadata);
#line 5328 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (tags);
#line 5328 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 40717 "Photo.c"
}


static void library_photo_real_set_user_metadata_for_export (Photo* base, PhotoMetadata* metadata) {
	LibraryPhoto * self;
	GeeList* photo_tags = NULL;
	TagSourceCollection* _tmp0_ = NULL;
	GeeList* _tmp1_ = NULL;
	GeeList* _tmp2_ = NULL;
	PhotoMetadata* _tmp22_ = NULL;
	Rating _tmp23_ = 0;
#line 5331 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5331 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO_METADATA (metadata));
#line 5332 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = tag_global;
#line 5332 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = tag_source_collection_fetch_for_source (_tmp0_, G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 5332 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_tags = _tmp1_;
#line 5333 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo_tags;
#line 5333 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp2_ != NULL) {
#line 40743 "Photo.c"
		GeeCollection* string_tags = NULL;
		GeeArrayList* _tmp3_ = NULL;
		PhotoMetadata* _tmp19_ = NULL;
		GeeCollection* _tmp20_ = NULL;
#line 5334 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
#line 5334 "/home/jens/Source/shotwell/src/Photo.vala"
		string_tags = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_COLLECTION, GeeCollection);
#line 40752 "Photo.c"
		{
			GeeList* _tag_list = NULL;
			GeeList* _tmp4_ = NULL;
			GeeList* _tmp5_ = NULL;
			gint _tag_size = 0;
			GeeList* _tmp6_ = NULL;
			gint _tmp7_ = 0;
			gint _tmp8_ = 0;
			gint _tag_index = 0;
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp4_ = photo_tags;
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp5_ = _g_object_ref0 (_tmp4_);
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
			_tag_list = _tmp5_;
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = _tag_list;
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_COLLECTION, GeeCollection));
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = _tmp7_;
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
			_tag_size = _tmp8_;
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
			_tag_index = -1;
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 40780 "Photo.c"
				gint _tmp9_ = 0;
				gint _tmp10_ = 0;
				gint _tmp11_ = 0;
				Tag* tag = NULL;
				GeeList* _tmp12_ = NULL;
				gint _tmp13_ = 0;
				gpointer _tmp14_ = NULL;
				GeeCollection* _tmp15_ = NULL;
				Tag* _tmp16_ = NULL;
				gchar* _tmp17_ = NULL;
				gchar* _tmp18_ = NULL;
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = _tag_index;
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
				_tag_index = _tmp9_ + 1;
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = _tag_index;
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = _tag_size;
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!(_tmp10_ < _tmp11_)) {
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 40804 "Photo.c"
				}
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = _tag_list;
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = _tag_index;
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = gee_list_get (_tmp12_, _tmp13_);
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
				tag = (Tag*) _tmp14_;
#line 5336 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = string_tags;
#line 5336 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = tag;
#line 5336 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp17_ = data_object_get_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, TYPE_DATA_OBJECT, DataObject));
#line 5336 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp18_ = _tmp17_;
#line 5336 "/home/jens/Source/shotwell/src/Photo.vala"
				gee_collection_add (_tmp15_, _tmp18_);
#line 5336 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (_tmp18_);
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (tag);
#line 40828 "Photo.c"
			}
#line 5335 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tag_list);
#line 40832 "Photo.c"
		}
#line 5338 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp19_ = metadata;
#line 5338 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp20_ = string_tags;
#line 5338 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_set_keywords (_tmp19_, _tmp20_, PHOTO_METADATA_SET_OPTION_ALL_DOMAINS);
#line 5333 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (string_tags);
#line 40842 "Photo.c"
	} else {
		PhotoMetadata* _tmp21_ = NULL;
#line 5340 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp21_ = metadata;
#line 5340 "/home/jens/Source/shotwell/src/Photo.vala"
		photo_metadata_set_keywords (_tmp21_, NULL, PHOTO_METADATA_SET_OPTION_ALL_DOMAINS);
#line 40849 "Photo.c"
	}
#line 5342 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_ = metadata;
#line 5342 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp23_ = media_source_get_rating (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 5342 "/home/jens/Source/shotwell/src/Photo.vala"
	photo_metadata_set_rating (_tmp22_, _tmp23_);
#line 5331 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (photo_tags);
#line 40859 "Photo.c"
}


static void library_photo_real_apply_user_metadata_for_reimport (Photo* base, PhotoMetadata* metadata) {
	LibraryPhoto * self;
	HierarchicalTagIndex* new_htag_index = NULL;
	PhotoMetadata* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	GeeCollection* keywords = NULL;
	PhotoMetadata* _tmp6_ = NULL;
	GeeSet* _tmp7_ = NULL;
	GeeCollection* _tmp8_ = NULL;
	HierarchicalTagIndex* _tmp39_ = NULL;
#line 5345 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 5345 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO_METADATA (metadata));
#line 5346 "/home/jens/Source/shotwell/src/Photo.vala"
	new_htag_index = NULL;
#line 5348 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = metadata;
#line 5348 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = photo_metadata_has_hierarchical_keywords (_tmp0_);
#line 5348 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp1_) {
#line 40885 "Photo.c"
		PhotoMetadata* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeSet* _tmp4_ = NULL;
		HierarchicalTagIndex* _tmp5_ = NULL;
#line 5349 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp2_ = metadata;
#line 5349 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp3_ = photo_metadata_get_hierarchical_keywords (_tmp2_);
#line 5349 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = _tmp3_;
#line 5349 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = hierarchical_tag_utilities_process_hierarchical_import_keywords (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_COLLECTION, GeeCollection));
#line 5349 "/home/jens/Source/shotwell/src/Photo.vala"
		_hierarchical_tag_index_unref0 (new_htag_index);
#line 5349 "/home/jens/Source/shotwell/src/Photo.vala"
		new_htag_index = _tmp5_;
#line 5349 "/home/jens/Source/shotwell/src/Photo.vala"
		_g_object_unref0 (_tmp4_);
#line 40904 "Photo.c"
	}
#line 5353 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = metadata;
#line 5353 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp7_ = photo_metadata_get_keywords (_tmp6_, NULL, NULL, NULL);
#line 5353 "/home/jens/Source/shotwell/src/Photo.vala"
	keywords = G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_COLLECTION, GeeCollection);
#line 5354 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp8_ = keywords;
#line 5354 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp8_ != NULL) {
#line 40916 "Photo.c"
		{
			GeeIterator* _keyword_it = NULL;
			GeeCollection* _tmp9_ = NULL;
			GeeIterator* _tmp10_ = NULL;
#line 5355 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = keywords;
#line 5355 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEE_TYPE_ITERABLE, GeeIterable));
#line 5355 "/home/jens/Source/shotwell/src/Photo.vala"
			_keyword_it = _tmp10_;
#line 5355 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 40929 "Photo.c"
				GeeIterator* _tmp11_ = NULL;
				gboolean _tmp12_ = FALSE;
				gchar* keyword = NULL;
				GeeIterator* _tmp13_ = NULL;
				gpointer _tmp14_ = NULL;
				gboolean _tmp15_ = FALSE;
				HierarchicalTagIndex* _tmp16_ = NULL;
				gchar* safe_keyword = NULL;
				const gchar* _tmp20_ = NULL;
				gchar* _tmp21_ = NULL;
				gchar* promoted_keyword = NULL;
				const gchar* _tmp22_ = NULL;
				gchar* _tmp23_ = NULL;
				TagSourceCollection* _tmp24_ = NULL;
				const gchar* _tmp25_ = NULL;
				gboolean _tmp26_ = FALSE;
				TagSourceCollection* _tmp30_ = NULL;
				const gchar* _tmp31_ = NULL;
				gboolean _tmp32_ = FALSE;
				const gchar* _tmp36_ = NULL;
				Tag* _tmp37_ = NULL;
				Tag* _tmp38_ = NULL;
#line 5355 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = _keyword_it;
#line 5355 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = gee_iterator_next (_tmp11_);
#line 5355 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp12_) {
#line 5355 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 40960 "Photo.c"
				}
#line 5355 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = _keyword_it;
#line 5355 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = gee_iterator_get (_tmp13_);
#line 5355 "/home/jens/Source/shotwell/src/Photo.vala"
				keyword = (gchar*) _tmp14_;
#line 5356 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = new_htag_index;
#line 5356 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp16_ != NULL) {
#line 40972 "Photo.c"
					HierarchicalTagIndex* _tmp17_ = NULL;
					const gchar* _tmp18_ = NULL;
					gboolean _tmp19_ = FALSE;
#line 5356 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp17_ = new_htag_index;
#line 5356 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp18_ = keyword;
#line 5356 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp19_ = hierarchical_tag_index_is_tag_in_index (_tmp17_, _tmp18_);
#line 5356 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp15_ = _tmp19_;
#line 40984 "Photo.c"
				} else {
#line 5356 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp15_ = FALSE;
#line 40988 "Photo.c"
				}
#line 5356 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp15_) {
#line 5357 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_free0 (keyword);
#line 5357 "/home/jens/Source/shotwell/src/Photo.vala"
					continue;
#line 40996 "Photo.c"
				}
#line 5359 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp20_ = keyword;
#line 5359 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp21_ = hierarchical_tag_utilities_make_flat_tag_safe (_tmp20_);
#line 5359 "/home/jens/Source/shotwell/src/Photo.vala"
				safe_keyword = _tmp21_;
#line 5360 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp22_ = safe_keyword;
#line 5360 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp23_ = hierarchical_tag_utilities_flat_to_hierarchical (_tmp22_);
#line 5360 "/home/jens/Source/shotwell/src/Photo.vala"
				promoted_keyword = _tmp23_;
#line 5363 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp24_ = tag_global;
#line 5363 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp25_ = safe_keyword;
#line 5363 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp26_ = tag_source_collection_exists (_tmp24_, _tmp25_, FALSE);
#line 5363 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp26_) {
#line 41018 "Photo.c"
					const gchar* _tmp27_ = NULL;
					Tag* _tmp28_ = NULL;
					Tag* _tmp29_ = NULL;
#line 5364 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp27_ = safe_keyword;
#line 5364 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp28_ = tag_for_path (_tmp27_);
#line 5364 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp29_ = _tmp28_;
#line 5364 "/home/jens/Source/shotwell/src/Photo.vala"
					tag_attach (_tmp29_, G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 5364 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_tmp29_);
#line 5365 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_free0 (promoted_keyword);
#line 5365 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_free0 (safe_keyword);
#line 5365 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_free0 (keyword);
#line 5365 "/home/jens/Source/shotwell/src/Photo.vala"
					continue;
#line 41040 "Photo.c"
				}
#line 5368 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp30_ = tag_global;
#line 5368 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp31_ = promoted_keyword;
#line 5368 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp32_ = tag_source_collection_exists (_tmp30_, _tmp31_, FALSE);
#line 5368 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp32_) {
#line 41050 "Photo.c"
					const gchar* _tmp33_ = NULL;
					Tag* _tmp34_ = NULL;
					Tag* _tmp35_ = NULL;
#line 5369 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp33_ = promoted_keyword;
#line 5369 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp34_ = tag_for_path (_tmp33_);
#line 5369 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp35_ = _tmp34_;
#line 5369 "/home/jens/Source/shotwell/src/Photo.vala"
					tag_attach (_tmp35_, G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 5369 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_tmp35_);
#line 5370 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_free0 (promoted_keyword);
#line 5370 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_free0 (safe_keyword);
#line 5370 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_free0 (keyword);
#line 5370 "/home/jens/Source/shotwell/src/Photo.vala"
					continue;
#line 41072 "Photo.c"
				}
#line 5373 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp36_ = keyword;
#line 5373 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp37_ = tag_for_path (_tmp36_);
#line 5373 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp38_ = _tmp37_;
#line 5373 "/home/jens/Source/shotwell/src/Photo.vala"
				tag_attach (_tmp38_, G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 5373 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (_tmp38_);
#line 5355 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (promoted_keyword);
#line 5355 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (safe_keyword);
#line 5355 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (keyword);
#line 41090 "Photo.c"
			}
#line 5355 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_keyword_it);
#line 41094 "Photo.c"
		}
	}
#line 5377 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp39_ = new_htag_index;
#line 5377 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp39_ != NULL) {
#line 41101 "Photo.c"
		{
			GeeIterator* _path_it = NULL;
			HierarchicalTagIndex* _tmp40_ = NULL;
			GeeCollection* _tmp41_ = NULL;
			GeeCollection* _tmp42_ = NULL;
			GeeIterator* _tmp43_ = NULL;
			GeeIterator* _tmp44_ = NULL;
#line 5378 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp40_ = new_htag_index;
#line 5378 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp41_ = hierarchical_tag_index_get_all_paths (_tmp40_);
#line 5378 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp42_ = _tmp41_;
#line 5378 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp43_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, GEE_TYPE_ITERABLE, GeeIterable));
#line 5378 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp44_ = _tmp43_;
#line 5378 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tmp42_);
#line 5378 "/home/jens/Source/shotwell/src/Photo.vala"
			_path_it = _tmp44_;
#line 5378 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 41125 "Photo.c"
				GeeIterator* _tmp45_ = NULL;
				gboolean _tmp46_ = FALSE;
				gchar* path = NULL;
				GeeIterator* _tmp47_ = NULL;
				gpointer _tmp48_ = NULL;
				const gchar* _tmp49_ = NULL;
				Tag* _tmp50_ = NULL;
				Tag* _tmp51_ = NULL;
#line 5378 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp45_ = _path_it;
#line 5378 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp46_ = gee_iterator_next (_tmp45_);
#line 5378 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp46_) {
#line 5378 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 41142 "Photo.c"
				}
#line 5378 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp47_ = _path_it;
#line 5378 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp48_ = gee_iterator_get (_tmp47_);
#line 5378 "/home/jens/Source/shotwell/src/Photo.vala"
				path = (gchar*) _tmp48_;
#line 5379 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp49_ = path;
#line 5379 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp50_ = tag_for_path (_tmp49_);
#line 5379 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp51_ = _tmp50_;
#line 5379 "/home/jens/Source/shotwell/src/Photo.vala"
				tag_attach (_tmp51_, G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE, MediaSource));
#line 5379 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (_tmp51_);
#line 5378 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_free0 (path);
#line 41162 "Photo.c"
			}
#line 5378 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_path_it);
#line 41166 "Photo.c"
		}
	}
#line 5345 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (keywords);
#line 5345 "/home/jens/Source/shotwell/src/Photo.vala"
	_hierarchical_tag_index_unref0 (new_htag_index);
#line 41173 "Photo.c"
}


static void library_photo_class_init (LibraryPhotoClass * klass) {
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_parent_class = g_type_class_peek_parent (klass);
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	g_type_class_add_private (klass, sizeof (LibraryPhotoPrivate));
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->notify_master_reimported = (void (*)(Photo*, PhotoMetadata*)) library_photo_real_notify_master_reimported;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->notify_editable_reimported = (void (*)(Photo*, PhotoMetadata*)) library_photo_real_notify_editable_reimported;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->notify_source_reimported = (void (*)(Photo*, PhotoMetadata*)) library_photo_real_notify_source_reimported;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->notify_baseline_reimported = (void (*)(Photo*, PhotoMetadata*)) library_photo_real_notify_baseline_reimported;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	((DataObjectClass *) klass)->notify_altered = (void (*)(DataObject*, Alteration*)) library_photo_real_notify_altered;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->get_preview_pixbuf = (GdkPixbuf* (*)(MediaSource*, Scaling*, GError**)) library_photo_real_get_preview_pixbuf;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->rotate = (void (*)(Photo*, Rotation)) library_photo_real_rotate;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	((ThumbnailSourceClass *) klass)->get_thumbnail = (GdkPixbuf* (*)(ThumbnailSource*, gint, GError**)) library_photo_real_get_thumbnail;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->is_trashed = (gboolean (*)(MediaSource*)) library_photo_real_is_trashed;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->trash = (void (*)(MediaSource*)) library_photo_real_trash;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->untrash = (void (*)(MediaSource*)) library_photo_real_untrash;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->is_offline = (gboolean (*)(MediaSource*)) library_photo_real_is_offline;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->mark_offline = (void (*)(MediaSource*)) library_photo_real_mark_offline;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	((MediaSourceClass *) klass)->mark_online = (void (*)(MediaSource*)) library_photo_real_mark_online;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	((DataSourceClass *) klass)->internal_delete_backing = (gboolean (*)(DataSource*, GError**)) library_photo_real_internal_delete_backing;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	((DataSourceClass *) klass)->destroy = (void (*)(DataSource*)) library_photo_real_destroy;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->has_user_generated_metadata = (gboolean (*)(Photo*)) library_photo_real_has_user_generated_metadata;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->set_user_metadata_for_export = (void (*)(Photo*, PhotoMetadata*)) library_photo_real_set_user_metadata_for_export;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	((PhotoClass *) klass)->apply_user_metadata_for_reimport = (void (*)(Photo*, PhotoMetadata*)) library_photo_real_apply_user_metadata_for_reimport;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	G_OBJECT_CLASS (klass)->finalize = library_photo_finalize;
#line 41222 "Photo.c"
}


static void library_photo_flaggable_interface_init (FlaggableIface * iface) {
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_flaggable_parent_iface = g_type_interface_peek_parent (iface);
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	iface->is_flagged = (gboolean (*)(Flaggable*)) library_photo_real_is_flagged;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	iface->mark_flagged = (void (*)(Flaggable*)) library_photo_real_mark_flagged;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	iface->mark_unflagged = (void (*)(Flaggable*)) library_photo_real_mark_unflagged;
#line 41235 "Photo.c"
}


static void library_photo_monitorable_interface_init (MonitorableIface * iface) {
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_monitorable_parent_iface = g_type_interface_peek_parent (iface);
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	iface->is_offline = (gboolean (*)(Monitorable*)) library_photo_real_is_offline;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	iface->mark_offline = (void (*)(Monitorable*)) library_photo_real_mark_offline;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	iface->mark_online = (void (*)(Monitorable*)) library_photo_real_mark_online;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	iface->set_master_file = (void (*)(Monitorable*, GFile*)) photo_set_master_file;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	iface->set_master_timestamp = (void (*)(Monitorable*, GFileInfo*)) photo_set_master_timestamp;
#line 41252 "Photo.c"
}


static void library_photo_instance_init (LibraryPhoto * self) {
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv = LIBRARY_PHOTO_GET_PRIVATE (self);
#line 4957 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->block_thumbnail_generation = FALSE;
#line 4958 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->thumbnail_scheduler = NULL;
#line 41263 "Photo.c"
}


static void library_photo_finalize (GObject* obj) {
	LibraryPhoto * self;
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_LIBRARY_PHOTO, LibraryPhoto);
#line 4958 "/home/jens/Source/shotwell/src/Photo.vala"
	_one_shot_scheduler_unref0 (self->priv->thumbnail_scheduler);
#line 4959 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->import_keywords);
#line 4946 "/home/jens/Source/shotwell/src/Photo.vala"
	G_OBJECT_CLASS (library_photo_parent_class)->finalize (obj);
#line 41277 "Photo.c"
}


GType library_photo_get_type (void) {
	static volatile gsize library_photo_type_id__volatile = 0;
	if (g_once_init_enter (&library_photo_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (LibraryPhotoClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) library_photo_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LibraryPhoto), 0, (GInstanceInitFunc) library_photo_instance_init, NULL };
		static const GInterfaceInfo flaggable_info = { (GInterfaceInitFunc) library_photo_flaggable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo monitorable_info = { (GInterfaceInitFunc) library_photo_monitorable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType library_photo_type_id;
		library_photo_type_id = g_type_register_static (TYPE_PHOTO, "LibraryPhoto", &g_define_type_info, 0);
		g_type_add_interface_static (library_photo_type_id, TYPE_FLAGGABLE, &flaggable_info);
		g_type_add_interface_static (library_photo_type_id, TYPE_MONITORABLE, &monitorable_info);
		g_once_init_leave (&library_photo_type_id__volatile, library_photo_type_id);
	}
	return library_photo_type_id__volatile;
}


LibraryPhotoSourceHoldingTank* library_photo_source_holding_tank_construct (GType object_type, LibraryPhotoSourceCollection* sources, SourceHoldingTankCheckToKeep check_to_keep, void* check_to_keep_target, GetSourceDatabaseKey get_key, void* get_key_target) {
	LibraryPhotoSourceHoldingTank* self = NULL;
	LibraryPhotoSourceCollection* _tmp0_ = NULL;
	SourceHoldingTankCheckToKeep _tmp1_ = NULL;
	void* _tmp1__target = NULL;
	GetSourceDatabaseKey _tmp2_ = NULL;
	void* _tmp2__target = NULL;
#line 5395 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_LIBRARY_PHOTO_SOURCE_COLLECTION (sources), NULL);
#line 5397 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = sources;
#line 5397 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = check_to_keep;
#line 5397 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1__target = check_to_keep_target;
#line 5397 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = get_key;
#line 5397 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2__target = get_key_target;
#line 5397 "/home/jens/Source/shotwell/src/Photo.vala"
	self = (LibraryPhotoSourceHoldingTank*) media_source_holding_tank_construct (object_type, G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection), _tmp1_, _tmp1__target, _tmp2_, _tmp2__target);
#line 5395 "/home/jens/Source/shotwell/src/Photo.vala"
	return self;
#line 41320 "Photo.c"
}


LibraryPhotoSourceHoldingTank* library_photo_source_holding_tank_new (LibraryPhotoSourceCollection* sources, SourceHoldingTankCheckToKeep check_to_keep, void* check_to_keep_target, GetSourceDatabaseKey get_key, void* get_key_target) {
#line 5395 "/home/jens/Source/shotwell/src/Photo.vala"
	return library_photo_source_holding_tank_construct (TYPE_LIBRARY_PHOTO_SOURCE_HOLDING_TANK, sources, check_to_keep, check_to_keep_target, get_key, get_key_target);
#line 41327 "Photo.c"
}


LibraryPhoto* library_photo_source_holding_tank_fetch_by_backing_file (LibraryPhotoSourceHoldingTank* self, GFile* file) {
	LibraryPhoto* result = NULL;
	LibraryPhoto* ret = NULL;
	GeeHashMap* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	gpointer _tmp2_ = NULL;
	LibraryPhoto* _tmp3_ = NULL;
	GeeHashMap* _tmp4_ = NULL;
	GFile* _tmp5_ = NULL;
	gpointer _tmp6_ = NULL;
#line 5400 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (IS_LIBRARY_PHOTO_SOURCE_HOLDING_TANK (self), NULL);
#line 5400 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_val_if_fail (G_IS_FILE (file), NULL);
#line 5401 "/home/jens/Source/shotwell/src/Photo.vala"
	ret = NULL;
#line 5402 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = self->priv->editable_file_map;
#line 5402 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = file;
#line 5402 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp1_);
#line 5402 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (ret);
#line 5402 "/home/jens/Source/shotwell/src/Photo.vala"
	ret = (LibraryPhoto*) _tmp2_;
#line 5403 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = ret;
#line 5403 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp3_ != NULL) {
#line 5404 "/home/jens/Source/shotwell/src/Photo.vala"
		result = ret;
#line 5404 "/home/jens/Source/shotwell/src/Photo.vala"
		return result;
#line 41365 "Photo.c"
	}
#line 5406 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = self->priv->development_file_map;
#line 5406 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = file;
#line 5406 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp6_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp5_);
#line 5406 "/home/jens/Source/shotwell/src/Photo.vala"
	result = (LibraryPhoto*) _tmp6_;
#line 5406 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (ret);
#line 5406 "/home/jens/Source/shotwell/src/Photo.vala"
	return result;
#line 41379 "Photo.c"
}


static void _library_photo_source_holding_tank_on_editable_replaced_photo_editable_replaced (Photo* _sender, GFile* old_file, GFile* new_file, gpointer self) {
#line 5430 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_source_holding_tank_on_editable_replaced ((LibraryPhotoSourceHoldingTank*) self, _sender, old_file, new_file);
#line 41386 "Photo.c"
}


static void _library_photo_source_holding_tank_on_raw_development_modified_photo_raw_development_modified (Photo* _sender, gpointer self) {
#line 5431 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_source_holding_tank_on_raw_development_modified ((LibraryPhotoSourceHoldingTank*) self, _sender);
#line 41393 "Photo.c"
}


static void library_photo_source_holding_tank_real_notify_contents_altered (SourceHoldingTank* base, GeeCollection* added, GeeCollection* removed) {
	LibraryPhotoSourceHoldingTank * self;
	GeeCollection* _tmp0_ = NULL;
	GeeCollection* _tmp40_ = NULL;
	GeeCollection* _tmp81_ = NULL;
	GeeCollection* _tmp82_ = NULL;
#line 5409 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_PHOTO_SOURCE_HOLDING_TANK, LibraryPhotoSourceHoldingTank);
#line 5409 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((added == NULL) || GEE_IS_COLLECTION (added));
#line 5409 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((removed == NULL) || GEE_IS_COLLECTION (removed));
#line 5411 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = added;
#line 5411 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp0_ != NULL) {
#line 41413 "Photo.c"
		{
			GeeIterator* _source_it = NULL;
			GeeCollection* _tmp1_ = NULL;
			GeeIterator* _tmp2_ = NULL;
#line 5412 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp1_ = added;
#line 5412 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp2_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ITERABLE, GeeIterable));
#line 5412 "/home/jens/Source/shotwell/src/Photo.vala"
			_source_it = _tmp2_;
#line 5412 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 41426 "Photo.c"
				GeeIterator* _tmp3_ = NULL;
				gboolean _tmp4_ = FALSE;
				DataSource* source = NULL;
				GeeIterator* _tmp5_ = NULL;
				gpointer _tmp6_ = NULL;
				LibraryPhoto* photo = NULL;
				DataSource* _tmp7_ = NULL;
				LibraryPhoto* _tmp8_ = NULL;
				LibraryPhoto* _tmp9_ = NULL;
				GFile* _tmp10_ = NULL;
				GFile* _tmp11_ = NULL;
				gboolean _tmp12_ = FALSE;
				GeeCollection* raw_files = NULL;
				LibraryPhoto* _tmp23_ = NULL;
				GeeCollection* _tmp24_ = NULL;
				GeeCollection* _tmp25_ = NULL;
				LibraryPhoto* _tmp38_ = NULL;
				LibraryPhoto* _tmp39_ = NULL;
#line 5412 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp3_ = _source_it;
#line 5412 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp4_ = gee_iterator_next (_tmp3_);
#line 5412 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp4_) {
#line 5412 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 41453 "Photo.c"
				}
#line 5412 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp5_ = _source_it;
#line 5412 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp6_ = gee_iterator_get (_tmp5_);
#line 5412 "/home/jens/Source/shotwell/src/Photo.vala"
				source = (DataSource*) _tmp6_;
#line 5413 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp7_ = source;
#line 5413 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, TYPE_LIBRARY_PHOTO, LibraryPhoto));
#line 5413 "/home/jens/Source/shotwell/src/Photo.vala"
				photo = _tmp8_;
#line 5416 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp9_ = photo;
#line 5416 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp10_ = photo_get_editable_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_PHOTO, Photo));
#line 5416 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp11_ = _tmp10_;
#line 5416 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = _tmp11_ != NULL;
#line 5416 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (_tmp11_);
#line 5416 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp12_) {
#line 41479 "Photo.c"
					GeeHashMap* _tmp13_ = NULL;
					LibraryPhoto* _tmp14_ = NULL;
					GFile* _tmp15_ = NULL;
					GFile* _tmp16_ = NULL;
					LibraryPhoto* _tmp17_ = NULL;
					GeeMultiMap* _tmp18_ = NULL;
					LibraryPhoto* _tmp19_ = NULL;
					LibraryPhoto* _tmp20_ = NULL;
					GFile* _tmp21_ = NULL;
					GFile* _tmp22_ = NULL;
#line 5417 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp13_ = self->priv->editable_file_map;
#line 5417 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp14_ = photo;
#line 5417 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp15_ = photo_get_editable_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, TYPE_PHOTO, Photo));
#line 5417 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp16_ = _tmp15_;
#line 5417 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp17_ = photo;
#line 5417 "/home/jens/Source/shotwell/src/Photo.vala"
					gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp16_, _tmp17_);
#line 5417 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_tmp16_);
#line 5418 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp18_ = self->priv->reverse_editable_file_map;
#line 5418 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp19_ = photo;
#line 5418 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp20_ = photo;
#line 5418 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp21_ = photo_get_editable_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, TYPE_PHOTO, Photo));
#line 5418 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp22_ = _tmp21_;
#line 5418 "/home/jens/Source/shotwell/src/Photo.vala"
					gee_multi_map_set (_tmp18_, _tmp19_, _tmp22_);
#line 5418 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_tmp22_);
#line 41518 "Photo.c"
				}
#line 5422 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp23_ = photo;
#line 5422 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp24_ = photo_get_raw_developer_files (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, TYPE_PHOTO, Photo));
#line 5422 "/home/jens/Source/shotwell/src/Photo.vala"
				raw_files = _tmp24_;
#line 5423 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp25_ = raw_files;
#line 5423 "/home/jens/Source/shotwell/src/Photo.vala"
				if (_tmp25_ != NULL) {
#line 41530 "Photo.c"
					{
						GeeIterator* _f_it = NULL;
						GeeCollection* _tmp26_ = NULL;
						GeeIterator* _tmp27_ = NULL;
#line 5424 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp26_ = raw_files;
#line 5424 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp27_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, GEE_TYPE_ITERABLE, GeeIterable));
#line 5424 "/home/jens/Source/shotwell/src/Photo.vala"
						_f_it = _tmp27_;
#line 5424 "/home/jens/Source/shotwell/src/Photo.vala"
						while (TRUE) {
#line 41543 "Photo.c"
							GeeIterator* _tmp28_ = NULL;
							gboolean _tmp29_ = FALSE;
							GFile* f = NULL;
							GeeIterator* _tmp30_ = NULL;
							gpointer _tmp31_ = NULL;
							GeeHashMap* _tmp32_ = NULL;
							GFile* _tmp33_ = NULL;
							LibraryPhoto* _tmp34_ = NULL;
							GeeMultiMap* _tmp35_ = NULL;
							LibraryPhoto* _tmp36_ = NULL;
							GFile* _tmp37_ = NULL;
#line 5424 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp28_ = _f_it;
#line 5424 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp29_ = gee_iterator_next (_tmp28_);
#line 5424 "/home/jens/Source/shotwell/src/Photo.vala"
							if (!_tmp29_) {
#line 5424 "/home/jens/Source/shotwell/src/Photo.vala"
								break;
#line 41563 "Photo.c"
							}
#line 5424 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp30_ = _f_it;
#line 5424 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp31_ = gee_iterator_get (_tmp30_);
#line 5424 "/home/jens/Source/shotwell/src/Photo.vala"
							f = (GFile*) _tmp31_;
#line 5425 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp32_ = self->priv->development_file_map;
#line 5425 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp33_ = f;
#line 5425 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp34_ = photo;
#line 5425 "/home/jens/Source/shotwell/src/Photo.vala"
							gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp33_, _tmp34_);
#line 5426 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp35_ = self->priv->reverse_development_file_map;
#line 5426 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp36_ = photo;
#line 5426 "/home/jens/Source/shotwell/src/Photo.vala"
							_tmp37_ = f;
#line 5426 "/home/jens/Source/shotwell/src/Photo.vala"
							gee_multi_map_set (_tmp35_, _tmp36_, _tmp37_);
#line 5424 "/home/jens/Source/shotwell/src/Photo.vala"
							_g_object_unref0 (f);
#line 41589 "Photo.c"
						}
#line 5424 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_object_unref0 (_f_it);
#line 41593 "Photo.c"
					}
				}
#line 5430 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp38_ = photo;
#line 5430 "/home/jens/Source/shotwell/src/Photo.vala"
				g_signal_connect (G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, TYPE_PHOTO, Photo), "editable-replaced", (GCallback) _library_photo_source_holding_tank_on_editable_replaced_photo_editable_replaced, self);
#line 5431 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp39_ = photo;
#line 5431 "/home/jens/Source/shotwell/src/Photo.vala"
				g_signal_connect (G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, TYPE_PHOTO, Photo), "raw-development-modified", (GCallback) _library_photo_source_holding_tank_on_raw_development_modified_photo_raw_development_modified, self);
#line 5412 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (raw_files);
#line 5412 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (photo);
#line 5412 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (source);
#line 41610 "Photo.c"
			}
#line 5412 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_source_it);
#line 41614 "Photo.c"
		}
	}
#line 5435 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp40_ = removed;
#line 5435 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp40_ != NULL) {
#line 41621 "Photo.c"
		{
			GeeIterator* _source_it = NULL;
			GeeCollection* _tmp41_ = NULL;
			GeeIterator* _tmp42_ = NULL;
#line 5436 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp41_ = removed;
#line 5436 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp42_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, GEE_TYPE_ITERABLE, GeeIterable));
#line 5436 "/home/jens/Source/shotwell/src/Photo.vala"
			_source_it = _tmp42_;
#line 5436 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 41634 "Photo.c"
				GeeIterator* _tmp43_ = NULL;
				gboolean _tmp44_ = FALSE;
				DataSource* source = NULL;
				GeeIterator* _tmp45_ = NULL;
				gpointer _tmp46_ = NULL;
				LibraryPhoto* photo = NULL;
				DataSource* _tmp47_ = NULL;
				LibraryPhoto* _tmp48_ = NULL;
				GeeMultiMap* _tmp73_ = NULL;
				LibraryPhoto* _tmp74_ = NULL;
				GeeMultiMap* _tmp75_ = NULL;
				LibraryPhoto* _tmp76_ = NULL;
				LibraryPhoto* _tmp77_ = NULL;
				guint _tmp78_ = 0U;
				LibraryPhoto* _tmp79_ = NULL;
				guint _tmp80_ = 0U;
#line 5436 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp43_ = _source_it;
#line 5436 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp44_ = gee_iterator_next (_tmp43_);
#line 5436 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp44_) {
#line 5436 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 41659 "Photo.c"
				}
#line 5436 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp45_ = _source_it;
#line 5436 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp46_ = gee_iterator_get (_tmp45_);
#line 5436 "/home/jens/Source/shotwell/src/Photo.vala"
				source = (DataSource*) _tmp46_;
#line 5437 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp47_ = source;
#line 5437 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp48_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp47_, TYPE_LIBRARY_PHOTO, LibraryPhoto));
#line 5437 "/home/jens/Source/shotwell/src/Photo.vala"
				photo = _tmp48_;
#line 41673 "Photo.c"
				{
					GeeIterator* _f_it = NULL;
					GeeMultiMap* _tmp49_ = NULL;
					LibraryPhoto* _tmp50_ = NULL;
					GeeCollection* _tmp51_ = NULL;
					GeeCollection* _tmp52_ = NULL;
					GeeIterator* _tmp53_ = NULL;
					GeeIterator* _tmp54_ = NULL;
#line 5438 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp49_ = self->priv->reverse_editable_file_map;
#line 5438 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp50_ = photo;
#line 5438 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp51_ = gee_multi_map_get (_tmp49_, _tmp50_);
#line 5438 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp52_ = _tmp51_;
#line 5438 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp53_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp52_, GEE_TYPE_ITERABLE, GeeIterable));
#line 5438 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp54_ = _tmp53_;
#line 5438 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_tmp52_);
#line 5438 "/home/jens/Source/shotwell/src/Photo.vala"
					_f_it = _tmp54_;
#line 5438 "/home/jens/Source/shotwell/src/Photo.vala"
					while (TRUE) {
#line 41700 "Photo.c"
						GeeIterator* _tmp55_ = NULL;
						gboolean _tmp56_ = FALSE;
						GFile* f = NULL;
						GeeIterator* _tmp57_ = NULL;
						gpointer _tmp58_ = NULL;
						GeeHashMap* _tmp59_ = NULL;
						GFile* _tmp60_ = NULL;
#line 5438 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp55_ = _f_it;
#line 5438 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp56_ = gee_iterator_next (_tmp55_);
#line 5438 "/home/jens/Source/shotwell/src/Photo.vala"
						if (!_tmp56_) {
#line 5438 "/home/jens/Source/shotwell/src/Photo.vala"
							break;
#line 41716 "Photo.c"
						}
#line 5438 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp57_ = _f_it;
#line 5438 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp58_ = gee_iterator_get (_tmp57_);
#line 5438 "/home/jens/Source/shotwell/src/Photo.vala"
						f = (GFile*) _tmp58_;
#line 5439 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp59_ = self->priv->editable_file_map;
#line 5439 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp60_ = f;
#line 5439 "/home/jens/Source/shotwell/src/Photo.vala"
						gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp59_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp60_, NULL);
#line 5438 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_object_unref0 (f);
#line 41732 "Photo.c"
					}
#line 5438 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_f_it);
#line 41736 "Photo.c"
				}
				{
					GeeIterator* _f_it = NULL;
					GeeMultiMap* _tmp61_ = NULL;
					LibraryPhoto* _tmp62_ = NULL;
					GeeCollection* _tmp63_ = NULL;
					GeeCollection* _tmp64_ = NULL;
					GeeIterator* _tmp65_ = NULL;
					GeeIterator* _tmp66_ = NULL;
#line 5441 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp61_ = self->priv->reverse_development_file_map;
#line 5441 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp62_ = photo;
#line 5441 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp63_ = gee_multi_map_get (_tmp61_, _tmp62_);
#line 5441 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp64_ = _tmp63_;
#line 5441 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp65_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp64_, GEE_TYPE_ITERABLE, GeeIterable));
#line 5441 "/home/jens/Source/shotwell/src/Photo.vala"
					_tmp66_ = _tmp65_;
#line 5441 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_tmp64_);
#line 5441 "/home/jens/Source/shotwell/src/Photo.vala"
					_f_it = _tmp66_;
#line 5441 "/home/jens/Source/shotwell/src/Photo.vala"
					while (TRUE) {
#line 41764 "Photo.c"
						GeeIterator* _tmp67_ = NULL;
						gboolean _tmp68_ = FALSE;
						GFile* f = NULL;
						GeeIterator* _tmp69_ = NULL;
						gpointer _tmp70_ = NULL;
						GeeHashMap* _tmp71_ = NULL;
						GFile* _tmp72_ = NULL;
#line 5441 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp67_ = _f_it;
#line 5441 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp68_ = gee_iterator_next (_tmp67_);
#line 5441 "/home/jens/Source/shotwell/src/Photo.vala"
						if (!_tmp68_) {
#line 5441 "/home/jens/Source/shotwell/src/Photo.vala"
							break;
#line 41780 "Photo.c"
						}
#line 5441 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp69_ = _f_it;
#line 5441 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp70_ = gee_iterator_get (_tmp69_);
#line 5441 "/home/jens/Source/shotwell/src/Photo.vala"
						f = (GFile*) _tmp70_;
#line 5442 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp71_ = self->priv->development_file_map;
#line 5442 "/home/jens/Source/shotwell/src/Photo.vala"
						_tmp72_ = f;
#line 5442 "/home/jens/Source/shotwell/src/Photo.vala"
						gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp71_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp72_, NULL);
#line 5441 "/home/jens/Source/shotwell/src/Photo.vala"
						_g_object_unref0 (f);
#line 41796 "Photo.c"
					}
#line 5441 "/home/jens/Source/shotwell/src/Photo.vala"
					_g_object_unref0 (_f_it);
#line 41800 "Photo.c"
				}
#line 5444 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp73_ = self->priv->reverse_editable_file_map;
#line 5444 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp74_ = photo;
#line 5444 "/home/jens/Source/shotwell/src/Photo.vala"
				gee_multi_map_remove_all (_tmp73_, _tmp74_);
#line 5445 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp75_ = self->priv->reverse_development_file_map;
#line 5445 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp76_ = photo;
#line 5445 "/home/jens/Source/shotwell/src/Photo.vala"
				gee_multi_map_remove_all (_tmp75_, _tmp76_);
#line 5447 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp77_ = photo;
#line 5447 "/home/jens/Source/shotwell/src/Photo.vala"
				g_signal_parse_name ("editable-replaced", TYPE_PHOTO, &_tmp78_, NULL, FALSE);
#line 5447 "/home/jens/Source/shotwell/src/Photo.vala"
				g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp77_, TYPE_PHOTO, Photo), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp78_, 0, NULL, (GCallback) _library_photo_source_holding_tank_on_editable_replaced_photo_editable_replaced, self);
#line 5448 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp79_ = photo;
#line 5448 "/home/jens/Source/shotwell/src/Photo.vala"
				g_signal_parse_name ("raw-development-modified", TYPE_PHOTO, &_tmp80_, NULL, FALSE);
#line 5448 "/home/jens/Source/shotwell/src/Photo.vala"
				g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp79_, TYPE_PHOTO, Photo), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp80_, 0, NULL, (GCallback) _library_photo_source_holding_tank_on_raw_development_modified_photo_raw_development_modified, self);
#line 5436 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (photo);
#line 5436 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (source);
#line 41830 "Photo.c"
			}
#line 5436 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_source_it);
#line 41834 "Photo.c"
		}
	}
#line 5452 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp81_ = added;
#line 5452 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp82_ = removed;
#line 5452 "/home/jens/Source/shotwell/src/Photo.vala"
	SOURCE_HOLDING_TANK_CLASS (library_photo_source_holding_tank_parent_class)->notify_contents_altered (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_MEDIA_SOURCE_HOLDING_TANK, MediaSourceHoldingTank), TYPE_SOURCE_HOLDING_TANK, SourceHoldingTank), _tmp81_, _tmp82_);
#line 41843 "Photo.c"
}


static void library_photo_source_holding_tank_on_editable_replaced (LibraryPhotoSourceHoldingTank* self, Photo* _photo, GFile* old_file, GFile* new_file) {
	LibraryPhoto* photo = NULL;
	Photo* _tmp0_ = NULL;
	LibraryPhoto* _tmp1_ = NULL;
	LibraryPhoto* _tmp2_ = NULL;
	GFile* _tmp3_ = NULL;
	GFile* _tmp9_ = NULL;
	GeeMultiMap* _tmp13_ = NULL;
	LibraryPhoto* _tmp14_ = NULL;
	GFile* _tmp15_ = NULL;
#line 5455 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO_SOURCE_HOLDING_TANK (self));
#line 5455 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (_photo));
#line 5455 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((old_file == NULL) || G_IS_FILE (old_file));
#line 5455 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail ((new_file == NULL) || G_IS_FILE (new_file));
#line 5456 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = _photo;
#line 5456 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, TYPE_LIBRARY_PHOTO) ? ((LibraryPhoto*) _tmp0_) : NULL);
#line 5456 "/home/jens/Source/shotwell/src/Photo.vala"
	photo = _tmp1_;
#line 5457 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo;
#line 5457 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_assert (_tmp2_ != NULL, "photo != null");
#line 5459 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = old_file;
#line 5459 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp3_ != NULL) {
#line 41879 "Photo.c"
		GeeHashMap* _tmp4_ = NULL;
		GFile* _tmp5_ = NULL;
		GeeMultiMap* _tmp6_ = NULL;
		LibraryPhoto* _tmp7_ = NULL;
		GFile* _tmp8_ = NULL;
#line 5460 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp4_ = self->priv->editable_file_map;
#line 5460 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp5_ = old_file;
#line 5460 "/home/jens/Source/shotwell/src/Photo.vala"
		gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp5_, NULL);
#line 5461 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp6_ = self->priv->reverse_editable_file_map;
#line 5461 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp7_ = photo;
#line 5461 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp8_ = old_file;
#line 5461 "/home/jens/Source/shotwell/src/Photo.vala"
		gee_multi_map_remove (_tmp6_, _tmp7_, _tmp8_);
#line 41899 "Photo.c"
	}
#line 5464 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp9_ = new_file;
#line 5464 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp9_ != NULL) {
#line 41905 "Photo.c"
		GeeHashMap* _tmp10_ = NULL;
		GFile* _tmp11_ = NULL;
		LibraryPhoto* _tmp12_ = NULL;
#line 5465 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp10_ = self->priv->editable_file_map;
#line 5465 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp11_ = new_file;
#line 5465 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp12_ = photo;
#line 5465 "/home/jens/Source/shotwell/src/Photo.vala"
		gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp11_, _tmp12_);
#line 41917 "Photo.c"
	}
#line 5466 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp13_ = self->priv->reverse_editable_file_map;
#line 5466 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp14_ = photo;
#line 5466 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp15_ = new_file;
#line 5466 "/home/jens/Source/shotwell/src/Photo.vala"
	gee_multi_map_set (_tmp13_, _tmp14_, _tmp15_);
#line 5455 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (photo);
#line 41929 "Photo.c"
}


static void library_photo_source_holding_tank_on_raw_development_modified (LibraryPhotoSourceHoldingTank* self, Photo* _photo) {
	LibraryPhoto* photo = NULL;
	Photo* _tmp0_ = NULL;
	LibraryPhoto* _tmp1_ = NULL;
	LibraryPhoto* _tmp2_ = NULL;
	GeeMultiMap* _tmp3_ = NULL;
	LibraryPhoto* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	GeeCollection* raw_list = NULL;
	LibraryPhoto* _tmp20_ = NULL;
	GeeCollection* _tmp21_ = NULL;
	GeeCollection* _tmp22_ = NULL;
#line 5469 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO_SOURCE_HOLDING_TANK (self));
#line 5469 "/home/jens/Source/shotwell/src/Photo.vala"
	g_return_if_fail (IS_PHOTO (_photo));
#line 5470 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = _photo;
#line 5470 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, TYPE_LIBRARY_PHOTO) ? ((LibraryPhoto*) _tmp0_) : NULL);
#line 5470 "/home/jens/Source/shotwell/src/Photo.vala"
	photo = _tmp1_;
#line 5471 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = photo;
#line 5471 "/home/jens/Source/shotwell/src/Photo.vala"
	_vala_assert (_tmp2_ != NULL, "photo != null");
#line 5474 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = self->priv->reverse_development_file_map;
#line 5474 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp4_ = photo;
#line 5474 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp5_ = gee_multi_map_contains (_tmp3_, _tmp4_);
#line 5474 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp5_) {
#line 41967 "Photo.c"
		GeeMultiMap* _tmp18_ = NULL;
		LibraryPhoto* _tmp19_ = NULL;
		{
			GeeIterator* _f_it = NULL;
			GeeMultiMap* _tmp6_ = NULL;
			LibraryPhoto* _tmp7_ = NULL;
			GeeCollection* _tmp8_ = NULL;
			GeeCollection* _tmp9_ = NULL;
			GeeIterator* _tmp10_ = NULL;
			GeeIterator* _tmp11_ = NULL;
#line 5475 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp6_ = self->priv->reverse_development_file_map;
#line 5475 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp7_ = photo;
#line 5475 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp8_ = gee_multi_map_get (_tmp6_, _tmp7_);
#line 5475 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp9_ = _tmp8_;
#line 5475 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp10_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEE_TYPE_ITERABLE, GeeIterable));
#line 5475 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp11_ = _tmp10_;
#line 5475 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_tmp9_);
#line 5475 "/home/jens/Source/shotwell/src/Photo.vala"
			_f_it = _tmp11_;
#line 5475 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 41996 "Photo.c"
				GeeIterator* _tmp12_ = NULL;
				gboolean _tmp13_ = FALSE;
				GFile* f = NULL;
				GeeIterator* _tmp14_ = NULL;
				gpointer _tmp15_ = NULL;
				GeeHashMap* _tmp16_ = NULL;
				GFile* _tmp17_ = NULL;
#line 5475 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp12_ = _f_it;
#line 5475 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp13_ = gee_iterator_next (_tmp12_);
#line 5475 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp13_) {
#line 5475 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 42012 "Photo.c"
				}
#line 5475 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp14_ = _f_it;
#line 5475 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp15_ = gee_iterator_get (_tmp14_);
#line 5475 "/home/jens/Source/shotwell/src/Photo.vala"
				f = (GFile*) _tmp15_;
#line 5476 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp16_ = self->priv->development_file_map;
#line 5476 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp17_ = f;
#line 5476 "/home/jens/Source/shotwell/src/Photo.vala"
				gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp17_, NULL);
#line 5475 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (f);
#line 42028 "Photo.c"
			}
#line 5475 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_f_it);
#line 42032 "Photo.c"
		}
#line 5477 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp18_ = self->priv->reverse_development_file_map;
#line 5477 "/home/jens/Source/shotwell/src/Photo.vala"
		_tmp19_ = photo;
#line 5477 "/home/jens/Source/shotwell/src/Photo.vala"
		gee_multi_map_remove_all (_tmp18_, _tmp19_);
#line 42040 "Photo.c"
	}
#line 5481 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp20_ = photo;
#line 5481 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp21_ = photo_get_raw_developer_files (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, TYPE_PHOTO, Photo));
#line 5481 "/home/jens/Source/shotwell/src/Photo.vala"
	raw_list = _tmp21_;
#line 5482 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp22_ = raw_list;
#line 5482 "/home/jens/Source/shotwell/src/Photo.vala"
	if (_tmp22_ != NULL) {
#line 42052 "Photo.c"
		{
			GeeIterator* _f_it = NULL;
			GeeCollection* _tmp23_ = NULL;
			GeeIterator* _tmp24_ = NULL;
#line 5483 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp23_ = raw_list;
#line 5483 "/home/jens/Source/shotwell/src/Photo.vala"
			_tmp24_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, GEE_TYPE_ITERABLE, GeeIterable));
#line 5483 "/home/jens/Source/shotwell/src/Photo.vala"
			_f_it = _tmp24_;
#line 5483 "/home/jens/Source/shotwell/src/Photo.vala"
			while (TRUE) {
#line 42065 "Photo.c"
				GeeIterator* _tmp25_ = NULL;
				gboolean _tmp26_ = FALSE;
				GFile* f = NULL;
				GeeIterator* _tmp27_ = NULL;
				gpointer _tmp28_ = NULL;
				GeeHashMap* _tmp29_ = NULL;
				GFile* _tmp30_ = NULL;
				LibraryPhoto* _tmp31_ = NULL;
				GeeMultiMap* _tmp32_ = NULL;
				LibraryPhoto* _tmp33_ = NULL;
				GFile* _tmp34_ = NULL;
#line 5483 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp25_ = _f_it;
#line 5483 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp26_ = gee_iterator_next (_tmp25_);
#line 5483 "/home/jens/Source/shotwell/src/Photo.vala"
				if (!_tmp26_) {
#line 5483 "/home/jens/Source/shotwell/src/Photo.vala"
					break;
#line 42085 "Photo.c"
				}
#line 5483 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp27_ = _f_it;
#line 5483 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp28_ = gee_iterator_get (_tmp27_);
#line 5483 "/home/jens/Source/shotwell/src/Photo.vala"
				f = (GFile*) _tmp28_;
#line 5484 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp29_ = self->priv->development_file_map;
#line 5484 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp30_ = f;
#line 5484 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp31_ = photo;
#line 5484 "/home/jens/Source/shotwell/src/Photo.vala"
				gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp30_, _tmp31_);
#line 5485 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp32_ = self->priv->reverse_development_file_map;
#line 5485 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp33_ = photo;
#line 5485 "/home/jens/Source/shotwell/src/Photo.vala"
				_tmp34_ = f;
#line 5485 "/home/jens/Source/shotwell/src/Photo.vala"
				gee_multi_map_set (_tmp32_, _tmp33_, _tmp34_);
#line 5483 "/home/jens/Source/shotwell/src/Photo.vala"
				_g_object_unref0 (f);
#line 42111 "Photo.c"
			}
#line 5483 "/home/jens/Source/shotwell/src/Photo.vala"
			_g_object_unref0 (_f_it);
#line 42115 "Photo.c"
		}
	}
#line 5469 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (raw_list);
#line 5469 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (photo);
#line 42122 "Photo.c"
}


static void library_photo_source_holding_tank_class_init (LibraryPhotoSourceHoldingTankClass * klass) {
#line 5385 "/home/jens/Source/shotwell/src/Photo.vala"
	library_photo_source_holding_tank_parent_class = g_type_class_peek_parent (klass);
#line 5385 "/home/jens/Source/shotwell/src/Photo.vala"
	((SourceHoldingTankClass *) klass)->finalize = library_photo_source_holding_tank_finalize;
#line 5385 "/home/jens/Source/shotwell/src/Photo.vala"
	g_type_class_add_private (klass, sizeof (LibraryPhotoSourceHoldingTankPrivate));
#line 5385 "/home/jens/Source/shotwell/src/Photo.vala"
	((SourceHoldingTankClass *) klass)->notify_contents_altered = (void (*)(SourceHoldingTank*, GeeCollection*, GeeCollection*)) library_photo_source_holding_tank_real_notify_contents_altered;
#line 42135 "Photo.c"
}


static void library_photo_source_holding_tank_instance_init (LibraryPhotoSourceHoldingTank * self) {
	GeeHashMap* _tmp0_ = NULL;
	GeeHashMap* _tmp1_ = NULL;
	GeeHashMultiMap* _tmp2_ = NULL;
	GeeHashMultiMap* _tmp3_ = NULL;
#line 5385 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv = LIBRARY_PHOTO_SOURCE_HOLDING_TANK_GET_PRIVATE (self);
#line 5386 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp0_ = gee_hash_map_new (g_file_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _file_hash_gee_hash_data_func, NULL, NULL, _file_equal_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
#line 5386 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->editable_file_map = _tmp0_;
#line 5388 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp1_ = gee_hash_map_new (g_file_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _file_hash_gee_hash_data_func, NULL, NULL, _file_equal_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
#line 5388 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->development_file_map = _tmp1_;
#line 5390 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp2_ = gee_hash_multi_map_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, g_file_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, _file_hash_gee_hash_data_func, NULL, NULL, _file_equal_gee_equal_data_func, NULL, NULL);
#line 5390 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->reverse_editable_file_map = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_MULTI_MAP, GeeMultiMap);
#line 5392 "/home/jens/Source/shotwell/src/Photo.vala"
	_tmp3_ = gee_hash_multi_map_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, g_file_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, _file_hash_gee_hash_data_func, NULL, NULL, _file_equal_gee_equal_data_func, NULL, NULL);
#line 5392 "/home/jens/Source/shotwell/src/Photo.vala"
	self->priv->reverse_development_file_map = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_MULTI_MAP, GeeMultiMap);
#line 42162 "Photo.c"
}


static void library_photo_source_holding_tank_finalize (SourceHoldingTank* obj) {
	LibraryPhotoSourceHoldingTank * self;
#line 5385 "/home/jens/Source/shotwell/src/Photo.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_LIBRARY_PHOTO_SOURCE_HOLDING_TANK, LibraryPhotoSourceHoldingTank);
#line 5386 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->editable_file_map);
#line 5388 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->development_file_map);
#line 5390 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->reverse_editable_file_map);
#line 5392 "/home/jens/Source/shotwell/src/Photo.vala"
	_g_object_unref0 (self->priv->reverse_development_file_map);
#line 5385 "/home/jens/Source/shotwell/src/Photo.vala"
	SOURCE_HOLDING_TANK_CLASS (library_photo_source_holding_tank_parent_class)->finalize (obj);
#line 42180 "Photo.c"
}


GType library_photo_source_holding_tank_get_type (void) {
	static volatile gsize library_photo_source_holding_tank_type_id__volatile = 0;
	if (g_once_init_enter (&library_photo_source_holding_tank_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (LibraryPhotoSourceHoldingTankClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) library_photo_source_holding_tank_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LibraryPhotoSourceHoldingTank), 0, (GInstanceInitFunc) library_photo_source_holding_tank_instance_init, NULL };
		GType library_photo_source_holding_tank_type_id;
		library_photo_source_holding_tank_type_id = g_type_register_static (TYPE_MEDIA_SOURCE_HOLDING_TANK, "LibraryPhotoSourceHoldingTank", &g_define_type_info, 0);
		g_once_init_leave (&library_photo_source_holding_tank_type_id__volatile, library_photo_source_holding_tank_type_id);
	}
	return library_photo_source_holding_tank_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



