Skip to content

Non-deterministic compression of some images #829

Open
@ashutosh1206

Description

@ashutosh1206

I just checked by uploading featuredPhoto in latest commit of capsule-vue and capsule-orbit, and I get the same photoCID each time. I did the same on this branch of capsule-orbit with latest commit of capsule-vue, same results.

After some additional investigation with @ashutosh1206, it seems that the compression output is nondeterministic for some images. One sign of this was that the file size of the compressed upload image was very slightly different between uploads, on the order of 0.01 KiB. To confirm, I updated the frontend to directly upload the featured photo without compressing it. With that update, a photo that previously had a different CID between uploads now had the same CID.

Curious to hear additional thoughts on what we can do on the compression side -- e.g. can we modify the function call to make the result deterministic (it doesn't seem so, based on the options you can pass to the function), use a different compression library/function, or possibly just not compress the images for now?

Originally posted by @dgrisham in https://github.com/capsulesocial/capsule-orbit/issues/421#issuecomment-1125237177

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogThings that are not actively worked on and won't be in the near future

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions