View Issue Details

IDProjectCategoryView StatusLast Update
0011834ScribusScripterpublic2014-10-08 23:18
ReporterJLuc Assigned Togpittman  
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.4.3.svn 
Fixed in Version1.4.4.svn 
Summary0011834: provide image_align_in_frame.py
Descriptionimage_align_in_frame.py should be default provided with scribus because it provides a basic and simple functionnality that adds to the UI.

It should be edited first so as to display the result of the action immediately once it is performed (now, the user has to close the dialog first).
TagsNo tags attached.
Patch

Activities

JLuc

2013-11-11 15:55

developer   ~0030837

Last edited: 2013-11-11 15:55

AMOF it looks like the setRedraw(True) does not redraw anymore in 1.4.3

JLuc

2013-11-11 15:58

developer   ~0030838

Last edited: 2013-11-11 16:46

BTW display of the created dialog is not drawn at first launch : one has to hover the dialog with the mouse so as to see the radiobuttons.

gpittman

2014-01-28 02:05

developer   ~0031214

Last edited: 2014-01-28 02:06

I can't seem to get it to instantly Align with regularity.
I can delete the Done button, in which case you can do one Align operation per usage of the script, since the dialog will need to close automatically.

I think there are some oddities with Tkinter and Scribus that cause issues.

gpittman

2014-04-19 02:33

developer   ~0031700

I revisited this and found that the scaleImage command no longer works.

In addition, I have created a version not using Tkinter, using a valueDialog instead.

See the wiki page for these changes:

http://wiki.scribus.net/canvas/Align_an_Image_in_its_Frame

JLuc

2014-04-19 06:57

developer   ~0031701

Last edited: 2014-04-19 07:13

I tested the renewed version and found out that :

- the placement Top Left is OK but the other are not : placement is too short, as if the scale computation were wrong.

- the gtinker version only updates display when "Done" is pressed and its dialog can disappear in the background before job is done. These make it less handy.

JLuc

2014-04-19 07:45

developer   ~0031702

The scale problem is due to the units choice : script only leads to correct results when choosen display unit is "pt".

gpittman

2014-04-19 13:30

developer   ~0031708

I think I've fixed the units issue by switching and then switching back.

I don't know what to do about the tkinter waiting for Done.

JLuc

2014-04-19 14:36

developer   ~0031710

As for scales, new version is fine !

As for tkinter... if display refresh requires exiting the dialog, then i think its better to exit the dialog as soon as "Apply" is pressed, so as to have immediate visual feedback (in suche a case the "done" button is not required anymore).
+ Maybe there is a way to make the dialog modal ?

gpittman

2014-04-19 15:00

developer   ~0031711

Ok, here is a version for Tk that simply does away with the Done button. You click Align, script moves image, quits.

http://wiki.scribus.net/canvas/Align_an_Image_in_its_Frame#TkInter_Version_2

JLuc

2014-04-19 15:14

developer   ~0031712

It works fine now.
I'd suggest to add the wikipage url in the first line of the script.

gpittman

2014-04-20 00:47

developer   ~0031719

Align_image_in_frame.py has been added to 1.4.4svn

Link to wikipage in Usage notes.

gpittman

2014-04-20 02:08

developer   ~0031720

The script has a problem in that it cannot be used for more than one image frame at a time, since the scale ends up being the same for both...

For now, the script remains useful for one frame at a time, so will leave in 1.4.4svn.

gpittman

2014-04-20 02:32

developer   ~0031721

Last edited: 2014-04-20 02:33

Script is now fixed and committed in its fixed state.

The problem was that when you have more than one object selected, applications of setImageScale are applied to all.
The answer was to deselectAll after getting the list of selected objects, then select each object in the for loop, making sure to deselectAll once again after carrying out the align operation each time.

Will also update the wiki page with the current script.

christoph_s

2014-04-20 06:09

administrator   ~0031722

Thanks!

Issue History

Date Modified Username Field Change
2013-11-11 15:42 JLuc New Issue
2013-11-11 15:55 JLuc Note Added: 0030837
2013-11-11 15:55 JLuc Note Edited: 0030837
2013-11-11 15:58 JLuc Note Added: 0030838
2013-11-11 16:19 JLuc Note Edited: 0030838
2013-11-11 16:46 JLuc Note Edited: 0030838
2014-01-16 21:49 JLuc Tag Attached: script
2014-01-17 00:34 christoph_s Assigned To => gpittman
2014-01-17 00:34 christoph_s Status new => assigned
2014-01-28 02:05 gpittman Note Added: 0031214
2014-01-28 02:06 gpittman Note Edited: 0031214
2014-04-19 02:33 gpittman Note Added: 0031700
2014-04-19 06:57 JLuc Note Added: 0031701
2014-04-19 06:57 JLuc Note Edited: 0031701
2014-04-19 07:13 JLuc Note Edited: 0031701
2014-04-19 07:45 JLuc Note Added: 0031702
2014-04-19 13:30 gpittman Note Added: 0031708
2014-04-19 14:36 JLuc Note Added: 0031710
2014-04-19 15:00 gpittman Note Added: 0031711
2014-04-19 15:14 JLuc Note Added: 0031712
2014-04-20 00:47 gpittman Note Added: 0031719
2014-04-20 02:08 gpittman Note Added: 0031720
2014-04-20 02:32 gpittman Note Added: 0031721
2014-04-20 02:33 gpittman Note Edited: 0031721
2014-04-20 06:04 christoph_s Status assigned => resolved
2014-04-20 06:04 christoph_s Resolution open => fixed
2014-04-20 06:08 christoph_s Fixed in Version => 1.4.4.svn
2014-04-20 06:09 christoph_s Note Added: 0031722
2014-04-20 06:09 christoph_s Status resolved => closed
2014-10-08 23:18 Kunda Tag Detached: script