Skip to content

Some questions about BitmapΒ #70

@Means88

Description

@Means88

STORAGE_DIR is removed after build, however it is shared between instances. If I'm processing a and b at the same time, bitmaps added to b will be lost after a.build().

fs.removeSync(STORAGE_DIR);

We may use os.tmpdir() if the directory is used temporarily. For developers who want to control the storage (like me πŸ˜„), they can specify the STORAGE_DIR environment and clean up manually.


const fileHash = md5File.sync(args.filePath);

The filename of a bitmap looks like a sha1 hash because it has 160bit length (40 * 0~f). But it's different from the sha1 of original image or the image inside sketch file, so I don't know how it is generated exactly (maybe it doesn't matter).

I wonder whether images from different sketch file can get conflicted (different bitmap with the same filename)? Or we can just assume that different image has a different filename?


BitmapLayer is exported from 'bitmap/index.d.ts', which is not the same as 'bitmap/index.js'

export interface BitmapLayer {

It should be the declaration for 'index.js' like declare class Bitmap { ... }

I checked some of my sketch files and didn't find any layers with _class: bitmapLayer (and not found in sketch-hq/sketch-file-format). Is there anything I've missed, or just some mistakes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions