Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Igor Alexandrov
    @igor-alexandrov
    Yo! I started to work on FastImage (https://github.com/sdsykes/fastimage) implementation for Crystal. I believe first release will be ready tomorrow.
    Wout
    @wout
    Cool! It's the first time I look at FastImage closer. Sounds like the perfect tool for the dimensions plugin.
    Igor Alexandrov
    @igor-alexandrov
    yes, this is why I want to implement it
    Igor Alexandrov
    @igor-alexandrov
    Here is the first iteration, we already can get type of image for both HTTP and File. Hope to implement dimensions later today.
    Igor Alexandrov
    @igor-alexandrov
    Ok, I just pushed an update, we can get dimensions for BPM, GIF, PNG
    Wout
    @wout
    Sounds all great! I hope to play with it later this week.
    Igor Alexandrov
    @igor-alexandrov
    Hey. I think we should remove pixie from a dependencies list (as well as awscr-s3) and move them to development dependencies. General idea is that plugin dependencies should not be required by default.
    Wout
    @wout
    Makes a lot of sense. If they want to use the plugin, they should include the shard themselves. 👍️
    Igor Alexandrov
    @igor-alexandrov
    Yes
    Igor Alexandrov
    @igor-alexandrov
    I hope that this evening I will have some time to integrate fastimage to StoreDimensions plugin. Also I am still working on migration of UploadedFile to IO.
    Wout
    @wout
    I'll pick up my work on Shrine next week. I have a deadline for this weekend so I haven't had the time to look at everything properly. But I'm really looking forward to it. :)
    Wout
    @wout
    Hey, from now on I'll have a bit more time to help on Shrine.cr.
    Let me know where you need help. Can I add more plugins, do some work on Lucky to ease implementation, ...
    Igor Alexandrov
    @igor-alexandrov
    Cool, I started working on Avram integration and also doing some refactoring
    I think that I will push everything I have tomorrow morning and we can discuss how it will be better to do with Avram
    Wout
    @wout
    Great. I'm really looking forward to having Shrine.cr available in Lucky.
    Igor Alexandrov
    @igor-alexandrov
    currently I create a small module that adds attachment macro
    module Shrine::Avram
      macro attachment(type_declaration)
        {% asset_name = type_declaration.var %}
    
        column {{ asset_name.id }}_data : JSON::Any
      end
    end
    and now I am somewhere in the middle of Operation integration
    Wout
    @wout
    Looks good. Do you think changes are required to Lucky for everything to work?
    Igor Alexandrov
    @igor-alexandrov
    To be honest – I don't know yet
    Wout
    @wout
    Ok :)
    Let's pick this up tomorrow once you pushed everything.
    Igor Alexandrov
    @igor-alexandrov
    Small question about forms: how to generate multipart: true form with form_for helper?
    I think, I've got it
    Wout
    @wout
    Probably something like: form_for Profile::Create, enctype: "multipart/form-data"?
    Igor Alexandrov
    @igor-alexandrov
    Yup, it works
    Wout
    @wout
    I'll create a PR for Lucky so we can do form_for Profile::Create, multipart: true, which is what most people would expect.
    Igor Alexandrov
    @igor-alexandrov
    But I have two problems with this:
    Wout
    @wout
    The first one is probably an easy fix. For the time being we can test with adding a regular param, but I'll tackle that.
    Igor Alexandrov
    @igor-alexandrov
    Maybe it is very easy to fix, but it is very annoying, since I cannot just upload an image now, I should add a Title or something else :)
    Wout
    @wout
    The second one is a bit harder to wrap my head around, but shouldn't that be needs instead of attribute? As in needs asset : Lucky::UploadedFile
    Maybe it is very easy to fix, but it is very annoying
    Absolutely!
    I'll try to fix it today, so we can maybe include it in the next release.
    Igor Alexandrov
    @igor-alexandrov

    I'll try to fix it today, so we can maybe include it in the next release.

    Great!

    What is the difference between needs and attributes?
    Wout
    @wout
    With needs, you define arguments for the initializer. I believe the only way right now to use files in operations is to pass them explicitly to the operation.
    Igor Alexandrov
    @igor-alexandrov
    Yes, I already got this. In Lucky room David pasted a link to Lucky extensions for the String.
    Wout
    @wout
    Great.
    Igor Alexandrov
    @igor-alexandrov
    My current idea is that we should add the same extensions to Shrine and this will give us an ability to do the following:
    class SaveImage < Image::SaveOperation
      param_key :image
    
      attribute asset : ImageUploader::Attachment
      attribute title : String
    end
    what do you think?
    Wout
    @wout
    Yes, that would be much better.
    Wout
    @wout
    @igor-alexandrov I've been looking at the issue you have with operations raising Lucky::MissingNestedParamError.
    Could it be you are calling the operation like this: SaveImage.create(params, upload)?
    Where params is empty and upload = params.nested_file?(:image)["file"]?
    Because the params are optional, so if you use SaveImage.create(upload), that should work without issues.
    Wout
    @wout
    I've opened an issue to document this: luckyframework/website#330
    Wout
    @wout
    The PR for multipart: true in form_for is waiting for approval: luckyframework/lucky#1200
    I'm now working on Avram to polish file uploads and I hop to get it finished this weekend.