summaryrefslogtreecommitdiff
path: root/backend/tiff
diff options
context:
space:
mode:
authorLaurent Napias <[email protected]>2019-06-29 10:43:23 +0200
committerraveit65 <[email protected]>2019-07-01 17:07:40 +0200
commitaa24676651f8bd3e8b434f72d5aac98e84c0867d (patch)
tree37693766ecb4733c6061dcc2ddc26954fab5ca01 /backend/tiff
parent6741c5db1e5c48c01b25bb7900dc40d48552925d (diff)
downloadatril-aa24676651f8bd3e8b434f72d5aac98e84c0867d.tar.bz2
atril-aa24676651f8bd3e8b434f72d5aac98e84c0867d.tar.xz
Remove trailing whitespaces
Diffstat (limited to 'backend/tiff')
-rw-r--r--backend/tiff/tiff-document.c88
-rw-r--r--backend/tiff/tiff-document.h2
-rw-r--r--backend/tiff/tiff2ps.c20
3 files changed, 55 insertions, 55 deletions
diff --git a/backend/tiff/tiff-document.c b/backend/tiff/tiff-document.c
index 0aa31cb6..3d273fee 100644
--- a/backend/tiff/tiff-document.c
+++ b/backend/tiff/tiff-document.c
@@ -47,7 +47,7 @@ struct _TiffDocument
TIFF *tiff;
gint n_pages;
TIFF2PSContext *ps_export_ctx;
-
+
gchar *uri;
};
@@ -89,22 +89,22 @@ tiff_document_load (EvDocument *document,
TiffDocument *tiff_document = TIFF_DOCUMENT (document);
gchar *filename;
TIFF *tiff;
-
+
filename = g_filename_from_uri (uri, NULL, error);
if (!filename)
return FALSE;
-
+
push_handlers ();
tiff = TIFFOpen (filename, "r");
if (tiff) {
guint32 w, h;
-
+
/* FIXME: unused data? why bother here */
TIFFGetField(tiff, TIFFTAG_IMAGEWIDTH, &w);
TIFFGetField(tiff, TIFFTAG_IMAGELENGTH, &h);
}
-
+
if (!tiff) {
pop_handlers ();
@@ -116,12 +116,12 @@ tiff_document_load (EvDocument *document,
g_free (filename);
return FALSE;
}
-
+
tiff_document->tiff = tiff;
g_free (tiff_document->uri);
g_free (filename);
tiff_document->uri = g_strdup (uri);
-
+
pop_handlers ();
return TRUE;
}
@@ -130,24 +130,24 @@ static gboolean
tiff_document_save (EvDocument *document,
const char *uri,
GError **error)
-{
+{
TiffDocument *tiff_document = TIFF_DOCUMENT (document);
- return ev_xfer_uri_simple (tiff_document->uri, uri, error);
+ return ev_xfer_uri_simple (tiff_document->uri, uri, error);
}
static int
tiff_document_get_n_pages (EvDocument *document)
{
TiffDocument *tiff_document = TIFF_DOCUMENT (document);
-
+
g_return_val_if_fail (TIFF_IS_DOCUMENT (document), 0);
g_return_val_if_fail (tiff_document->tiff != NULL, 0);
-
+
if (tiff_document->n_pages == -1) {
push_handlers ();
tiff_document->n_pages = 0;
-
+
do {
tiff_document->n_pages ++;
}
@@ -165,7 +165,7 @@ tiff_document_get_resolution (TiffDocument *tiff_document,
{
gfloat x = 72.0, y = 72.0;
gushort unit;
-
+
if (TIFFGetField (tiff_document->tiff, TIFFTAG_XRESOLUTION, &x) &&
TIFFGetField (tiff_document->tiff, TIFFTAG_YRESOLUTION, &y)) {
if (TIFFGetFieldDefaulted (tiff_document->tiff, TIFFTAG_RESOLUTIONUNIT, &unit)) {
@@ -189,24 +189,24 @@ tiff_document_get_page_size (EvDocument *document,
guint32 w, h;
gfloat x_res, y_res;
TiffDocument *tiff_document = TIFF_DOCUMENT (document);
-
+
g_return_if_fail (TIFF_IS_DOCUMENT (document));
g_return_if_fail (tiff_document->tiff != NULL);
-
+
push_handlers ();
if (TIFFSetDirectory (tiff_document->tiff, page->index) != 1) {
pop_handlers ();
return;
}
-
+
TIFFGetField (tiff_document->tiff, TIFFTAG_IMAGEWIDTH, &w);
TIFFGetField (tiff_document->tiff, TIFFTAG_IMAGELENGTH, &h);
tiff_document_get_resolution (tiff_document, &x_res, &y_res);
h = h * (x_res / y_res);
-
+
*width = w;
*height = h;
-
+
pop_handlers ();
}
@@ -224,10 +224,10 @@ tiff_document_render (EvDocument *document,
cairo_surface_t *surface;
cairo_surface_t *rotated_surface;
static const cairo_user_data_key_t key;
-
+
g_return_val_if_fail (TIFF_IS_DOCUMENT (document), NULL);
g_return_val_if_fail (tiff_document->tiff != NULL, NULL);
-
+
push_handlers ();
if (TIFFSetDirectory (tiff_document->tiff, rc->page->index) != 1) {
pop_handlers ();
@@ -252,9 +252,9 @@ tiff_document_render (EvDocument *document,
}
tiff_document_get_resolution (tiff_document, &x_res, &y_res);
-
+
pop_handlers ();
-
+
/* Sanity check the doc */
if (width <= 0 || height <= 0) {
g_warning("Invalid width or height.");
@@ -265,22 +265,22 @@ tiff_document_render (EvDocument *document,
if (rowstride / 4 != width) {
g_warning("Overflow while rendering document.");
/* overflow, or cairo was changed in an unsupported way */
- return NULL;
+ return NULL;
}
-
+
bytes = height * rowstride;
if (bytes / rowstride != height) {
g_warning("Overflow while rendering document.");
/* overflow */
return NULL;
}
-
+
pixels = g_try_malloc (bytes);
if (!pixels) {
g_warning("Failed to allocate memory for rendering.");
return NULL;
}
-
+
surface = cairo_image_surface_create_for_data (pixels,
CAIRO_FORMAT_RGB24,
width, height,
@@ -315,7 +315,7 @@ tiff_document_render (EvDocument *document,
(height * rc->scale * (x_res / y_res)) + 0.5,
rc->rotation);
cairo_surface_destroy (surface);
-
+
return rotated_surface;
}
@@ -331,7 +331,7 @@ tiff_document_render_pixbuf (EvDocument *document,
GdkPixbuf *pixbuf;
GdkPixbuf *scaled_pixbuf;
GdkPixbuf *rotated_pixbuf;
-
+
push_handlers ();
if (TIFFSetDirectory (tiff_document->tiff, rc->page->index) != 1) {
pop_handlers ();
@@ -349,28 +349,28 @@ tiff_document_render_pixbuf (EvDocument *document,
}
tiff_document_get_resolution (tiff_document, &x_res, &y_res);
-
+
pop_handlers ();
-
+
/* Sanity check the doc */
if (width <= 0 || height <= 0)
- return NULL;
+ return NULL;
rowstride = width * 4;
if (rowstride / 4 != width)
/* overflow */
- return NULL;
-
+ return NULL;
+
bytes = height * rowstride;
if (bytes / rowstride != height)
/* overflow */
- return NULL;
-
+ return NULL;
+
pixels = g_try_malloc (bytes);
if (!pixels)
return NULL;
-
- pixbuf = gdk_pixbuf_new_from_data (pixels, GDK_COLORSPACE_RGB, TRUE, 8,
+
+ pixbuf = gdk_pixbuf_new_from_data (pixels, GDK_COLORSPACE_RGB, TRUE, 8,
width, height, rowstride,
(GdkPixbufDestroyNotify) g_free, NULL);
TIFFReadRGBAImageOriented (tiff_document->tiff,
@@ -384,10 +384,10 @@ tiff_document_render_pixbuf (EvDocument *document,
height * rc->scale * (x_res / y_res),
GDK_INTERP_BILINEAR);
g_object_unref (pixbuf);
-
+
rotated_pixbuf = gdk_pixbuf_rotate_simple (scaled_pixbuf, 360 - rc->rotation);
g_object_unref (scaled_pixbuf);
-
+
return rotated_pixbuf;
}
@@ -437,26 +437,26 @@ tiff_document_class_init (TiffDocumentClass *klass)
static GdkPixbuf *
tiff_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document,
- EvRenderContext *rc,
+ EvRenderContext *rc,
gboolean border)
{
GdkPixbuf *pixbuf;
pixbuf = tiff_document_render_pixbuf (EV_DOCUMENT (document), rc);
-
+
if (border) {
GdkPixbuf *tmp_pixbuf = pixbuf;
-
+
pixbuf = ev_document_misc_get_thumbnail_frame (-1, -1, tmp_pixbuf);
g_object_unref (tmp_pixbuf);
}
-
+
return pixbuf;
}
static void
tiff_document_thumbnails_get_dimensions (EvDocumentThumbnails *document,
- EvRenderContext *rc,
+ EvRenderContext *rc,
gint *width,
gint *height)
{
diff --git a/backend/tiff/tiff-document.h b/backend/tiff/tiff-document.h
index 19db6158..b45f78c4 100644
--- a/backend/tiff/tiff-document.h
+++ b/backend/tiff/tiff-document.h
@@ -32,7 +32,7 @@ typedef struct _TiffDocument TiffDocument;
GType tiff_document_get_type (void) G_GNUC_CONST;
G_MODULE_EXPORT GType register_atril_backend (GTypeModule *module);
-
+
G_END_DECLS
#endif /* __TIFF_DOCUMENT_H__ */
diff --git a/backend/tiff/tiff2ps.c b/backend/tiff/tiff2ps.c
index f8933674..bcbbf885 100644
--- a/backend/tiff/tiff2ps.c
+++ b/backend/tiff/tiff2ps.c
@@ -5,23 +5,23 @@
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
- * Permission to use, copy, modify, distribute, and sell this software and
+ * Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
- *
- * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
- * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
- *
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
@@ -827,7 +827,7 @@ PS_Lvl2ImageDict(TIFF2PSContext* ctx, TIFF* tif, uint32 w, uint32 h)
* Workaround for some software that may crash when last strip
* of image contains fewer number of scanlines than specified
* by the `/Height' variable. So for stripped images with multiple
- * strips we will set `/Height' as `im_h', because one is
+ * strips we will set `/Height' as `im_h', because one is
* recalculated for each strip - including the (smaller) final strip.
* For tiled images and images with only one strip `/Height' will
* contain number of scanlines in tile (or image height in case of
@@ -1722,7 +1722,7 @@ Ascii85Flush(TIFF2PSContext* ctx)
fputs("~>\n", ctx->fd);
}
#if defined( EXP_ASCII85ENCODER)
-
+
#define A85BREAKCNTR ctx->ascii85breaklen
#define A85BREAKLEN (2*MAXLINE)