Git Product home page Git Product logo

Comments (15)

buaazp avatar buaazp commented on July 24, 2024
  1. There is only IP access control in zimg now. If you need user verify funtion, you should modify post_request_cb() in zhttpd.c. But it's not easy.
  2. Changing file name is not a good idea because you need to modify both save_img() and get_img() funtions. The naming rules are in code. Ensure you won't miss anything about them.

from zimg.

 avatar commented on July 24, 2024
  1. for ssdb storage, is it using set or hset? can we modify this setting?
  2. md5 naming will not have collision? i would like to put timestamp into the filenaming... for easier sorting

from zimg.

 avatar commented on July 24, 2024

Can you please provide the server spec for this website:
http://demo.buaa.us/
CPU, memory usage will do.
thanks.

from zimg.

 avatar commented on July 24, 2024
  1. There is only IP access control in zimg now. If you need user verify funtion, you should modify post_request_cb() in zhttpd.c. But it's not easy.

is there any update in future for this function? zimg will get huge following and adoption if u can just implement those two features... 1, allow verification and api sending back response (header) modification 2, allow filename to be modified

great work by the way! thanks for the feedback.

from zimg.

 avatar commented on July 24, 2024

Is it possible to provide a script API call from php to frontend to zimg server for the uploading process?

e.g. zimg command line update or similar. This will open up a lot of options for people to use zimg

from zimg.

 avatar commented on July 24, 2024
  1. There is only IP access control in zimg now. If you need user verify funtion, you should modify post_request_cb() in zhttpd.c. But it's not easy.

is there anyways to make it easy with some integration with php api or something?

from zimg.

buaazp avatar buaazp commented on July 24, 2024

Zimg doesn't store users' data. Users' data is in your MySQL or other databases. How can I verify users without their data? Authenticate users in PHP first and then get images from zimg. Please think it over before asking.

from zimg.

 avatar commented on July 24, 2024

I mean only allow authenticated users to upload data. retrieval is fine.

from zimg.

buaazp avatar buaazp commented on July 24, 2024

I will try to implement a simple authentication in lua script.

from zimg.

 avatar commented on July 24, 2024

sounds great. node.js will be even better though.

from zimg.

lakeui avatar lakeui commented on July 24, 2024

How to use the zimg api to upload images , I mean How to use php get the json result ?

from zimg.

Niklas81 avatar Niklas81 commented on July 24, 2024

For me, authentication is best done with php before upload. However, it would be really helpful if filename could be set while uploading using curl. Using only an MD5 hash that I as a programmer has no insight into is bad practice, and would lock me into zimg. A much better solution would be if I can use e.g. this to upload a file and save as myfilname.jpg:

curl -F "[email protected];type=image/jpeg" "http://127.0.0.1:4869/upload?fn=myfilname.jpg"

And to download file by stating filename instead of md5, one could use perhaps:
http://127.0.0.1:4869/?fn=myfilename.jpg

If you must keep MD5, then this could also work just as before:

http://127.0.0.1:4869/[md5string]

That way everyone can use it as they like!

I'm also curious, if you save on local hdd, is processed image (e.g. resized) then still cached in local memory, so that the processing part only needs to happen once within a given time-window? Ideally, I would like to save files to a hard drive for more permanent storage, but I don't want the processing to happen on reoccurring requests. Also, I'm assuming that a local drive might as well be a remote drive mounted locally? That way you can use Gluster (http://www.gluster.org/) as a distributed storage.

Also, I have a concern regarding prevention of DDoS / overload-attacks. Since Zimg is loaded directly, I cannot do normal checks using nginx or php against e.g. ip address or session. So it would be really helpful if Zimg would have some features to handle this.

So, in summary:

Question 1: Any chance you could implement this naming-feature?
Question 2: Is caching being done when using local hdd as storage?
Question 3: Any way of preventing DDoS / overload-attacks? If not, any plans for implementing this?
Question 4: In terms of long-term maintainability, are you planning to maintain zimg for many years to come?

Best regards

from zimg.

buaazp avatar buaazp commented on July 24, 2024

@Niklas81 Thanks for you suggestions.

  1. The naming-feature depends on a map between MD5 and expect-name. I should use some way to store the map when POST images and query it before GET images which costs high latency. In fact, if you use zimg, you should store some related information like user name, password and any other data in the database. You can store the map of filename by the way. So, zimg will not support this feature.
  2. There is a memcached as cache in front of the hdd storage.
  3. Now zimg has no solution of preventing attacks. You can use zimg behind a nginx to achieve this target.
  4. I will maintain zimg until the new version of my image storage and processing system release. Which have most of features of zimg and is in developing.

from zimg.

buaazp avatar buaazp commented on July 24, 2024

@QSWL
using php-curl to post image to zimg: #45 and #97

from zimg.

r3wt avatar r3wt commented on July 24, 2024

@buaazp I like zimg so much, i release an opensource library for it for php soon

from zimg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.