View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0012558 | Scribus | Graphics / Image Frames | public | 2014-07-26 19:02 | 2014-08-18 20:15 |
Reporter | ale | Assigned To | cbradney | ||
Priority | normal | Severity | minor | Reproducibility | N/A |
Status | closed | Resolution | fixed | ||
Product Version | 1.5.0 | ||||
Fixed in Version | 1.5.0svn | ||||
Summary | 0012558: [PATCH] limit the "size" of dropped images | ||||
Description | when 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. | ||||
Tags | patch | ||||
Patch | |||||
|
i'm willing to make a patch if kunda thinks that this would solve 0007707 |
|
http://noprisonersnomercy.com/wp-content/uploads/2010/01/engage.JPG |
|
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... |
|
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(); |
|
Thanks for the collaboration, ale + MrB! Patch works as stated (still without SVG support, yet) |
|
SVG patch submitted via ale: 0012576 Closing this issue |
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 |