Workflow for adding image frames

Previous topic - Next topic

pck1980

Hi everyone :-)

I'm currently working on a document that will contain several images. While the images might differ in size, I usually want to have the same properties for each image frame (i.e., as large as the image that's inside, and with the same text flow around it).

My steps for adding a single image are currently:

  • Create a new image frame by pressing "I", drag it to an arbitrary size and select the appropriate file for it
  • Open context menu to adapt image to frame size (so that the image fits completely inside the frame)
  • Open context menu again to adapt frame to image size (so that the frame border matches the image on all sides)
  • Modify shape settings to "Use Contour Line"
  • Choose "Edit" from there
  • Check "Edit Contour Line"
  • Modify contour line to get 2mm spacing on each side of the image
  • Close Edit Window

This workflow is rather tedious and has to be redone for each image I add. Is there a way to simplify things and yet achieve the same result?

I tried to add an empty image frame with appropriate settings for the contour line to the library, but it seems that the contour line is reset as soon as an image is loaded into the frame (or the frame size is adapted to fit the image size).

a.l.e

introduction:

- in the document settings you can set some behaviors for the current document.
- in the preferences you can set behaviors for the documents you'll create in the future.

i'll just talk about settings in the rest of this post.

except i say otherwise, i'll refer to 1.4 (since you're not saying wich version of scribus you're using)

so: here a few pointers from my side:

1. with shift-click you can create an image that fills guides and margins.
   in 1.5 you can get items to snap to each others.
2. in the settings > tools > image you can check "scale image to frame"
3. ok
4-7. it's not a good idea to make images that do not fit the frame.
    you should rather make smaller frames.
    in the properties palette you can modify the size and position by doing calculations:
    - if the width is "20.45mm" just add "-2mm" and it will calculate the new size for you
    - you could also write (or ask for) a script that does this for you. it's probably quite trivial to do.

or, if the frames have always the same size:
4-7. - group a rectangle and an image frame and put them in the scrapbook
       - get the group from scrapbook and place it in your document (instead of creating a new frame)
       - with alt-click select the frame in the group
       - ctrl-i to get the image

there are probably further creative solutions to improve your workflow... hard to know wich one fits you best, without knowing what exactly you're doing...

GarryP

Welcome to the forum pck1980.

As far as I know, there's no way of automating exactly what you want via the Scribus UI. It might be possible with a script but that's not something I can help with.

There's no way to specify that a contour line should be constrained relative to (or "follow") the frame shape. So when you change the shape of the frame you have to resize the contour line.

To expand a bit on what a.l.e said, if your images are the same aspect ratio:
1. Create the image frame and import an image;
2. Use the Image to Frame Size and Frame to Image Size functions;
3. Draw a shape round the image that is slightly larger than the image and set its outline to have no colour;
4. Centre the image and shape together;
5. Raise the image to the top of the stack (important);
6. Group the image and shape;
7. Set the text flow for the group to Frame Shape.

You can now alt-click the group to select the image frame within the group, then use "File -> Import -> Get Image" to select a new image.
The replacement image should be imported without resetting the scaling and the text flow should be maintained.
You can resize the group but the "gap" between the image and shape will also be resized.

It's not great but it sort of works, as long as your images have a consistent aspect ratio (or you don't mind extra gaps).

pck1980

Thank you for your replies and sorry I obviously wasn't clear enough about what I actually want to achieve.

Basically, I just want to place images on pages with text so that the text flows around them. Additionally, I want...

  • ...the images to exactly fit the frame, but also keep the aspect ratio of the image
  • ...a contour line around each image frame that is some pixels larger so that there will be some spacing between text and image.

I tried to change the setting in Tools -> Images to "Scale image to frame", but this doesn't seem to make a difference when I insert images.

Perhaps I'm inserting image frames in the wrong way? I press "i" and "draw" some arbitrarily sized frame, then I choose an image for it. The image is then inserted, but not scaled at all, so I just see a "100%-crop" of the image inside the frame.
I then have to scale the image to the frame and the frame to the image to get what I want.


I'm using Scribus 1.5.3.


utnik

hi pck1980

Quote from: pck1980 on August 29, 2017, 03:36:35 PMI tried to change the setting in Tools -> Images to "Scale image to frame", but this doesn't seem to make a difference when I insert images.

you find these  settings at two different places – where did you change them?

       
  • 'preferences' → 'item tools' → 'images' → 'scaling' works for future documents.
  • for the current document, go to 'document setup' → 'item tools' → 'images' → 'scaling'.
utnik

GarryP

I can only say how things are in 1.4.6 but I don't think you're doing anything wrong, it's just that Scribus can't do what you want. It sounds like you're doing it right to me because that's the only way to do it.
If there was a global - but user-specified - "margin" setting that you could apply to your image frames then that might be a quick-and-dirty solution but there isn't one.
I'm afraid that, unless I've missed something, you will have to just continue doing what you're doing.

Nermander

Wouldn't one solution be to create an image fram with the desired properties and send it to the scrapbook, and use that instead?


a.l.e

hi pck1980,

can you please, share a sample .sla with some dummy text and a few dummy images where you show us the layout you want to achieve?

