View Issue Details

IDProjectCategoryView StatusLast Update
0001627ScribusGraphics / Image Framespublic2015-11-28 05:28
Reporteralexandre Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
Status acknowledgedResolutionopen 
Product Version1.3.0cvs 
Summary0001627: improvement for handling changes in images on disc
DescriptionCurrently the way to change an image in a Scribus document requires the following sequence of actions:

1. Open right-mouse-button menu.
2. Choose "Edit Picture".
3. Edit it in, say, The GIMP.
4. Save it.
5. Go back to Scribus.
6. Open right-mouse-button menu
7. Choose "Update Picture".

It's OK, if you changed only one picture and you did it from Scribus.

Now, imagine you have 25 pictures in 3 documents. It wouldn't be a good idea to call GIMP from Scribus 25 times. The real world use case would be open them from GIMP, edit and save. Or run a batch processing script in ImageMagick on them.

What happens then? You end up with

1. Open right-mouse-button menu.
2. Choose "Update Picture".

For 25 pictures. These are 50 movements. Or 75 movements, if you count clicks to select a picture. Besides you might have more pictures in those 3 documents that you didn't change. Nice, isn't it? :)

One solution would be write a script that would update all of the pictures.

Another solution is what I would like to propose.

The are several ways to find out, which files have changed on disc. Depending on what way you want to go this will be using fam, dnotify or inotify. If one of them tells Scribus that some of currently used pictures were changed on disc or were deleted (bad, bad news), Scribus would somehow notify a user about it. The best way of notification I imagine is blurring the picture frame and putting a specific icon in its centre. See attached screenshots for details :)

I don't know if fam/dnotify/inotify can provide info on *moved* files. I hope it can, because it would help using "Manage pictures" dialog much more seldom :) The picture frame would be blurred then an had an icon that would mean "The file has changed. Click me to change the reference to a new path".

Now all you need is click icons in picture frames, when they appear. But I wouldn't abandon the idea with a script to update all or only changed and moved images.
TagsNo tags attached.
PatchYes

Relationships

related to 0003814 closedcbradney Manage Pictures: Add button to search for all pictures in one directory 

Activities

2005-02-03 08:52

 

changed_image.png (47,067 bytes)   
changed_image.png (47,067 bytes)   

2005-02-03 08:52

 

deleted_image.png (49,885 bytes)   
deleted_image.png (49,885 bytes)   

cbradney

2005-02-03 08:57

administrator   ~0003596

Nice idea, even given the fact 1.3 will autoreload. If we make the autoreload an option, we can in fact use this idea when autoreload is turned off.

ringerc

2005-02-03 08:59

reporter   ~0003597

It'd be good if the auto-reload support would also warn the user if the image dimensions had changed. This should help avoid nasty surprises with unexpected image positioning / re-cropped images, especially in collaborative work environments.

louisdesjardins

2005-02-03 12:15

developer   ~0003602

I agree. It's a very good idea.
Adding the capability of the "update" command to "see" other pics in the same situation in the same directory would also save time updating.

plinnell

2005-02-19 20:40

viewer   ~0003754

I personally would hate anything based on fam.. It's a buggy module which RH/Fedora is rewriting on their own to fix many issues with fam.

louisdesjardins

2005-02-20 03:10

developer   ~0003765

What is fam?

plinnell

2005-02-20 09:36

viewer   ~0003766

fam= file alteration module open sourced by SGI (I think) It is a daemon which runs in the background and checks for altered files.

louisdesjardins

2005-02-20 11:51

developer   ~0003771

Thanks, Peter. :)

jb

2005-05-16 20:23

reporter   ~0004680

Last edited: 2005-05-16 20:24

Currently, when a picture is missing, it disappears from your page.
I made a small patch to improve this. With the patch, missing pictures appear in a light tone with a red cross on them (see sample uploaded missingpic.png)

Since 1.3 does automatic reloading, there is no need to mark modified pictures...

[Patch attached] ( see bug 1678 for more work on the image managment window)

2005-05-16 20:23

 

missingpic.png (133,113 bytes)   
missingpic.png (133,113 bytes)   

2005-05-16 20:25

 

missingpic.diff (4,003 bytes)   
Index: scribusview.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/scribusview.cpp,v
retrieving revision 1.76.2.195
diff -u -3 -p -u -r1.76.2.195 scribusview.cpp
--- scribusview.cpp	16 May 2005 16:11:41 -0000	1.76.2.195
+++ scribusview.cpp	16 May 2005 22:10:27 -0000
@@ -10567,7 +10570,6 @@ void ScribusView::removePict(QString nam
 		if ((currItem->PicAvail) && (currItem->Pfile == name))
 		{
 			currItem->PicAvail = false;
-			currItem->pixm = QImage();
 /*			if (currItem->itemType() == PageItem::ImageFrame)
 				emit UpdtObj(Doc->currentPage->PageNr, currItem->ItemNr); */
 		}
@@ -10578,7 +10580,6 @@ void ScribusView::removePict(QString nam
 		if ((currItem->PicAvail) && (currItem->Pfile == name))
 		{
 			currItem->PicAvail = false;
-			currItem->pixm = QImage();
 		}
 	}
 	updateContents();
Index: scpainter.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/scpainter.cpp,v
retrieving revision 1.19.2.10
diff -u -3 -p -u -r1.19.2.10 scpainter.cpp
--- scpainter.cpp	22 Apr 2005 22:41:57 -0000	1.19.2.10
+++ scpainter.cpp	16 May 2005 22:10:27 -0000
@@ -929,8 +931,11 @@ void ScPainter::setClipPath()
 	art_free( temp1 );
 }
 
