Link in Zwischenablage kopieren
Kopiert
when I go to the image/square size menu
I select centimeters and enter a value of 10cm
when I convert the action instead of 10cm I find the value of 283.000000, I can't understand where I'm wrong
someone help me for this.
Your recent topics have been about UXP.
Now it seems that you are using legacy ExtendScript?
It all depends on the current resolution, I'm not sure if this helps or not?
var theRes = app.activeDocument.resolution; // PPI
var theUnitAsCM = (theRes/2.54); // 1 CM
alert("The resolution in PPI divided by 2.54:\r" + theUnitAsCM + "\r\rHowever, we can't have a floating value!");
oneCMasPX = parseInt(theUnitAsCM); // 1 CM to PX integer
alert("1 CM in PX at the current Res:\r" + oneCMasPX);
Link in Zwischenablage kopieren
Kopiert
That value is probably pixels, not cm. Photoshop is a pixel-based editor, inches and cm are derived values.
At 72 pixels per inch, 10cm would be 283.4 pixels.
Link in Zwischenablage kopieren
Kopiert
Thanks for the explanation
do you know how I could solve this problem
Link in Zwischenablage kopieren
Kopiert
I don't understand what the problem is. Please explain.
Link in Zwischenablage kopieren
Kopiert
And BTW there is no Image/Square Size menu
Link in Zwischenablage kopieren
Kopiert
My problem is this, I am creating a panel where there is an edittex, I need it to create a frame around the photo and I need it to be in centimeters, therefore a precision measurement, if I insert 5cm it must be 5cm and not 143. I hope I explained it well.
Link in Zwischenablage kopieren
Kopiert
I wanted to write canvas size Unfortunately the translator made a mess.
Link in Zwischenablage kopieren
Kopiert
You can set ruler units in your code, however, Photoshop is always using pixels as the native unit.
Link in Zwischenablage kopieren
Kopiert
Stefano I have tried all the methods but none of them work for me, What's the point of putting centimeters if you can't use it?
Link in Zwischenablage kopieren
Kopiert
You may not get exact centimeters. Photoshop uses pixels, if the resolution doesn't match you might get 4.99 cm instead.
And use an editnumber instead of edittext for your size.
Link in Zwischenablage kopieren
Kopiert
Pixels are the native unit of measure.
Canvas size and scripts allow for entry in inches, cm, mm etc., however, they are always going to need to be translated into pixels.
Link in Zwischenablage kopieren
Kopiert
Stefano ho scoperto che per realizzare 1 cm servono circa 29px a 72dpi in modo da poter creare una formula, ma non ho proprio idea di come crearla. hai qualche idea?
la formula è questa
cm x dpi: 2,54
1x72:2,54=28,34
How do I get the calculation done for example if I put 1cm in edittext how to do the formula to do the calculation.
Link in Zwischenablage kopieren
Kopiert
An example in this topic of ruler units in CM:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/resize-a-layer/td-p/10498297
Link in Zwischenablage kopieren
Kopiert
I thought it was simpler Now I'll see if I can find something more intuitive.
Link in Zwischenablage kopieren
Kopiert
Your recent topics have been about UXP.
Now it seems that you are using legacy ExtendScript?
It all depends on the current resolution, I'm not sure if this helps or not?
var theRes = app.activeDocument.resolution; // PPI
var theUnitAsCM = (theRes/2.54); // 1 CM
alert("The resolution in PPI divided by 2.54:\r" + theUnitAsCM + "\r\rHowever, we can't have a floating value!");
oneCMasPX = parseInt(theUnitAsCM); // 1 CM to PX integer
alert("1 CM in PX at the current Res:\r" + oneCMasPX);
Link in Zwischenablage kopieren
Kopiert
Stefano ormai mi conosci e sai che poi dovrò adattare il codice al mio pannello uxp Non sempre è possibile ma ci provo. Vi ringrazio per tutto l'aiuto che mi state dando, senza di voi non avrei fatto molto.
Stefano I found how to have the dpi of the open image.
thanks for everything
Link in Zwischenablage kopieren
Kopiert
Side note: the UXP DOM is entirely pixel-based (except in a handful of cases mostly related to text hyphenation, IIRC. There isn't a `UnitValue` class in UXP, so the sooner you swallow the pixel pill, the better 😉
Link in Zwischenablage kopieren
Kopiert
Davide thanks for your intervention
however, with a little effort you can achieve what you need, rightly you need a lot of documentation and study,
but I can say that little by little it can be done.
Link in Zwischenablage kopieren
Kopiert
Stefano ho creato un piccolo pannello UXP con la creazione di un bordo in centimetri,
se qualcuno ne ha bisogno può scaricarlo da questo link.
https://www.mediafire.com/file/1qo1cczjn75o8vt/CREATE_BORDER_UXP.zip/file
questa è l'interfaccia
Link in Zwischenablage kopieren
Kopiert
Thanks for sharing with everyone!
It reminds me something I've in the CC Marketplace (it was initially developed for internal use first, but then I decided to publish it): https://www.cc-extensions.com/plugins/canvas-master
Link in Zwischenablage kopieren
Kopiert
Davide, mine is nothing compared to yours,
yours is a masterpiece,
but I promise you that I will work hard to get closer to your professionalism
Thank you for all the help you give to the community
Link in Zwischenablage kopieren
Kopiert
@Ciccillotto - Thank you for sharing, I appreciate it and will look at the code as I'm inexperienced with UXP.
Machen Sie sich bereit! Im Januar erwartet Sie ein verbessertes Adobe Community-Erlebnis.
Mehr erfahren