【问题标题】:iTunes artwork data as html imageiTunes 艺术品数据作为 html 图像
【发布时间】:2012-04-12 10:16:02
【问题描述】:

我正在使用 PHP 中的 Applescript,尝试制作自己的 iTunes 遥控器。

现在我想将专辑封面添加到遥控器。 我知道我可以从 iTunes 获取艺术品数据到 PHP:

$ph = popen( "osascript", "w" );
fwrite( $ph, $artwork=`osascript -e 'tell application "iTunes" to data of artwork 1 of current track'` );
fclose( $ph );

Applescript 编辑器返回这一行:

«data JPEGFFD8FFE000104A4649460001010100...*more numbers*...2CEA245A3FFD9»

我想

<img src="data:base64,<?=$artwork;?>" />

应该做的伎俩...

我什至不确定 applescript 是否返回原始 JPG 数据,因为 iTunes 本身使用 .itc(iTunes 封面)文件。虽然返回的数据以 JPEG 开头... "«data JPEGFFD..."

【问题讨论】:

    标签: php image applescript itunes


    【解决方案1】:

    你试过图片标题吗?

    header("Content-Type: image/jpg");
    header("Content-Disposition: attachment; filename=image.jpg" );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-13
      • 1970-01-01
      • 2011-10-25
      相关资源
      最近更新 更多