-void ScPainter::drawImage( QImage *image )
+
+
+void ScPainter::drawImage( QImage *image, bool avail )
 {
+	int alpha=255;
 	double affineresult[6];
 	affineresult[0] = m_matrix.m11() * m_zoomFactor;
 	affineresult[1] = m_matrix.m12() * m_zoomFactor;
@@ -938,6 +943,8 @@ void ScPainter::drawImage( QImage *image
 	affineresult[3] = m_matrix.m22() * m_zoomFactor;
 	affineresult[4] = m_matrix.dx();
 	affineresult[5] = m_matrix.dy();
+	
+	if (!avail) alpha=50;
 	ksvg_art_rgb_affine_clip( m_clipPath, m_buffer, 0, 0, m_width, m_height, m_width * 4, 4,
 					 image->bits(), image->width(), image->height(), image->width() * 4,
 					 affineresult, qRound( 255 * fill_trans ), 0L );
Index: scpainter.h
===================================================================
RCS file: /cvs/Scribus/scribus/scpainter.h,v
retrieving revision 1.7.2.7
diff -u -3 -p -u -r1.7.2.7 scpainter.h
--- scpainter.h	22 Apr 2005 22:41:57 -0000	1.7.2.7
+++ scpainter.h	16 May 2005 22:10:27 -0000
@@ -83,7 +83,7 @@ public:
 	virtual void setGradient( VGradient::VGradientType mode, FPoint orig, FPoint vec, FPoint foc = FPoint(0,0));
 	virtual void setClipPath();
 
-	virtual void drawImage( QImage *image );
+	virtual void drawImage( QImage *image, bool avail = true );
 	virtual void setupPolygon(FPointArray *points, bool closed = true);
 	virtual void setupTextPolygon(FPointArray *points);
 	virtual void drawPolygon();
Index: pageitem.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/pageitem.cpp,v
retrieving revision 1.121.2.130
diff -u -3 -p -u -r1.121.2.130 pageitem.cpp
--- pageitem.cpp	16 May 2005 07:45:24 -0000	1.121.2.130
+++ pageitem.cpp	16 May 2005 22:10:29 -0000
@@ -511,7 +511,13 @@ void PageItem::DrawObj_ImageFrame(ScPain
 			}
 			else
 			{
-				if ((!PicArt) || (!PicAvail))
+			if (!PicAvail)
+			{
+			p->setPen(red, 1, DotLine, FlatCap, MiterJoin);
+			p->drawLine(FPoint(0, 0), FPoint(Width, Height));
+			p->drawLine(FPoint(0, Height), FPoint(Width, 0));
+			}
+				if (!PicArt)
 				{
 					if ((Frame) && (Doc->guidesSettings.framesShown))
 					{
@@ -542,7 +548,7 @@ void PageItem::DrawObj_ImageFrame(ScPain
 					p->scale(LocalScX, LocalScY);
 					if (pixm.imgInfo.lowResType != 0)
 						p->scale(pixm.imgInfo.lowResScale, pixm.imgInfo.lowResScale);
-					p->drawImage(&pixm);
+					p->drawImage(&pixm, PicAvail);
 					p->restore();
 				}
 			}
@@ -629,7 +635,7 @@ void PageItem::DrawObj_TextFrame(ScPaint
 				p->scale(LocalScX, LocalScY);
 				p->translate(static_cast<int>(LocalX*LocalScX), static_cast<int>(LocalY*LocalScY));
 				if (!pixm.isNull())
-					p->drawImage(&pixm);
+					p->drawImage(&pixm, PicAvail);
 				p->restore();
 			}
 			if ((itemText.count() != 0) && (Dirty))
missingpic.diff (4,003 bytes)   

avox

2005-05-17 01:21

updater   ~0004682

Why not use stat() and store the timestamp? Much more portable.

ringerc

2005-09-12 06:14

reporter   ~0006520

Reminder sent to: fschmid

Any thoughts on this one?

Kunda

2015-11-28 05:28

updater   ~0037713

is there something in this patch we can still useful that we can salvage ?

Issue History

Date Modified Username Field Change
2005-02-03 08:52 alexandre New Issue
2005-02-03 08:52 alexandre File Added: changed_image.png
2005-02-03 08:52 alexandre File Added: deleted_image.png
2005-02-03 08:57 cbradney Note Added: 0003596
2005-02-03 08:59 ringerc Note Added: 0003597
2005-02-03 12:15 louisdesjardins Note Added: 0003602
2005-02-19 20:40 plinnell Note Added: 0003754
2005-02-20 03:10 louisdesjardins Note Added: 0003765
2005-02-20 09:36 plinnell Note Added: 0003766
2005-02-20 11:51 louisdesjardins Note Added: 0003771
2005-05-16 20:23 jb Note Added: 0004680
2005-05-16 20:23 jb File Added: missingpic.png
2005-05-16 20:24 jb Note Edited: 0004680
2005-05-16 20:25 jb File Added: missingpic.diff
2005-05-17 01:21 avox Note Added: 0004682
2005-09-12 06:13 ringerc Status new => acknowledged
2005-09-12 06:14 ringerc Note Added: 0006520
2006-05-14 11:56 louisdesjardins Relationship added related to 0003814
2015-09-17 20:10 Kunda Category Graphics / Image Frames => Graphics/Img Frames
2015-09-17 20:11 Kunda Category Graphics/Img Frames => Graphics / Image Frames
2015-11-28 05:28 Kunda Patch => Yes
2015-11-28 05:28 Kunda Note Added: 0037713