Donmai

Has there been a forum topic on Twitter videos?

Posted under General

Purely accidental, I learned the hard way that Twitter vids don't upload the same way ugoiras on Pixiv do.
(post #2110032 needs to be deleted)

If there's been a previous speaking on the matter of how to upload them (if it's even possible), can someone direct me to it?

Edit: Even more strange, it's (from the thumbnail) recognizing that it's a video, but that's it. Odd, man

It's a known issue. The next version will add support for uploading twitter videos, see issue #2494

KazuyaRazuKazama said:

Edit: Even more strange, it's (from the thumbnail) recognizing that it's a video, but that's it. Odd, man

That's because you tagged the post with animated. Posts with that tag get the ► icon whether they're actually animated or not.

Borrator said:

What about animated_png?

Too expensive to process. Imagemagick doesn't support APNG, so it'd require apngasm or some other external tool, and was deemed not important enough or something. I tried to make sense of these tools but gave up eventually as it seems there is no stable version. If someone's willing to look into it and write pull request and install instruction, it might get included, though.

Type-kun said:

Too expensive to process. Imagemagick doesn't support APNG, so it'd require apngasm or some other external tool, and was deemed not important enough or something. I tried to make sense of these tools but gave up eventually as it seems there is no stable version. If someone's willing to look into it and write pull request and install instruction, it might get included, though.

Here's a really simple proof of concept: https://gist.github.com/anonymous/0d7feca7e4beb89dafa1

Doesn't use any libraries, just reads the raw PNG chunk headers and looks for the animation control chunk, which all APNGs should have, based on the Wikipedia page for APNG. Returns 0 for APNG, 1 for non-animated PNG, 2 for not a PNG at all, and 3 if there's some error, so it's usable in a shell script, for example.

Note that it has pretty much zero error handling. A malformed PNG could very easily crash it. It is a proof of concept only. But I could make something real, if there's interest.

Also worth noting that it could easily work on a stream if necessary. It only needs to seek forward.

Updated

☆♪ said:

Here's a really simple proof of concept: https://gist.github.com/anonymous/0d7feca7e4beb89dafa1

Doesn't use any libraries, just reads the raw PNG chunk headers and looks for the animation control chunk, which all APNGs should have, based on the Wikipedia page for APNG. Returns 0 for APNG, 1 for non-animated PNG, 2 for not a PNG at all, and 3 if there's some error, so it's usable in a shell script, for example.

Note that it has pretty much zero error handling. A malformed PNG could very easily crash it. It is a proof of concept only. But I could make something real, if there's interest.

Also worth noting that it could easily work on a stream if necessary. It only needs to seek forward.

Neat, I didn't even think of processing the file manually. Your script should be easily convertible to pure Ruby, and it also seems possible to get number of frames from acTL header - single-frame APNG shouldn't get the tag. I'll try to get it together later if no one jumps in first :3

1