Git Product home page Git Product logo

Comments (8)

respondcreate avatar respondcreate commented on August 16, 2024 1

Hey @Mortal & @neic

I thought I released this last month but I forgot to upload it to PyPI! This has been fixed in the 1.6 release which you can now install from PyPI:

$ pip install django-versatileimagefield==1.6

Thanks for finding (and patching!) this bug! :)

from django-versatileimagefield.

GRLeo avatar GRLeo commented on August 16, 2024

Hello! I have the same issue

from django-versatileimagefield.

Mortal avatar Mortal commented on August 16, 2024

@GRLeo and others: We are going to use the fix in our fork until this issue is fixed in this repository.

from django-versatileimagefield.

respondcreate avatar respondcreate commented on August 16, 2024

Hey @Mortal !

I'd be more than happy to merge in the fix on your fork if it's ready. Would you mind writing some test coverage and some integration docs then submit a PR? If everything checks out I'll do a re-release to PyPI ASAP.

from django-versatileimagefield.

Mortal avatar Mortal commented on August 16, 2024

Hi @respondcreate, I added a unit test in TK-IT/django-versatileimagefield branch issue-54 now.

What are integration docs?

from django-versatileimagefield.

respondcreate avatar respondcreate commented on August 16, 2024

Hey @Mortal

By integration docs I mean writing some simple documentation about how the changes you've recently made will impact the end-user. Try to think in terms of a questions a developer would have if they wanted to have a custom upload_to for a VersatileImageField. Here's an example:

I have a custom upload_to function, how can I ensure images created by this field can be deleted with the file-deletion API?

I noticed that you've added a custom per-field regex so a good place to start would be to provide an example upload_to function and then how a regex could be written to match that.

Also: don't worry about adding it to the sphinx-built docs, you can just write it in a comment on your PR. Basically I'm looking for something I can use to get acquainted with the work you've done recently so I can write some proper documentation.

Does that make sense?

P.S. Thanks for taking the time to do this work, I (and the other users of this little app) appreciate it!

from django-versatileimagefield.

Mortal avatar Mortal commented on August 16, 2024

Hi @respondcreate,

Yes, it makes sense. I've opened pull request #62 with some additional information on what the user needs to do with my changes.

from django-versatileimagefield.

AlwxSin avatar AlwxSin commented on August 16, 2024

I'm not sure, is my bug related to this, but...
I have custom upload_to path.
But I'm not using subclassed SizedImage.
I have only several rendition key sets in settings like this

VERSATILEIMAGEFIELD_RENDITION_KEY_SETS = {
    'response_image': [
        ('full_size', 'url'),
        ('preview', 'thumbnail__45x45')
    ],
    'comment_image': [
        ('full_size', 'url'),
        ('preview', 'thumbnail__45x45')
    ]
}

And pre-warmer in post_save signal like this

@receiver(post_save, sender=ResponseImage)
@receiver(post_save, sender=CommentImage)
def warm_img(instance, **kwargs) -> None:
    img_warmer = VersatileImageFieldWarmer(
        instance_or_queryset=instance,
        rendition_key_set=instance.RENDITION_KEYSET,
        image_attr='image'
    )
    img_warmer.warm()

instance.RENDITION_KEYSET matches key in settings.

After I read #62 I suggest that my thumbnail images must contain thumbnail word in file name, but they doesn't.
And now I'm not sure, what should I fix.
I have no control on thumbnail image file names. Only on original image.
Should I subclass ThumbnailImage, redefine it filename_key_regex or filename_key? Or something else?

from django-versatileimagefield.

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.