Importazione immagini

samuelson

Nuovo Utente
3 Mar 2020
4
0
1
Buongiorno a tutti,
il vecchio "informatico" che ormai si è licenziato ha lasciato in sospeso questo progetto:

[edit mod - no link]

Si avvia con XAMPP in localhost, con servizio apache attivo.

Il problema è che quando si importa l'immagine per la modifica, mi piacerebbe che le foto venissero automaticamente ridimensionate con altezza e larghezza indicate da me e bloccate.


Grazie
 
Ultima modifica di un moderatore:

Max 1

Super Moderatore
Membro dello Staff
SUPER MOD
MOD
29 Feb 2012
4.449
338
83
@samuelson
Non inserire link!
Posta solo il codice che serve vedere
 

samuelson

Nuovo Utente
3 Mar 2020
4
0
1
Ci provo:

JavaScript:
 var updateImageWatermarks = function(watermark) {
      if ($scope.activeWatermark && $scope.activeWatermark.linked) {
        var imgHeight = $scope.activeImage.height;
        var imgWidth = $scope.activeImage.width;
        var percentTop = watermark.get("top") / imgHeight;
        var percentLeft = watermark.get("left") / imgWidth;

        var activeScale = $scope.activeImage.scale;

        var scaleX = watermark.get("scaleX");
        var scaleY = watermark.get("scaleY");
        var angle = watermark.get("angle");
        var opacity = watermark.get("opacity");
        $scope.current.opacity = opacity;

        var color, fontSize, fontFamily, text, backgroundColor;

        if (watermark.type == "text") {
          color = watermark.get("fontColor");
          $scope.current.fontColor = color;

          backgroundColor = watermark.get("backgroundColor");
          $scope.current.backgroundColor = backgroundColor;

          fontSize = watermark.get("fontSize");
          $scope.current.fontSize = fontSize;

          fontFamily = watermark.get("fontFamily");
          text = watermark.get("text");
        }

        $scope.images.forEach(function(image) {
          if (image != $scope.activeImage) {
            var objects = image.fabric.getObjects();
            var target = objects.find(function(wm) {
              return wm.wmid == watermark.wmid;
            });
            if (target && target.linked) {
              var targetWmTop = image.height * percentTop;
              var targetWmLeft = image.width * percentLeft;
              target.set("top", targetWmTop);
              target.set("left", targetWmLeft);
              target.set("scaleX", scaleX * (1 / image.scale) * activeScale);
              target.set("scaleY", scaleY * (1 / image.scale) * activeScale);
              target.set("angle", angle);
              target.set("opacity", opacity);

              if (target.type == "text") {
                target.setColor(color);
                target.set("fontSize", fontSize);
                target.set("fontFamily", fontFamily);
                target.set("backgroundColor", backgroundColor);
                target.set("text", text);
              }

              target.setCoords();
            }
          }
        });
      }
    };
 
Discussioni simili
Autore Titolo Forum Risposte Data
M [Photoshop] Problemi con importazione immagini trasparenti in indesign Photoshop 0
G Importazione file .sql Web Server 0
K Importazione e-mail da account gmail ad un altro account gmail Posta Elettronica 0
R Importazione csv su mysql tramite array PHP 2
Alex_70 sql importazione dati MySQL 0
FabioJ [mysql] importazione csv o json o excel Database 0
G Importazione PDF in Photoshop Presentati al Forum 0
F Importazione CSV in mySQL automatico PHP 1
M Problema importazione 3d su photoshop Photoshop 0
P Importazione dati da file xml in db mysql con php PHP 17
G [MySQL] Errore importazione tabella .sql #1062 - Duplicate entry '592' for key 'PRIMARY' MySQL 20
C [MySQL] errore nell'importazione tabella con file csv MySQL 0
A [CERCO] Programmatore per importazione dati da sito web Offerte e Richieste di Lavoro e/o Collaborazione 3
M Problema con l'importazione file csv PHP 3
Marco_88 Errore di importazione da terminale MySQL 0
F os commerce importazione file cv E-Commerce 0
L [tomcat 7] JSP e importazione jar esterni Apache 0
I osCommerce - L'importazione funziona? CMS (Content Management System) 0
D Importazione file CSV con delimitatori particolari (=" text " )per leading 0 PHP 0
G CSV importazione campo numerico PHP 11
P problema importazione tabella excel in visual studio 2008 .NET Framework 1
B importazione csv su mysql MySQL 1
mythar Importazione access va in errore Classic ASP 0
G importazione dump database MySQL 5
S Problema importazione tabelle WP CMS (Content Management System) 0
C [HELP] importazione video Flash 3
N Errore in fase di importazione sql MySQL 1
B Importazione video: da .mov a .flv Flash 5
JellyBelly Importazione dati da file excel PHP 2
J Importazione dati EXCEL Windows e Software 0
E Importazione file sql (restore/backup) MySQL 0
Z importazione di file txt con due campi e dati in mysql tramite phpmyadmin MySQL 1
mythar Importazione dati con MS-access MS Access 0
E Alterazione luminosità dell'immagine dopo l'importazione Flash 1
J importazione massaggi Outlook Express Windows e Software 0
N ostacolare importazione HTML e CSS 3
S [VB.NET]: Coordinate immagini dentro una PictureBox Visual Basic 0
G Perché il mio sito su Google news fa vedere le immagini degli articoli la mia foto profilo? WordPress 1
M Immagini non usate WordPress 0
elmonarca77 Utilizzo e licenze immagini Webdesign e Grafica 4
S Risoluzione Immagini e Connessione Joomla 0
G Il mio sito dopo aver abilitato l'ssl non visualizza le immagini con indirizzi senza ssl HTML e CSS 0
A WordPress e immagini Hosting 0
Y RITAGLIO IMMAGINI Javascript 0
R Immagini html HTML e CSS 2
E Come gestire al meglio le immagini legno grande formato Photoshop 0
M Random Immagini + Testi PHP 13
L form immagini per il database PHP 0
Ricky80 Coordinazione immagini HTML e CSS 4
P Percorsi e immagini. PHP 0

Discussioni simili