personally, i'd really avoid leaving a margin inside of the image and i would try to put the margin outside of the image.
i have a few ideas how to achieve it, but it much depends on the small details, how exactly i would do it.

the only point, where i don't see much chance for improvements, is the step where you crop the frame to the image size... i always do it with the context menu.

for the other points: there might or not be better ways of doing...

GarryP

Nermander, you're correct but only if the OPs requirements are met, which they can't be because Scribus doesn't work that way (see below).

a.l.e, the OP doesn't want to have a margin - padding - inside the image frame. They specifically say they want "the images to exactly fit the frame".

The issue, as I see it, is that there is the requirement to add image frames which all have the same behaviour where there is a consistent gap around the frame which defines how far away text flows around the frame no matter what shape and size the frame is.

Using the Frame Shape does not allow this, and neither does using the Bounding Box. The Contour Line allows this for a specific instance but the contour line, once edited, is automatically changed by Scribus proportionally to the size/shape of the bounding box of the frame.

This means that when the user edits the contour line for a frame, then duplicates that frame, then changes the size/proportions of the frame, the contour line will change proportionally too. They then have to edit the contour line for each frame. This is not what the user wants.

This is why I suggested we have a "margin" setting where the user can define a gap outside the frame that will stay a consistent distance no matter what the size and/or proportions of the frame.

This could be as simple as having an extra "Use Margin" text flow option - in the Shape tab of the PP - with a setting in Preferences where the user can define a preferred margin for all frames.

It could get more complicated than that but so far there have been no stated requirements for that extra complication. All the OP wanted was "to get 2mm spacing on each side of the image" as they "usually want to have the same properties for each image frame", so an application-wide setting would suffice for this and most uses. Having an individual setting for each frame would give the user more control but it's not been asked for yet.

Personally I don't think this is a particularly strange thing to ask for and implementation shouldn't be much more complicated than taking the existing bounding box, adding a specific distance to each side, and using that to control the text flow. Scribus already contains most of the code to do it - the contour line does this but in a slightly different way - it just needs a little bit of tweaking to do it a bit differently.

pck1980: If I have misrepresented your views/requirements in any way then I apologise. Maybe, as a.l.e suggested, you could attach something so we can get a better look at exactly what you want rather than just inferring it.

pck1980

Thanks again for all your suggestions. I created a 1-page-document that (hopefully) shows what I want to achieve.

[attachment deleted by admin]

GarryP

Since your sample file is from 1.5.3, and I don't use the developmental versions of Scribus, I'll let someone else have a look at it.

Note: If you are using a developmental version of Scribus then you will find it harder to get help as not as many people are using those versions as are using the stable version. You're not doing anything wrong, as such, but fewer users mean fewer people who can help. It's always better to use the stable version unless you really need one or more functions that the developmental versions have that the stable version does not. And even in these cases, it's generally recommended that you use the stable version to a point where you cannot get more done and then take a copy of your file to the developmental version to finish up. All-in-all though, it's your decision.

utnik

hi pck1980

in your uploaded file the images have the same dimensions.

i just tested  the way over the scrapbook:

       
  • set 'document setup' → 'item tools' → 'images' → 'scaling' to 'scale image to frame size'
  • check 'keep aspect ratio'
  • place an image frame with the desired dimensions
  • select 'properties' → 'shape' → 'use contour line'
  • edit the contour line to your needs and click 'ok'
  • right click on the frame and send it to the scrapbook
if all your images have the same dimensions, you can place hundreds of image frames from the scrapbook and all of them will have the same gap to the text and the loaded images will be scaled to match the frame at least in one direction.

btw. you should adapt the frame height to match with your text lines...

utnik

pck1980

Quote from: utnik on September 01, 2017, 07:21:04 PM
hi pck1980

in your uploaded file the images have the same dimensions.

i just tested  the way over the scrapbook:

       
  • set 'document setup' → 'item tools' → 'images' → 'scaling' to 'scale image to frame size'
  • check 'keep aspect ratio'
  • place an image frame with the desired dimensions
  • select 'properties' → 'shape' → 'use contour line'
  • edit the contour line to your needs and click 'ok'
  • right click on the frame and send it to the scrapbook
if all your images have the same dimensions, you can place hundreds of image frames from the scrapbook and all of them will have the same gap to the text and the loaded images will be scaled to match the frame at least in one direction.

btw. you should adapt the frame height to match with your text lines...

utnik

Sorry for my late reply. I just tried your suggestion, and it seems to work very well, even for images with a different aspect ratio (I can simply adapt the frame size to the image size after choosing an image).

Your solution greatly simlifies my workflow. Thanks a lot :-)

utnik

hi pck1980

Quote from: pck1980 on October 08, 2017, 03:54:20 PM...it seems to work very well, even for images with a different aspect ratio...

unfortunately it doesn't!
when you resize your frame, the contour line will be resized proportionally.
i.e. when you have an image frame of 40×50mm with 3 mm added at every side (contour line: 46×56mm) and you resize this frame for a 60×50mm image, the contour line will be 69×56mm...

as long as your images are almost of the same ar it may work (but it's not precise...)

utnik