View Issue Details

IDProjectCategoryView StatusLast Update
0012558ScribusGraphics / Image Framespublic2014-08-18 20:15
Reporterale Assigned Tocbradney  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version1.5.0 
Target VersionFixed in Version1.5.0svn 
Summary0012558: [PATCH] limit the "size" of dropped images
Descriptionwhen dropping an image on the canvas, a new image frame is automatically created.

for large images it would be useful to limit the size of the newly created frame to the size of the page.

scribus would respect the resolution and work as usual until the size of the page is reached.

we probably want to respect the bleeds.
Tagspatch
Patch

Relationships

related to 0007707 closed [Proposal] Trigger a dialog for dropped images (mockup included) 
related to 0012576 new limit the "size" of dropped vectors 

Activities

ale

2014-07-26 19:03

manager   ~0033035

i'm willing to make a patch if kunda thinks that this would solve 0007707

Kunda

2014-07-27 14:28

updater   ~0033040

http://noprisonersnomercy.com/wp-content/uploads/2010/01/engage.JPG

ale

2014-07-29 16:48

manager   ~0033076

attached a patch solving the issue for images.

for vector i don't manage it, to resize the content (it just resizes the bounding box)... another patch might follow...

ale

2014-07-29 16:49

manager  

scribusview.diff (1,028 bytes)
Index: scribus/scribusview.cpp
===================================================================
--- scribus/scribusview.cpp	(revision 19357)
+++ scribus/scribusview.cpp	(working copy)
@@ -842,8 +842,26 @@
 			PageItem *b = Doc->Items->at(z);
 			b->LayerID = Doc->activeLayer();
 			Doc->loadPict(url.toLocalFile(), b);
-			b->setWidth(static_cast<double>(b->OrigW * 72.0 / b->pixm.imgInfo.xres));
-			b->setHeight(static_cast<double>(b->OrigH * 72.0 / b->pixm.imgInfo.yres));
+
+			double iw = static_cast<double>(b->OrigW * 72.0 / b->pixm.imgInfo.xres);
+			double ih = static_cast<double>(b->OrigH * 72.0 / b->pixm.imgInfo.yres);
+			if (iw > ih) {
+				double pw = Doc->currentPage()->width();
+				if (iw > pw) {
+					ih = pw / (iw / ih);
+					iw = pw;
+				}
+			} else {
+				double ph = Doc->currentPage()->height();
+				if (ih > ph) {
+					iw = ph / (ih / iw);
+					ih = ph;
+				}
+			}
+
+
+			b->setWidth(iw);
+			b->setHeight(ih);
 			b->OldB2 = b->width();
 			b->OldH2 = b->height();
 			b->updateClip();
scribusview.diff (1,028 bytes)

Kunda

2014-07-30 16:23

updater   ~0033087

Thanks for the collaboration, ale + MrB!
Patch works as stated (still without SVG support, yet)

Kunda

2014-08-18 20:15

updater   ~0033270

SVG patch submitted via ale: 0012576
Closing this issue

Issue History

Date Modified Username Field Change
2014-07-26 19:02 ale New Issue
2014-07-26 19:02 ale Relationship added related to 0007707
2014-07-26 19:03 ale Note Added: 0033035
2014-07-27 14:28 Kunda Note Added: 0033040
2014-07-29 16:48 ale Note Added: 0033076
2014-07-29 16:49 ale File Added: scribusview.diff
2014-07-29 16:49 ale Tag Attached: patch
2014-07-29 16:49 ale Summary limit the "size" of dropped images => [PATCH] limit the "size" of dropped images
2014-07-29 19:03 cbradney Status new => resolved
2014-07-29 19:03 cbradney Fixed in Version => 1.5.0svn
2014-07-29 19:03 cbradney Resolution open => fixed
2014-07-29 19:03 cbradney Assigned To => cbradney
2014-07-30 16:23 Kunda Note Added: 0033087
2014-08-18 20:14 Kunda Relationship added related to 0012576
2014-08-18 20:15 Kunda Note Added: 0033270
2014-08-18 20:15 Kunda Status resolved => closed
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