Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for a logo for a template #240

Closed
dselman opened this issue Nov 14, 2018 · 15 comments
Closed

Add support for a logo for a template #240

dselman opened this issue Nov 14, 2018 · 15 comments
Assignees
Labels
Type: Feature Request 🛍️ New feature or request

Comments

@dselman
Copy link
Contributor

dselman commented Nov 14, 2018

It would be very useful for display purposes if a Cicero template could contain an optional logo.

  • File is called: logo.png and is in the root of the template
  • Must be a PNG file
  • Maximum size is 256x256 pixels
@dselman dselman added the Type: Feature Request 🛍️ New feature or request label Nov 14, 2018
@dselman dselman self-assigned this Nov 14, 2018
@dselman dselman removed their assignment Mar 27, 2019
@mttrbrts mttrbrts self-assigned this Jul 26, 2019
@gagandeepp
Copy link

@dselman @mttrbrts is this still open,I can have a look into this?

@mttrbrts
Copy link
Member

Thanks @gagandeepp, yes, I'll release the assignment!

@mttrbrts mttrbrts removed their assignment Sep 27, 2019
@gagandeepp
Copy link

gagandeepp commented Oct 1, 2019

how to test this functionality?? @mttrbrts

@gagandeepp
Copy link

Any updates?

@jolanglinais
Copy link
Member

@mttrbrts pinging you again on this one.

@algomaster99
Copy link
Member

@jeromesimeon I would like to give this a try. :)

@jeromesimeon
Copy link
Member

There hasn't been any progress on this. It's yours @algomaster99 !

@jolanglinais jolanglinais linked a pull request Mar 19, 2020 that will close this issue
@jeromesimeon
Copy link
Member

jeromesimeon commented Mar 21, 2020

What should the proper internal representation for an image in the template or metadata class?

I am suspecting it shouldn't be a string. Should it be instead:

If we need manipulation of the image (or even simply know the image size) do we need support for a library. e.g., https://github.com/lovell/sharp ?

@jeromesimeon
Copy link
Member

Another open question: should the logo file be part of the hash calculated for the template?

@jeromesimeon
Copy link
Member

@Michael-Grover is there a logo for Accord Project templates that you would like? (Probably should be added to the templates in the library once the functionality is in place).

Would the 256x256 proposed size be right (e.g., if we want to use it on the template library Web site somewhere, or in the template library component in Cicero UI)?

@algomaster99
Copy link
Member

algomaster99 commented Mar 21, 2020

@jeromesimeon

Another open question: should the logo file be part of the hash calculated for the template?

Can you tell me why do we calculate hash? 😅

@jeromesimeon
Copy link
Member

@jeromesimeon

Another open question: should the logo file be part of the hash calculated for the template?

Can you tell me why do we calculate hash? 😅

It's a way to uniquely identify the content of the template (can be used to do sanity checks on downloads for example).

@Michael-Grover
Copy link

@Michael-Grover is there a logo for Accord Project templates that you would like? (Probably should be added to the templates in the library once the functionality is in place).

Would the 256x256 proposed size be right (e.g., if we want to use it on the template library Web site somewhere, or in the template library component in Cicero UI)?

Accord
@jeromesimeon how's this?

256x256 seems really big. What applications might we use for the logo that are 256 x 256, or 128 x 128 on a retina screen?

@jeromesimeon
Copy link
Member

jeromesimeon commented Mar 27, 2020

Summary of some fact-finding for png files size.

How to determine that the file is PNG:

How to determine the size:

const fs = require('fs');
const logoBuffer = fs.readFileSync('logo.png');

function calculate(buffer) {
    return {
        height: buffer.readUInt32BE(20),
        width: buffer.readUInt32BE(16)
    }
}

console.log(JSON.stringify(calculate(logoBuffer)));

On this logo:
logo

Trace:

bash-3.2$ node test.js 
{"height":128,"width":128}

@jeromesimeon
Copy link
Member

jeromesimeon commented Apr 1, 2020

Fixed by @algomaster99 and merged in #533 with some additional fixes in #535

Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Request 🛍️ New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants