RSS/Atom feed Twitter
Site is read-only, email is disabled

Script-Fu Question about Saving Image to Network Share

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

Script-Fu Question about Saving Image to Network Share Tony Freeman 10 Mar 18:58
  Script-Fu Question about Saving Image to Network Share Sven Neumann 10 Mar 19:06
  Script-Fu Question about Saving Image to Network Share GSR - FR 10 Mar 19:29
Tony Freeman
2007-03-10 18:58:19 UTC (about 17 years ago)

Script-Fu Question about Saving Image to Network Share

Hello,

I'm writing a script-fu for use in my office. The idea is to reduce the amount of steps the user needs to take in order to save an acquired screenshot to our website.
*
*The problem I am having is that I cannot seem to save a file to an smb:// type address. This is the error I get when testing:

*[error] *Could not open 'smb://ldad_images/screenshots/web-image.png' for writing: No such file or directory Error while executing
(script-fu-Send-to-Web 1 "smb://ldad_images/screenshots/" "web-image.png") ERROR: Procedural database execution failed: (file_png_save2 1 1 5 "smb://ldad_images/screenshots/web-image.png" "web-image.png" 1 9 0 0 0 1 1 0 0) *[/error]*

The script works just fine if I save the image to a local drive such as '/tmp/'.

Also, if I type this in a terminal:

nautilus smb://ldad_images/screenshots/

A file browser opens just fine into the shared 'screenshots' directory.

If saving to a network drive is not possible (such as smb://), is there some other trick I could use to get the image over there?

Suggestions would be helpful :-)

Here's the code I have thus far:

*[code] *(define
(script-fu-Send-to-Web Image Location Filename)
; the directory our file will be saved in (set! SRCFilename (string-append Location Filename))
; scale the image to our optimum web size (set! width (car (gimp-image-width Image))) (set! height (car (gimp-image-height Image))) (if (> width 470)
(begin
(set! newHeight (/ (* 470 height) width)) (gimp-image-scale Image 470 newHeight) (gimp-displays-flush)
)
)

; add a drop shadow
(set! drawable (car (gimp-image-get-active-drawable Image))) (script-fu-drop-shadow Image drawable 8.0 8.0 15.0 '(0 0 0) 80.0 TRUE) (gimp-displays-flush)

; save as png file to our www directory on ldad (or wherever the user indicated) (gimp-image-merge-visible-layers Image 0) (gimp-displays-flush)
(set! drawable (car (gimp-image-get-active-drawable Image))) (file-png-save2 RUN-NONINTERACTIVE Image drawable SRCFilename Filename 1 9 0 0 0 1 1 0 0) (gimp-displays-flush)

; Close out the image
(gimp-display-delete Image)

; Let user know it's online
(gimp-message "Cool! Your picture is online. You may now include it in a 'Top News of the Day' article.") )

; Register the function with the GIMP: (script-fu-register
"script-fu-Send-to-Web"
"/NWS/Send To Web"
"Scales the image to 500px width and saves it to www images rsync directory on LDAD." "Tony Freeman"
"2007, National Weather Service, Louisville" "March 06, 2007"
"RGB* GRAY*"
SF-IMAGE "The Image" 0
SF-STRING "Location" "smb://ldad_images/screenshots/" SF-STRING "File Name" "web-image.png" )*
**[/code]*

Sven Neumann
2007-03-10 19:06:59 UTC (about 17 years ago)

Script-Fu Question about Saving Image to Network Share

Hi,

On Sat, 2007-03-10 at 12:58 -0500, Tony Freeman wrote:

If saving to a network drive is not possible (such as smb://), is there some other trick I could use to get the image over there?

GIMP 2.2 doesn't save to remote locations. You could try your luck with the 2.3 development version or use the command-line utility gnomevfs-mv to move the file to the SMB share.

Sven

GSR - FR
2007-03-10 19:29:23 UTC (about 17 years ago)

Script-Fu Question about Saving Image to Network Share

Hi,
tony@tonyfreeman.us (2007-03-10 at 1258.19 -0500):

If saving to a network drive is not possible (such as smb://), is there some other trick I could use to get the image over there?

Mount the network drive. You can use smbmount or fusesmb, for example. Then files will appear in the main tree, for all apps.

GSR