Resizing images to node width

Resizing images to node width

Postby iainkewley » Mon Dec 23, 2013 6:01 pm

We have a fair sized map (7000 nodes). Most of these have images attached using the Alt-K shortcut, meaning they can be resized on the fly. However it would be a great help if there was a script that resized them back to the maximum width for that node. Any ideas how we could do this?
iainkewley
 
Posts: 65
Joined: Sat Dec 22, 2012 11:17 am

Re: Resizing images to node width

Postby boercher » Wed Jan 08, 2014 9:27 am

boercher
 
Posts: 644
Joined: Tue Jul 26, 2011 7:13 am

Re: Resizing images to node width

Postby abc163 » Sat Jan 11, 2014 10:43 pm

I tried the script on images in the nodes inserted with the method of "Insert Inline Image" or "Add image". The image widths were larger or smaller than the maximum width of the nodes, but nothing happened when I executed the script. Did I misuse the script? The script is placed in the script folder of user directory, and my installed freeplane is version 1.3.6 beta pre05 on XP.

Regards,
abc
abc163
 
Posts: 56
Joined: Mon Dec 24, 2012 1:09 am

Re: Resizing images to node width

Postby boercher » Sat Jan 18, 2014 3:02 pm

abc,

you should first have a look at the log file if it shows some errors. The problem could be that you are using a too old Freeplane version - maybe an upgrade would help. If this doesn't help please prepare a small example map having this problem and zip it together with the image(s), and upload it here or in a PM so that I can test the problem.

Volker
boercher
 
Posts: 644
Joined: Tue Jul 26, 2011 7:13 am

Re: Resizing images to node width

Postby abc163 » Sat Jan 18, 2014 4:08 pm

Volker,

I tested the script in both Freeplane 1.3.6.beta.pre07 and 1.3.3_01 but no response. My OS is Win XP. Here I have attached a sample map and an image, and also the log files. The image was stored in the D drive. In the zip file I have also packed the map and image using Pack & Go add-on. I browse images everyday, so I strongly believe this add-on will help my work and I do appreciate your help. :)

abc
Attachments
Archive.zip
(890.81 KiB) Downloaded 52 times
abc163
 
Posts: 56
Joined: Mon Dec 24, 2012 1:09 am

Re: Resizing images to node width

Postby boercher » Mon Jan 20, 2014 7:02 pm

I have updated the resize script on the example scripts wiki page. Please try if it works better.

Volker
boercher
 
Posts: 644
Joined: Tue Jul 26, 2011 7:13 am

Re: Resizing images to node width

Postby abc163 » Mon Jan 20, 2014 8:34 pm

It works on the image attached to the node extension but not the core or details. Is this the way it is? I attach images mainly to the extension, so I am very happy with this script right now. Many thanks!

abc
abc163
 
Posts: 56
Joined: Mon Dec 24, 2012 1:09 am

Re: Resizing images to node width

Postby abc163 » Mon Jan 20, 2014 10:31 pm

It seems the script only works on bitmap images. Is it possible to make it also work on svg?

abc
abc163
 
Posts: 56
Joined: Mon Dec 24, 2012 1:09 am

Re: Resizing images to node width

Postby abc163 » Tue Jan 21, 2014 2:28 am

Volker,

I tested the script on svg and the log shows "can't determine image width for node ." I enclose here a map with svg files which I drew with inkscape and TpX drawing tool and also a log file, just in case you think it is possible to fix and worth making it work on svg. Thanks!

abc
Attachments
Archive.zip
(15.13 KiB) Downloaded 48 times
abc163
 
Posts: 56
Joined: Mon Dec 24, 2012 1:09 am

Re: Resizing images to node width

Postby boercher » Sun Jan 26, 2014 12:34 am

abc,

thanks for your feedback. I think I have a very general solution now that works independent on the type of image or of the link. I have updated the script on the example scripts page.

Volker
boercher
 
Posts: 644
Joined: Tue Jul 26, 2011 7:13 am

Next

Return to Open Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron