Closed reyaz006 closed 9 years ago
Ugoira support got included in latest HoneyView build 5.11 now - changelog.
I think I can add extra field in the animation.json for the original zip size.
Thanks!
I've set this before running:
writeugoirainfo = False createugoira = True
So far I can see that it now creates .zip and .ugoira. The .ugoira itself works fine.
As you already mentioned on the blog, modifying original .zip is not very good way, and I agree. But for a it to be a proper image, it would be a valid requirement to keep all data inside 1 file.
What I'd like to know:
Previously I thought that additionally allowing user change "animation.json" default string via config may be a good idea. But not anymore: keeping it fixed and simple might be better for format adoption. And what do you think?
Still thinking how to implement the checking :P
Well, since all files inside .ugoira are not compressed anyway, you may be able to read zipSize straight from the file.
Or are there difficulties with logic when user already has some ugoira downloaded as .zip?
Here is my batch script for converting existing pairs of .zip.js and .zip into .ugoira. It should do all the same job as the pixivutil20150315-beta1. Logic is less complex but it should provide exactly same result. If the functionality changes in later versions, I'll try to update it.
update 15.03.23: corrected error in get path
@echo off ::prepare vars set jsname=%1 set jsname=%jsname:"=% set zipname=%jsname:.zip.js=.zip% set ugoiraname=%zipname:.zip=.ugoira% ::make sure to only accept .zip.js echo %1 | findstr /C:".zip.js">nul && (goto :process) || (echo Not .zip.js! & pause & exit) :process ::get path for /f "delims=" %%F in (%1) do (set filepath=%%~dpF) for /f %%F in (%1) do (set rawpath=%%~dpF) ::get filesize of .zip for %%A in ("%zipname%") do set size=%%~zA ::change work directory to our base folder cd /d "%~dp0" ::display all collected info echo path: %filepath% echo raw path: %rawpath% echo .js path: %jsname% echo .zip path: %zipname% echo .ugoira: %ugoiraname% echo zipSize: %size% ::check if Windows can process the path properly (e.g. there are problems with U+3000) if not "%filepath%" == "%rawpath%" (echo Path contains illegal characters! & pause & exit) ::remove this pause for silent processing pause ::prepare animation.json copy /Y "%jsname%" animation.json ::put zipSize info inside animation.json fart animation.json ]} ],\"zipSize\":%size%} ::add animation.json into .zip 7za a -mx0 -tzip -mtc=off "%zipname%" animation.json ::rename .zip.js to .zip.js_processed ren "%jsname%" *.js_processed ::rename .zip to .ugoira ren "%zipname%" *.ugoira ::clean up del animation.json
Usage:
zipjs2ugoira.bat "C:\some path\123456_ugoira1920x1080 - title.zip.js"
Before testing beta2 with alwayscheckfilesize=true, should I convert all my Ugoira .zip+js to .ugoira?
I think you need to.
It check if the local zip file is exists and have the same size with server size, if true, it will skip the download and ugoira creation.
Tested it, found few issues:
Other than that, it works well for me.
There is also a minor problem upon exiting now:
Traceback (most recent call last): File "PixivUtil2.py", line 1756, inFile "PixivUtil2.py", line 1752, in main NameError: global name 'exit' is not defined
crap forgot to add os. :smile:
Recently, an image viewer for Windows named HoneyView received a support for viewing Ugoira animated format. It was per feature request and not present in the latest final build yet. Details here.
Right now, actual requirements in HoneyView for the file to be processed as Ugoira animation are:
Metadata is currently located in plain text on the image page on Pixiv, and it likely won't change any time soon. There won't be any official way to either save Ugoira zip as a file or animation, and metadata will stay in plain html text. So, maybe if there is enough demand from several 3rd party tools like downloaders and viewers, we may come to agreement over an unofficial way of keeping Ugoira animations as files.
Converting Ugoira to anything else is quite a problem (additional quality loss, playback difficulties), I'd rather see it as a proper animation format - "frames-in-zip" idea feels quite simple already.
I'd like to ask everyone interested to discuss this and possibly formulate the requirements for future use of these animations as files, hopefully in more tools.
There are several issues for now:
animation.json file requirement originates from here - this is a collection of bookmarklets that allow saving Ugoira as files in various formats. The first DL_zip bookmarklet links to the javascript that contains the code for converting metadata into the file and putting it into the original .zip:
This is by no means an official "way" of keeping the metadata (the said javascript is not made by Pixiv). The said javascript can be changed or wiped in future, so it may not produce animation.json anymore.
I think there are several options here that can be applied individually or together, to improve the situation:
EDIT: There may be another option (although highly unlikely):