Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds fix_sigma_foveon_dngs script #578

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

steph72
Copy link

@steph72 steph72 commented Apr 4, 2025

script_data.destroy_method = nil -- set to hide for libs since we can't destroy them commpletely yet, otherwise leave as nil
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
script_data.show = nil -- only required for libs since the destroy_method only hides them

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create a namespace to contain the global variables and functions and then prefix sad_cameras, dt_fixed_tag and containse with it.

for example...

fsfd = {}

fsfd.sad_cameras =
fsfd.dt_fixed_tag =
function fsfd.contains(

fix_image()
dt.tags.attach(dt_fixed_tag, image)
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create a destroy function that destroys the darkroom-image-loaded event

local function destroy()
dt.destory_event("fix_sigma_foveon_dngs", "darkroom-image-loaded")
end

and then

scrpt_data.destroy = destroy

This lets the script be stopped and restarted without causing a problem because the event already exists.


dt.register_event("fix_sigma_foveon_dngs", "darkroom-image-loaded", fix_on_load)

dt.print_log("[fix_sigma_foveon_dngs] loaded")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return script_data at the end of the script so that script_manager has access to the metadata and the destroy function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants