Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/445.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript/HTML如何更改';以JOT格式转换为GIF格式_Javascript_Image Manipulation - Fatal编程技术网

Javascript/HTML如何更改';以JOT格式转换为GIF格式

Javascript/HTML如何更改';以JOT格式转换为GIF格式,javascript,image-manipulation,Javascript,Image Manipulation,我有一个生成签名的应用程序。它是JOT格式的: 如何编写JavaScript函数将其转换为GIF格式 有人给了我这个C示例,但我不知道如何转换它 谢谢 void doJot2Gif(PODSObject *podsObj,const char* pBase64Data,const char* pFilename) { int len = (int)(strlen(pBase64Data)); if ( len > 0 ) { // make a copy of the JOT

我有一个生成签名的应用程序。它是JOT格式的:

如何编写JavaScript函数将其转换为GIF格式

有人给了我这个C示例,但我不知道如何转换它

谢谢

void doJot2Gif(PODSObject *podsObj,const char* pBase64Data,const char* pFilename)
{
 int len = (int)(strlen(pBase64Data));

 if ( len > 0 ) {

  // make a copy of the JOT data 
  unsigned char* ptrBuff = (unsigned char*)malloc(len+1);
  memset(ptrBuff,0,len+1);
  strcpy((char*)ptrBuff,pBase64Data);

  // append the GIF extension to the filename
  char gif_filepath[256];
  strcpy(gif_filepath,pFilename);
  strcat(gif_filepath,".GIF");
  HANDLE  hFile = FILE_OPEN((char*)gif_filepath);

  if (hFile == INVALID_HANDLE_VALUE) {
   return;
  }

  // call the routine that converts the JOT to the GIF and writes the file
  jottogif((unsigned char*)ptrBuff, hFile);

  free(ptrBuff);
  FILE_CLOSE(hFile);

 }

}

在您的代码示例中,所有有趣的事情都发生在这里:

// call the routine that converts the JOT to the GIF and writes the file
jottogif((unsigned char*)ptrBuff, hFile);
实际转换是通过此
jottogif
方法完成的。代码示例的其余部分几乎无关紧要,只是打开文件等,而不是操纵图像

这并不是JavaScript真正适合做的事情。我将创建一个Web服务来处理转换。JavaScript然后将JOT文件发送到webservice,并获取GIF文件作为响应


Web服务可以调用可用于此转换的任何现有工具/库。

在这个级别上工作时,不能只进行从C到JavaScript的映射。它们是为完全不同的事情而设计的。我将考虑使用另一种方法来获得文件的赠品,除非有人能想出一种简单的转换方法。可惜它使用了如此奇怪的格式。