forked from jywarren/image-sequencer
-
Notifications
You must be signed in to change notification settings - Fork 209
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
Filetype extraction #19
Comments
ccpandhare
added a commit
to ccpandhare/image-sequencer
that referenced
this issue
Mar 16, 2017
As I have mentioned in Issue publiclab#19, `options.format` isn't defined initially. Hence it always gets assigned the value `png`. This doesn't go well with JPEG images. So I changed it to `jpg`. This does the trick temporarily but then alpha images aren't supported. So could this be implemented till we discuss publiclab#19?
Sure, that sounds good. As much auto-detection as possible is a good idea,
but we can also set a default (png?) since the images will be transcribed
to a canvas in many modules, and so the encoding won't be preserved
anyways. Some of this will start to affect our ideas about using diff
algorithms to quantify module behavior... colors will start to drift
slightly, etc. but the diff modules I've seen typically specify a
"tolerance" to account for this.
…On Thu, Mar 16, 2017 at 9:37 AM, Chinmay Pandhare (CCD) < ***@***.***> wrote:
Some modules might require the filetype.
I hadn't noticed that options.format is undefined, so:
options.format = options.format || "jpg";
always results in options.format to be equal to jpg.
Also, we can't only rely on extension of the file. For example, a jpg file
renamed as png would work perfectly fine otherwise, but when we set the src
for img, we do:
img.src = 'data:image/' + options.format + ';base64,' + buffer.read().toString();
so this might result in a faulty image.
Should we import the module file-type
<https://www.npmjs.com/package/file-type>?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#19>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AABfJ9UyC_pAuhSsYigmeZ8RtBl4TC1fks5rmTshgaJpZM4MfTwV>
.
|
We should think about it.
Can be problematic. |
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some modules might require the filetype.
I hadn't noticed that
options.format
is undefined, so:always results in
options.format
to be equal tojpg
.Also, we can't only rely on extension of the file. For example, a jpg file renamed as png would work perfectly fine otherwise, but when we set the src for img, we do:
so this might result in a faulty image.
Should we import the module file-type?
The text was updated successfully, but these errors were encountered: