简体   繁体   English

图片库从外部服务器加载图像

[英]Image gallery loading images from an external server

I am trying to make a php image gallery where the script has to the following things: 我正在尝试制作一个PHP图像库,其中脚本必须执行以下操作:

  1. Connect to external server (http/ftp) 连接到外部服务器(http / ftp)
  2. scan directory "highres" 扫描目录“ highres”
  3. load images from directory "lowres" with same image name. 从目录“ lowres”中加载具有相同图像名称的图像。
  4. save low-res images on local folder 将低分辨率图像保存在本地文件夹中
  5. Show low-res images in gallery 在图库中显示低分辨率图像
  6. Download button for the high-res image 高分辨率图像的下载按钮

Can anyone point me into the right direction cause i dont know where to start. 谁能指出我正确的方向,因为我不知道从哪里开始。

Take a look at FTP with PHP and start with reading out the files in the Folder FTP Documentation 看一下使用PHP的FTP并从读取FTP文件文档中的文件开始

Then use ftp_get() to download the first Image and resize it with help of the GDlib , here is a tutorial for a thumbnailing function. 然后使用ftp_get()下载第一个图像并借助GDlib调整其大小,这是缩略图功能的教程 Or download all images at once and resize them all at once. 或一次下载所有图像,然后一次调整大小。

Now you are at the last step just show your thumbnail and link to the high-res images. 现在,您位于最后一步,只需显示您的缩略图并链接到高分辨率图像即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM