01-14-2020 17:56
01-14-2020 17:56
I read this older blog post, "https://dev.fitbit.com/blog/2018-05-09-introducing-the-imagepicker-and-image-api/"
that mentions the following:
"One approach which tends to work well is to convert the source image into a jpeg with medium compression (40-50), then use the JPEG API on the device to save the jpeg as a txi file. "
Now I'm trying to convert my existing bundled jpegs (located within `/resources` directory) to `.txi`, however not getting any luck.
Tried the following:
jpeg.decodeSync('bg-blue-348.jpg', outFileName)
Answered! Go to the Best Answer.
01-14-2020 21:32
Gold Fitbit Product Experts share support knowledge on the forums and advocate for the betterment of Fitbit products and services. Learn more
01-14-2020 21:32
Here's an extract from something of mine (that works):
const dataDir = "/private/data/";
jpeg.decodeSync('/mnt/assets/resources/0.jpg', dataDir+'0.txi');Unfortunately, that error you're getting is rather generic. It could mean unexpected JPEG format (eg, progressive), invalid destination directory, pre-existing destination file (and not using overwrite:true), and more.
Best Answer01-14-2020 18:02
Gold Fitbit Product Experts share support knowledge on the forums and advocate for the betterment of Fitbit products and services. Learn more
01-14-2020 18:02
Try /mnt/assets/resources/ instead of ./resources
Might also need file extension.
Best Answer01-14-2020 20:32
01-14-2020 20:32
Unfortunately, still no luck.
Best Answer01-14-2020 21:32
Gold Fitbit Product Experts share support knowledge on the forums and advocate for the betterment of Fitbit products and services. Learn more
01-14-2020 21:32
Here's an extract from something of mine (that works):
const dataDir = "/private/data/";
jpeg.decodeSync('/mnt/assets/resources/0.jpg', dataDir+'0.txi');Unfortunately, that error you're getting is rather generic. It could mean unexpected JPEG format (eg, progressive), invalid destination directory, pre-existing destination file (and not using overwrite:true), and more.
Best Answer01-14-2020 22:41
01-14-2020 22:41
Ah I see my mistake, I have my images located within resources/assets, so my absolute path was `/mnt/assets/resources/assets/<image>.jpg`, instead I was using `/mnt/resources/assets/<image>.jpg`.
Thanks @Gondwana !
01-14-2020 22:45
Gold Fitbit Product Experts share support knowledge on the forums and advocate for the betterment of Fitbit products and services. Learn more
01-14-2020 22:45
👍
Best Answer01-15-2020 01:15
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
01-15-2020 01:15
If you use PNG files in your project, they are automatically converted to TXI during the build process.
Best Answer