Idea: Port LogoManager into common library and use it inside MP2-Server plugin (1 Viewer)

Status
Not open for further replies.

offbyone

Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    I didn't say that I would put them inside the db.The plan was to leave them a files. But this does not influence how they can be delivered. I can save an upload to DB and still give you a download link that looks like an file. The server can create zips or pngs or whatever we like from files, DB, memory...
    It is basically irrelevant how the data is stored on the Webserver, only matter is how is is accessible ;)

    Imho, creating a unique zip for every request of logos puts too much burden on the server in terms of processing power and memory usage.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #92
    And I've tried to refactor our plugin and extract common interfaces as you suggested but realized it's highly dependent of many settings, local paths and user actions.
    Did you try to follow my proposal? Let me know if you want do it, otherwise I would take the logic of image processing out and create new classes. But I want to avoid duplicated work, if you already over this task, I'll wait patiently :)
     

    Edalex

    Community Plugin Dev
  • Premium Supporter
  • January 3, 2008
    2,959
    1,270
    Saratov
    Home Country
    Russian Federation Russian Federation
    Did you try to follow my proposal? Let me know if you want do it, otherwise I would take the logic of image processing out and create new classes. But I want to avoid duplicated work, if you already over this task, I'll wait patiently :)
    I gave up even before your post so let's ask @Vasilich if he is on mission
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #94
    Here is my complete rework of image processing part. Be warned, it's not much left from former stuff. But the logic is now completely standalone and the caller can configure the render style as he wants.

    This is the main method and shows how to process a single file. The list of effects need to be filled as the external configuration is defined.
    Code:
        static void Main(string[] args)
        {
          // Define list of effects to be applied to source logo, order matters here. Add only effects that are enabled by configuration
          List<AbstractEffect> effects = new List<AbstractEffect>();
          effects.Add(new EffectResize { TargetSize = new Size(150, 150), MaxSize = new Size(150, 150) });
          effects.Add(new EffectfGlow { Color = Color.Red, Radius = 10 });
          effects.Add(new EffectfOuterGlow { Color = Color.Green, Width = 2, Transparency = 0.8f });
    
          string logoFile = "..\\..\\Simple\\1_plus_1_International.png"; // Source file
          string saveFileName = "Modern_1_plus_1_International.png"; // Processed file
    
          CreateLogo("Modern", logoFile, saveFileName, effects);
        }

    There are parts of code where I was not sure if I understood them correctly: should the EffectResize only resize images, if they are smaller or larger then a given limit? And then use a size that is given? Or other way said: it will keep a range of sizes in original, and resizes only if exceeding the limits?
     

    Attachments

    • LogoManager.7z
      38.4 KB

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #95
    I made further changes, placing the code into another class library project. Question is now: where should I commit my work to? Should I reuse your LogoManager repo, the MP2 repo or a completely new one on GitHub?

    Into this project also to webservice client methods will be placed into.
     

    Edalex

    Community Plugin Dev
  • Premium Supporter
  • January 3, 2008
    2,959
    1,270
    Saratov
    Home Country
    Russian Federation Russian Federation
    1 vote for new repo. Current repo already shared with another stuff, MP2 repo is not OK if this lib will be common for both MP1+MP2
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    I am happy with what you choose. Git, Svn or even tfs. I will push the service code / website to it.
     

    chefkoch

    Retired Team Member
  • Premium Supporter
  • October 5, 2004
    3,129
    1,634
    Dresden / Munich / Maastricht
    Home Country
    Germany Germany
    From building point of view I vote for git and a separate repository.
    You can start creating one under your github account or even use the team's organization for hosting.

    What about the name of the repo / namespace of the libraries, tools, services?

    Plugins for MP1 / MP2 can be kept in this repo and their references included as NuGet packages or the product specific plugins will be developed in each of the product's repo. Then the logo manager binaries have to be reference via NuGet packages.
    Not sure which of both ways is the better one. Pros and Cons for each of them.
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    General question: why is the LogoManager an MP1 and MP2 plugin, and not a TV engine plugin?
     
    Status
    Not open for further replies.

    Users who are viewing this thread

    Top Bottom