I am new to this forums. Recently I downloaded 1.3.1 final and noticed that some of my old planet maps were misaligned with the new version ones.
So I wrote this very simple Scheme Script (for the Gimp): you enter a value (it accepts angles and pixel offsets) and it performs a map rotation as needed
Code: Select all
define (script-fu-map-central_meridian img drawable inUnit inShift)
(set! theImageWidth (car (gimp-drawable-width drawable)))
(set! theImageHeight (car (gimp-drawable-height drawable)))
;Parameters in range?:
(if (and
(or
(and (<= inShift 360) (>= inShift -360) (= inUnit 0))
(and (<= inShift theImageWidth) (>= inShift (- 0 theImageWidth)) (= inUnit 1))
)
(not (= inShift 0))
)
(begin
(cond
((= inUnit 0) ;Angle
(set! theOrigin (* inShift (/ theImageWidth 360)))
)
((= inUnit 1) ;Pixels
(set! theOrigin inShift)
)
) ;Cond
(if (< inShift 0) ;Handle negative shifts
(set! theOrigin (+ theImageWidth theOrigin))
) ;if
(gimp-undo-push-group-start img)
(set! theOriginalLayer (car (gimp-image-get-active-layer img)))
(set! theCopyLayer (car (gimp-layer-copy theOriginalLayer FALSE)))
(gimp-image-add-layer img theCopyLayer 1)
(gimp-layer-set-offsets theCopyLayer theOrigin 0)
(set! theEnd (- theOrigin theImageWidth))
(gimp-layer-set-offsets theOriginalLayer theEnd 0)
(set! theOriginalLayer (car (gimp-image-merge-visible-layers img 1)))
(gimp-selection-none img)
(gimp-undo-push-group-end img)
(gimp-displays-flush)
)
(begin
(gimp-message "parameters out of range")
)
) ;if
)
(script-fu-register
"script-fu-map-central_meridian"
"<Image>/Script-Fu/Map Central Meridian"
"Shifts a cilindrical coordinated map in order to match central meridian requirements"
"Toti"
"2004"
"February 2 2004"
"RGB* GRAY* INDEXED*"
SF-IMAGE "Image: " 0
SF-DRAWABLE "Drawable: " 0
SF-OPTION _"Unit to use" '(_"Angle" _"Pixels")
SF-VALUE "Shift amount: " "90"
)
To use it, copy and paste it in your text editor. Then save it as any_name.scm in any of your Gimp <scripts> folders.
Run the Gimp, open an image and the script should be under the <image\script-fu> menu (press right mouse button over the open image, and go to Script-Fu).
I have tested it with 16K maps and it worked fine in my P3 256Mb RAM Win98 (after paging to disk for 10 minutes) so I expect it should work fine with 32K maps in more powerful systems
Please remember to backup your file before running this script on it
Hope it is useful