You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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().
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.
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'
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?
The text was updated successfully, but these errors were encountered:
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 spoke someone at Sketch about this. They do use sha1, but that Sketch might process the data from the file before hashing it which is why I never got a consistent hash value. They said the filename probably doesn't matter though.
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.
Very nice suggestion :)
If we have not STORAGE_DIR environment variable specified -> use temporary directory, like it 👍
STORAGE_DIR
is removed afterbuild
, however it is shared between instances. If I'm processinga
andb
at the same time, bitmaps added tob
will be lost aftera.build()
.sketch-constructor/models/Sketch/Sketch.js
Line 176 in c945f56
We may use
os.tmpdir()
if the directory is used temporarily. For developers who want to control the storage (like me 😄), they can specify theSTORAGE_DIR
environment and clean up manually.sketch-constructor/models/Bitmap/Bitmap.js
Line 80 in c945f56
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'sketch-constructor/models/Bitmap/index.d.ts
Line 15 in c945f56
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?The text was updated successfully, but these errors were encountered: