gimp-gap r736 - in trunk: . gap



Author: neo
Date: Thu Feb 14 13:58:33 2008
New Revision: 736
URL: http://svn.gnome.org/viewvc/gimp-gap?rev=736&view=rev

Log:
2008-02-14  Sven Neumann  <sven gimp org>

	Merged from gap-2-4:

	* gap/gap_pview_da.c (gap_pview_set_size): added a sanity check
	for the preview size.

	* gap/gap_mov_dialog.c (mov_path_prevw_create)
	(mov_pview_size_allocate_callback)
	* gap/gap_player_dialog.c (p_update_pviewsize): make sure that the
	preview size doesn't become zero. Fixes bug #516443.


Modified:
   trunk/ChangeLog
   trunk/gap/gap_mov_dialog.c
   trunk/gap/gap_player_dialog.c
   trunk/gap/gap_pview_da.c

Modified: trunk/gap/gap_mov_dialog.c
==============================================================================
--- trunk/gap/gap_mov_dialog.c	(original)
+++ trunk/gap/gap_mov_dialog.c	Thu Feb 14 13:58:33 2008
@@ -4108,11 +4108,13 @@
   if ( mgp->dwidth > mgp->dheight )
   {
     mgp->pheight = mgp->dheight * PREVIEW_SIZE / mgp->dwidth;
-    mgp->pwidth = PREVIEW_SIZE;
+    mgp->pheight = MAX (1, mgp->pheight);
+    mgp->pwidth  = PREVIEW_SIZE;
   }
   else
   {
-    mgp->pwidth = mgp->dwidth * PREVIEW_SIZE / mgp->dheight;
+    mgp->pwidth  = mgp->dwidth * PREVIEW_SIZE / mgp->dheight;
+    mgp->pwidth  = MAX (1, mgp->pwidth);
     mgp->pheight = PREVIEW_SIZE;
   }
 
@@ -5344,11 +5346,13 @@
     if ( mgp->dwidth > mgp->dheight )
     {
       pheight = mgp->dheight * PREVIEW_SIZE / mgp->dwidth;
-      pwidth = PREVIEW_SIZE;
+      pheight = MAX (1, pheight);
+      pwidth  = PREVIEW_SIZE;
     }
     else
     {
-      pwidth = mgp->dwidth * PREVIEW_SIZE / mgp->dheight;
+      pwidth  = mgp->dwidth * PREVIEW_SIZE / mgp->dheight;
+      pwidth  = MAX (1, pwidth);
       pheight = PREVIEW_SIZE;
     }
     psize = PREVIEW_SIZE;

Modified: trunk/gap/gap_player_dialog.c
==============================================================================
--- trunk/gap/gap_player_dialog.c	(original)
+++ trunk/gap/gap_player_dialog.c	Thu Feb 14 13:58:33 2008
@@ -1688,12 +1688,14 @@
   {
     /* landscape */
     gpp->pv_height = gpp->ainfo_ptr->height * gpp->pv_pixelsize / gpp->ainfo_ptr->width;
-    gpp->pv_width = gpp->pv_pixelsize;
+    gpp->pv_height = MAX (1, gpp->pv_height);
+    gpp->pv_width  = gpp->pv_pixelsize;
   }
   else
   {
     /* portrait */
     gpp->pv_width = gpp->ainfo_ptr->width * gpp->pv_pixelsize / gpp->ainfo_ptr->height;
+    gpp->pv_width  = MAX (1, gpp->pv_width);
     gpp->pv_height = gpp->pv_pixelsize;
   }
 

Modified: trunk/gap/gap_pview_da.c
==============================================================================
--- trunk/gap/gap_pview_da.c	(original)
+++ trunk/gap/gap_pview_da.c	Thu Feb 14 13:58:33 2008
@@ -468,6 +468,8 @@
 void
 gap_pview_set_size(GapPView *pv_ptr, gint pv_width, gint pv_height, gint pv_check_size)
 {
+  g_return_if_fail (pv_width > 0 && pv_height > 0);
+
   if(pv_ptr->da_widget == NULL) { return; }
 
   gap_pview_reset(pv_ptr);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]