Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/12/2013, 04:58
quieropaginaweb
 
Fecha de Ingreso: noviembre-2012
Mensajes: 73
Antigüedad: 12 años
Puntos: 1
Pasar ImageBase64 a jpg

Hola como puedo hacer para pasar ImageBase64 a JPG?
Tengo este código (parte)+
Código HTML:
function OnLoad() {
        try {
		  if( !("ActiveXObject" in window) ) {
            document.getElementById("not_ie_warning").style.display="block";
  		    return;
          }
          print("CLEAR");
          var sigCtl = document.getElementById("sigCtl1");
          sigCtl.Licence = "AgAZAPZTkH0EBVdhY29tClNESyBTYW1wbGUBAoECA2UA";
          sigCtl.BackStyle = 1;
          sigCtl.DisplayMode=0; // fit signature to control
          print("Checking components...");
          var sigcapt = new ActiveXObject('Florentis.DynamicCapture');  // force 'can't create object' error if components not yet installed
          print("DLL: flSigCOM.dll  v" +   sigCtl.GetProperty("Component_FileVersion") + " ok");
          print("DLL: flSigCapt.dll v" + sigcapt.GetProperty("Component_FileVersion") + " ok");
          print("Test application ready.");
          print("Press 'Start' to capture a signature.");
          print("Enable image display.");
          var imgCtl = document.getElementById("imgCtl1");
          imgCtl.Licence = "AgAaALzhGEUEBVdhY29tClNESyBTYW1wbGUBAoEDAQNlAA";
		  
 imgCtl.ImageBase64 = "/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0a HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIy MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAPABADASIA AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3 ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3 uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD32WRI YnlldUjRSzMxwFA6kmsfSr661uYahGWg0oZ+zqVw9z/00bPRP7o6nqeMCsfXfB0+p+JEube5MOnX aBNTiDkecEIKgD36Hpxn1rsURY0VEUKqjAUDAA9KzTlKWqsl+J2zjRpUk4S5pSXb4e/zv+Gu70// 2Q==";
        }
        catch(ex) {
          Exception("OnLoad() error: " + ex.message);
        }
Código PHP:
<body onload="OnLoad()">
    <div style="width:100%">
      <h2>Test Signature Control with Image</h2>
      <div id="not_ie_warning" style="display:none">
        <h2>WARNING:</h2>
        This application is only supported by Internet Explorer<br/>
        (The Javascript uses ActiveX controls which are not supported by alternative browsers such as Firefox)<br/>
      </div>
      <table style="padding: 10px 90px;">
        <tr>
          <td rowspan="2">
            <div  ondblclick="DisplaySignatureDetails()" title="Doble click para ver los detalles">
              <object id="sigCtl1" style="width:60mm;height:35mm"
                type="application/x-florentis-signature">
              </object>
            </div>
          </td>
          <td  style="padding: 10px 50px;">
            <input type="button" value="Start" style="height:10mm;width:35mm" onclick="Capture()"
            title="Starts signature capture" />
          </td>
          <td rowspan="2">
            <!--<img src="wacomlogo-50pc.png" \>-->
            
<?php 


$sql 
"UPDATE contratos SET firma ='?????' WHERE id = '9191'";
$resultado mysql_query($sql) or die ("Problema con query");

?>

            
            <object type="application/x-florentis-img" id="imgCtl1">
              <param name="ImageBase64" value="/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0a HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIy MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAPABADASIA AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3 ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3 uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD32WRI YnlldUjRSzMxwFA6kmsfSr661uYahGWg0oZ+zqVw9z/00bPRP7o6nqeMCsfXfB0+p+JEube5MOnX aBNTiDkecEIKgD36Hpxn1rsURY0VEUKqjAUDAA9KzTlKWqsl+J2zjRpUk4S5pSXb4e/zv+Gu70// 2Q==" />
            </object>
          </td>
        </tr>
        <tr>
          <td style="padding: 10px 50px;">
            <input type="button" value="About" style="height:10mm;width:35mm" onclick="AboutBox()"
            title="Displays the Help About box" />
          </td>
        </tr>
      </table>
        <br/>
            <textarea cols="125" rows="15" id="txtDisplay"></textarea>
    </div>
Si es posible quisiera pasar de Base64 a Jpg y grabar la imagen el la base de datos. ¿Alguien que pueda echarme una mano?. Muchas gracias