从我的网站下载后,在photoshop中打开JPEG/PNG图像 [英] Open JPEG/PNG image in photoshop when downloaded from my website

查看:91
本文介绍了从我的网站下载后,在photoshop中打开JPEG/PNG图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行的PHP Web应用程序,管理员可以在其中下载用户提交的图像文件.现在,我希望它以一种方式,当管理员将那些图像下载到他的PC中时,他应该双击该图像,如果已安装,它将在Photoshop中打开. 这可能吗? 或者有没有办法从jpg/png文件中写入psd文件? 我期待着您的答案.

I have a PHP web application running where admin can download the image files submitted by users. Now, I want it in a way that when admin downloads those images into his PC, he should just double click on that image and it should open in Photoshop if installed. Is this possible? Or is there a way to write a psd file out of jpg/png file? I'm looking forward for your answers.

谢谢

推荐答案

您可以使用PHP ImageMagick 扩展名,并将其作为PSD发送给 /a>使用其 MIME 类型的浏览器.

You can load a JPEG file using the PHP ImageMagick extension and send it as PSD to the browser with its MIME type.

我相信ImageMagick始终提供PSD支持,但请查看;我可能是错的.

I believe the PSD support is always available in ImageMagick, but check it out; I might be wrong.

然后,浏览器必须知道将该文件重新路由到PhotoShop. PhotoShop安装可能已经以这种方式进行了说明,但是您可能还需要配置浏览器.

Then, the browser must know to reroute that file to PhotoShop. It is likely that the PhotoShop installation already instructs it that way, but you may also need to configure the browser instead.

$image = new Imagick();

$image->readImage("myImage.jpg");

$image->setImageFormat('psd');
header('Content-type: image/photoshop');
die($image);

一种真正的肮脏的处理方式是定义"您自己的MIME类型:

A really dirty way of doing things is to "define" your own MIME type:

$jpeg = 'test.jpg';

Header('Content-Type: application/jpeg-with-photoshop');
Header('Content-Length: ' . filesize($jpeg);
readfile($jpeg);

浏览器将首次弹出一个窗口,显示"WTF?如何处理带photoshop的jpeg文件?!?".只需单击打开方式>选择应用程序>在磁盘上查找应用程序> clickety clickety单击> Photoshop",浏览器就会记住,并始终通过启动Photoshop来打开真正的JPEG文件.然后,Photoshop将对象识别为JPEG文件并正确打开它.

The browser will, the first time, pop up a windows saying "WTF? What do I do with a jpeg-with-photoshop file?!?". Just click "Open With > Choose Application > Find application on disk > clickety clickety click > Photoshop" and the browser will remember, and always open what is really a JPEG file by launching Photoshop. Photoshop will then recognize the object as a JPEG file and open it properly.

这篇关于从我的网站下载后,在photoshop中打开JPEG/PNG图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