Forgot password?
 Create new account
Author: hbghlyj

Asymptote测试

[Copy link]

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2024-2-27 20:39:11
看來錯出在上游,我們這邊没法做任何事
ERROR: invalid optimizer module

Comment

只能暂时改成 png 图了,画质差点总比没有强  Posted at 2024-2-27 21:18

2

Threads

465

Posts

6357

Credits

Credits
6357
QQ

Show all posts

爪机专用 Posted at 2024-2-27 20:46:11
hbghlyj 发表于 2024-2-27 20:39
看來錯出在上游,我們這邊没法做任何事
ERROR: invalid optimizer module
有没有替代方案?
I am majia of kuing

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2024-2-27 22:32:45
可以在服務器上安裝TeXLive和Asymptote,像我的網站一樣

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

kuing Posted at 2024-2-27 22:57:34
hbghlyj 发表于 2024-2-27 22:32
可以在服務器上安裝TeXLive和Asymptote,像我的網站一樣
你的网站装了?那可以改为将链接连接到你的服务器传回图片吗?(我一窍不通……

Comment

但那邊用的是canvas不是圖片,不能直接连接,需修改……  Posted at 2024-2-27 23:37

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2024-2-28 16:06:19
hbghlyj 发表于 2023-2-18 12:22
检查这个svg发现它内含一个base64的jpg
Asymptote三维图不能输出矢量图, 只能输出位图.
在3D圖,SVG不如PNG,因為base64更長,下載更慢吧

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

kuing Posted at 2024-2-28 16:26:45
Last edited by kuing at 2024-2-28 16:37:00asymptote.ualberta.ca 这个在线的还能用吗?我这边就输入一个 import venn; 点 Run 都报错

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

kuing Posted at 2024-2-29 14:58:13
hbghlyj 发表于 2024-2-27 23:07
我們先等等,不做任何操作,也許過一陣子就好了😀
果然等等就好了😁
楼上的在线链接也能正常使用了

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

kuing Posted at 2024-11-7 21:44:30
又挂了……原因不明,啥也没改……

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2024-11-11 04:51:32
Last edited by hbghlyj at 2024-11-11 12:37:00
kuing 发表于 2024-11-7 13:44
又挂了……原因不明,啥也没改……

reqbin.com 測試:
服務器的響應竟然什麼內容都沒有!只有HTTP 标头,沒有任何內容:
Screenshot 2024-11-11 123445.png
Content是空的:
Screenshot 2024-11-11 123656.png

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

kuing Posted at 2024-11-11 11:11:26
但是 asymptote.ualberta.ca 还是好用的,只是发送出了问题?你研究一下呗,用你的网站测试一下

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2024-11-11 18:02:26
kuing 发表于 2024-11-11 03:11
但是 asymptote.ualberta.ca 还是好用的,只是发送出了问题?你研究一下呗,用你的网站测试一下 ...
编写简短的 php 脚本进行测试

  1. <?php
  2. $url = 'http://asymptote.ualberta.ca:10007?f=pdf&render=4';
  3. $data = 'import teapot;';
  4. $options = [
  5.     'http' => [
  6.         'header'  => "Content-type: application/x-www-form-urlencoded\r\n",
  7.         'method'  => 'POST',
  8.         'content' => $data,
  9.     ],
  10. ];
  11. $context  = stream_context_create($options);
  12. $result = file_get_contents($url, false, $context);
  13. file_put_contents('teapot.pdf', $result);
  14. ?>
Copy the Code
成功得到輸出 teapot.pdf,沒有問題!

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2024-11-11 18:08:32
这次和上次不同,上次故障出现在上游,只需等待即可,而这次上游工作正常,我想等待并不能解决问题。

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

kuing Posted at 2024-11-11 20:01:31
hbghlyj 发表于 2024-11-11 18:02
编写简短的 php 脚本进行测试

成功得到輸出 teapot.pdf,沒有問題!
目前本站的 /asy/index.php 的代码为
  1. <?php
  2. if(empty($_GET['format'])){$f='svg';}
  3. //if(empty($_GET['format'])){$f='png';}
  4. elseif($_GET['format']=='svg'||$_GET['format']=='png'||$_GET['format']=='html') {$f=$_GET['format'];}
  5. $url = "http://asymptote.ualberta.ca:10007?f=".$f;
  6. if(isset($_GET['code'])){
  7. $curl = curl_init($url);
  8. curl_setopt($curl, CURLOPT_URL, $url);
  9. curl_setopt($curl, CURLOPT_POST, true);
  10. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  11. $headers = array(
  12.    "Content-Type: text/plain",
  13. );
  14. curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
  15. curl_setopt($curl, CURLOPT_POSTFIELDS, $_GET['code']);
  16. $resp = curl_exec($curl);
  17. curl_close($curl);
  18. if($f=='svg'){header( 'Content-type: image/svg+xml' );}
  19. if($f=='png'){header("Content-Type: image/png");}
  20. print($resp);
  21. }
  22. ?>
Copy the Code

应该怎么改?

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2024-11-11 20:16:44
kuing 发表于 2024-11-11 12:01
目前本站的 /asy/index.php 的代码为

应该怎么改?
我原样在本地(Windows) 执行,竟沒出錯!
Screenshot 2024-11-11 121625.png

您也可測試一下,把文件命名為Untitled-1.php,本地(Windows)運行
  1. c:\php\php-cgi.exe Untitled-1.php code="import venn;" f="svg"
Copy the Code
我這邊是正常的

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2024-11-11 20:20:17
kuing 发表于 2024-11-11 12:01
目前本站的 /asy/index.php 的代码为

应该怎么改?
是不是上游把infinityfree禁了

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2024-11-11 20:24:08
kuing 发表于 2024-11-11 12:01
目前本站的 /asy/index.php 的代码为

应该怎么改?
建議測試一下,InfinityFree编译完的PHP有沒有设置支持cURL 扩展?否則curl_exec這些都無效了

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2024-11-11 20:25:49

如何检查 curl 是否已启用或禁用

  1. echo function_exists('curl_version');
Copy the Code

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2024-11-11 21:38:08
Last edited by hbghlyj at 2024-12-13 16:35:00

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

kuing Posted at 2024-11-11 21:49:36
你是意思是在 /asy/ 下面再新建一个 php 文件,如 test.php,内容是 echo function_exists('curl_version'); 然后进入 /asy/test.php 看看输出啥是吗?

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

kuing Posted at 2024-11-11 21:55:09
kuing 发表于 2024-11-11 21:49
你是意思是在 /asy/ 下面再新建一个 php 文件,如 test.php,内容是 echo function_exists('curl_version ...
进入 kuing.cjhb.site/asy/test.php,结果是 1

手机版Mobile version|Leisure Math Forum

2025-4-20 12:23 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list