Dimensions of the image

Why is it that when using
dlg.Control("dimensiones").value = item.metadata.image.picsize;
to display the dimensions of the image, the displayed value is 9397388447538

Try using item.metadata.image_text.picsize instead.

2 Likes

Perfect!!! :star_struck:

Now the problems are here :thinking:

dlg.Control(fecha_captura).value = item.metadata.image.datetaken;
dlg.Control(tamano).value = item.metadata.image.sizeauto;

It worked like this:
dlg.Control("fecha_captura").value = item.metadata.image.datetaken;
dlg.Control("tamano").value = item.size.fmt;

When I directly specify the width and height of an image, I get the size to resize correctly:

cmd.RunCommand('Image WIDTH=1920 HEIGHT=1080 PRESERVEASPECTRATIO HERE REPLACE'); 

But if I try to replace these values with the controls values, it doesn't work:

cmd.RunCommand('Image WIDTH=dlg.Control("ancho").value HEIGHT=dlg.Control("alto").value PRESERVEASPECTRATIO HERE REPLACE'); 

I have searched a lot here in the forum, and I have seen that I have to concatenate those values ( + ), but no matter how much I have tried I have not been able to do it. Does anyone know of a link where I can learn about that, thank you very much!

That's not how you add values into strings. You've put the actual code into the string.

I suggest a JavaScript tutorial to learn the basics of the language, then we can help with the Opus-specific parts.

True @Leo, thank you very much.

Working:

cmd.RunCommand('Image WIDTH="' + dlg.Control("ancho").value + '" HEIGHT="' + dlg.Control("alto").value + '" PRESERVEASPECTRATIO HERE REPLACE');