Commit ddcebc35 authored by Debarshi Ray's avatar Debarshi Ray

base-item: Add photos_base_item_get_bbox_edited

We need to know the size of the edited item so that we can find out if
it is big enough to be downscaled and by how much.

https://bugzilla.gnome.org/show_bug.cgi?id=759363
parent c03429bf
......@@ -1703,6 +1703,32 @@ photos_base_item_get_author (PhotosBaseItem *self)
}
gboolean
photos_base_item_get_bbox_edited (PhotosBaseItem *self, GeglRectangle *out_bbox)
{
PhotosBaseItemPrivate *priv;
GeglNode *graph;
GeglRectangle bbox;
g_return_val_if_fail (PHOTOS_IS_BASE_ITEM (self), FALSE);
priv = self->priv;
g_return_val_if_fail (priv->edit_graph != NULL, FALSE);
g_return_val_if_fail (priv->load_graph != NULL, FALSE);
g_return_val_if_fail (priv->pipeline != NULL, FALSE);
g_return_val_if_fail (priv->processor != NULL, FALSE);
g_return_val_if_fail (!gegl_processor_work (priv->processor, NULL), FALSE);
graph = photos_pipeline_get_graph (priv->pipeline);
bbox = gegl_node_get_bounding_box (graph);
if (out_bbox != NULL)
*out_bbox = bbox;
return TRUE;
}
gboolean
photos_base_item_get_bbox_source (PhotosBaseItem *self, GeglRectangle *bbox)
{
......
......@@ -118,6 +118,8 @@ gchar *photos_base_item_download_finish (PhotosBaseItem *se
const gchar *photos_base_item_get_author (PhotosBaseItem *self);
gboolean photos_base_item_get_bbox_edited (PhotosBaseItem *self, GeglRectangle *out_bbox);
gboolean photos_base_item_get_bbox_source (PhotosBaseItem *self, GeglRectangle *bbox);
gint64 photos_base_item_get_date_created (PhotosBaseItem *self);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment