Skip to content

Commit b9bda37

Browse files
committed
refactor generate alt button
1 parent 8ac9e15 commit b9bda37

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/openai_alt/openai_alt.module

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function openai_alt_image_field_process($element, &$form_state, $form) {
2525
// Add your custom wrapper while preserving the original prefix.
2626
$element['#prefix'] = $original_prefix . '<div id="' . $wrapper_id . '" class="ai-alt-field-wrapper">';
2727
$element['#suffix'] = '</div>' . ($element['#suffix'] ?? ''); // Ensure the original suffix is preserved.
28-
//dpm($element);
28+
//dpm($element);
2929
// Add the "Generate Alt Text" button.
3030
$element['ai_alt_text_generation'] = [
3131
'#type' => 'button',
@@ -175,7 +175,7 @@ function openai_alt_generate_alt_text_ajax($form, &$form_state) {
175175
return;
176176
}
177177

178-
//dpm($file);
178+
// dpm($file);
179179

180180
$file_uri = $file->uri;
181181

@@ -187,7 +187,7 @@ function openai_alt_generate_alt_text_ajax($form, &$form_state) {
187187
// Get the OpenAIApi instance and describe the image.
188188
$openai_api = openai_alt_get_openai_api();
189189
$generated_alt_text = $openai_api->describeImage($file_uri);
190-
//dpm($generated_alt_text);
190+
dpm($generated_alt_text);
191191

192192
// Update the alt text value.
193193
$form[$field_name]['und'][$delta]['alt']['#value'] = $generated_alt_text;

0 commit comments

Comments
 (0)