I have a number of changes to consider for inclusion in my Github branch.
This fixes [bugs:#80].
use super for base class(es) init
It makes the switch to GTK+3 easier. On that subject I now have a working branch.
I think a switch to GTK+3 could be interesting for several reasons:
file handler: remove unnecessary scrolling calls
fix last issues dealing with empty/invalid archives
[wip] move ui code out of file handler
It would be nice to be able to test the file/image handlers, but dependencies on the UI make it impossible. Those changes improve the situation.
properties dialog: handle possible os.stat exception
Example: image file does not exist because of an extraction error.
[wip] fix parenting issue with dialogs
GTK+3 warns about this. Even with GTK+2, this result in dialogs being placed differently with my window manager.
This fix an issue with the library:
The wrong covers are sometimes displayed: because the view is sorted,
using paths does not work when items are reordered.
And 2 issues with the edit dialog:
- the thumbnail size for "imported" images
- thumbnails not being automatically displayed as each page
is extracted when the current archive is not already fully
extracted
fix "don't act on click to focus" handling
It was only working if the mouse pointer had passed over the main area;
i.e. the following sequence would not work correctly:
- focus out
- move pointer hover the thumbbar, "entering" the window from the left
- click on the thumbbar: => the page is changed
rework library thumbnails area
The right and bottom part were cut by 1 pixel, and missing the 1 pixel border.
osd: remove timer when clear is called
Needed for the next commit.
lens: clear osd when starting to use the lens
Avoid uggly artefacts when starting to use the lens with the OSD active.
main: fix weird transition when flipping page
This fix one of the issue mentioned in [bugs:#70]
image handler: fix set_page documentation
tools: simplify vector_add, vector_sub, and vector_opposite
constants: fix version compliance with PEP440
Now the version in the output of for example "python2 setup.py bdist_egg
" matches exactly.
I think MComix should follow the "Release early, release often" philosophy,
but for that we need to be able generate and test a new release (including
Windows) as easily as possible. The win32/wine-helper.sh
script make it
possible to develop, test, and generate the Windows version from Linux.
Usage:
./win32/wine-helper.sh command
Main commands:
win32/.wine
, with all the necessary dependencies for running MComix (Python, PyGTK, Pillow, czipfile, UnrarDLL, 7z, MuPDF), running the test suite (pytest and dependencies), and creating the Windows distribution (PyInstaller and dependencies).python.exe mcomixstarter.py
to test the Windows version of the current sourcesdist
win32/.wine-dist
and install the Windows distribution from dist
MComix.exe
from the Wine prefix in win32/.wine-dist
Note that the generated Windows distribution now also includes:
constants.SUPPORTED_IMAGE_REGEX -> image_tools.SUPPORTED_IMAGE_REGEX
Needed for the next commit.
[wip] better "use pil" version
If we want to re-enable the use of PIL instead of GDK for loading images on Windows, than this version is better:
image_tools.SUPPORTED_IMAGE_REGEX
and image_tools.is_image_file
now correctly work when PIL is used (e.g.: we get WebP support with Pillow 2.8.1)image_tools.pil_to_pixbuf
now keeps the orientation metadata (previously it was discarded on conversion)I added an hidden preference "use pil" for toggling the use of PIL over GDK. Maybe we could release a development Windows version and ask for feedback from our Windows user?
Things that can still be improved:
image_tools.get_image_info
should use PIL instead of GDK when "use pil" is set to prevent errors if a format is supported by PIL but not GDK.image_tools.get_supported_formats
: list of (format, mime type, extensions)
, to be used in file_chooser_main_dialog
for setting file filtersI also think we should remove the use of gettext for image formats in file_chooser_main_dialog
:
:::python
self.add_filter(_('JPEG images'), ('image/jpeg',), ('*.jpg', '*.jpeg'))
self.add_filter(_('PNG images'), ('image/png',), ('*.png',))
self.add_filter(_('GIF images'), ('image/gif',), ('*.gif',))
self.add_filter(_('TIFF images'), ('image/tiff',), ('*.tiff',))
self.add_filter(_('BMP images'), ('image/bmp',), ('*.bmp',))
Since it make it harder to support all formats if we rely on a dynamic list (generated by asking GDK/PIL).
Thank you very much for your help.
I just finished testing the current changes you made to fix the rotation issue. If I observed it correctly, it seems that there is still a bug: If you "flip horizontally" or "flip vertically" (or both) and the final rotation turns out to be either 90 degrees or 270 degrees (no matter how it happens, but I did not test Exif influences here), then the result turns out to be broken. It does not depend on other settings. That is, it is broken in any combination of manga mode, western mode, single page mode, double page mode, any auto rotation being turned on or off, or manual rotation, etc.
I am going to test the other changes as well.
Now that I have thought about it a bit more: Maybe the transformation is actually done the "correct" way, depending on how you define "correct". I assumed that it is (or rather should be) done this way:
But it seems that currently (that is, assuming the current behavior on branch
rotation
) all rotations are applied first and mirroring is performed last. The strange thing about this is that rotating manually several times looks awkward.I guess it depends on what you are trying to achieve with flipping. I think the order I just described above is more meaningful if you think of mirroring as some kind of "fixing" images that are mirrored for whatever reason. Also, if manual rotation is performed last, you can show images to other people more easily in a tablet-like setup.
What is your opinion here?
I did not touch that part. I personally would tend to prefer for the vertical/horizontal flip to be done last. What about the fact that it is applied individually? Do you agree with the fact that it should be applied to the virtual page? E.g.:
p1 p2
2p 1p
p2 p1
I also pushed a few more changes:
fixup! library: use tighter layout for book area
The earlier version made it hard to see which book was selected.
fixup! [wip] better "use pil" version
Fix
image_tools.get_image_info
to use PIL when applicable.image tools: add get_supported_formats
Return a dictionary mapping: { format name: (mime types, extensions) }
archive tools: add pdf_available/get_supported_formats
file chooser dialogs: rework filters code
This build the image filters using the list of supported formats returned by
image_tools.get_supported_formats
, so it work consistently when PIL is used.Similarly, the archive filters are built with the list of supported formats returned by
archive_tools.get_supported_formats
.Note: this add the missing PDF support.
update translations
Update the translations for the previous changes (filters). I also took this opportunity to update the french translation.
Note: I did not yet read your most recent post or changes. This post is about the
bpierre
branch up to1de8a490edf8e5d926a03420041fae478bfa3401
.I am really amazed at all these changes provided in this ticket, both the quality and the quantity are just awesome (at least as far as I can tell). Thank you very much. The changes seem to fix tons of issues while reducing LOC.
Okay, here are some more detailed comments on some of the changes:
Thumbnailer bugs:
A Thumbnail bug (possibly not really our bug):
The following bug can be reproduced using a file containing only NUL bytes, e.g.
Such a "NUL image file" is broken but it does not get any thumbnail in the thumbnailer. It seems that a zero-width zero-height image is being created as a "thumbnail" instead. The "broken image" icon should be used as a replacement here. (Note that completely empty files already get this replacement.) Also, if you use "File -> Properties" on such a file, you'll get an exception and some error messages. (The exception is not raised if the Properties dialog has already been opened beforehand.)
I think this change should not be made:
https://github.com/benoit-pierre/mcomix/commit/6d645433b792083e94e224d20e4097934120e4af
Reasoning: The old implementation does not need floating point arithmetic and also works if
n == 0
. (The new implementation raises an exception in this case.) If there is anything to improve in this function, you might want to addn = abs(n)
at the beginning of the function to make it work with negative numbers as well.I like how you make sure that the thumbnailer is wide enough to take all digits. (The old computation bugged me, too.) Also, with the new code, it seems that all thumbnails get the same "thumbnail size" according to the prefs. (There is a race condition in the old code that could lead to thumbnails being of different "thumbnail sizes" if you change this pref fast enough using the spinner, for example.)
You might want to present the "wine helper script" to Oddegamra so he can check whether the result works and looks as intended on a real Windows machine.
About this change: https://github.com/benoit-pierre/mcomix/commit/1de8a49
I somehow lost track of when PIL and when GDK is being used. What I'm wondering, however, is whether it is a good idea to expose
use_pil
to to the user and in the prefs file. I think the value of this setting should be determined when MComix is starting up and should not be exposed to the user (neither in the prefs dialog nor in the prefs file).However, if you think that the user should be able to select the image loader in future versions, it might be better to introduce a preference-ordered list instead of a boolean value, e.g.
["pil", "gdk"]
if PIL should be preferred over GDK, or["gdk"]
to enforce usage of GDK and disable any other image loaders. This way, the prefs might be more compatible to future changes, e.g. if a third image loader is being introduced.I still think, though, that at least for the upcoming release, this setting should not be exposed at all. Instead, we should rely on Oddegamra's evaluation and keep the "old" behavior, at least for now. Otherwise, we might need to wait for feedback, which takes time and delays things even further.
Once more on the GDK-or-PIL issue:
How about this: We introduce a pref "image loaders" that maps to a list and defaults to
with the following semantics:
Examples:
["gdk", "pil"]
prefers GDK over PIL.["pil"]
forces using PIL and disables GDK.["pil", "auto"]
currently behaves like["pil", "gdk"]
on all systems.["auto", "pil"]
currently behaves like["gdk", "pil"]
on all systems.["auto"]
currently behaves like["pil", "gdk"]
on Windows and["gdk", "pil"]
on other systems.This way, we can go for a new release without the need for a beta and, at the same time, allow (Windows) users to try out different image loaders. We could also add widgets to the Preferences dialog later, or, if this pref is of no use anymore, always fall back to
["auto"]
.What do you think?
Apparently not a regression: I get the same behaviour going back to at least 1.00. We'll look into it.
One transition I would really like to improve is when toggling fullscreen mode.
Not a bug, a feature! This is the "don't act on click to focus" code at work.
After investigation:
tarfile.is_tarfile(path)
returnsTrue
: the file is empty, so no cover can be foundDoh! The code should definitively handle
n <= O
. I don't think using floating point arithmetic is an issue. What matters most (to me) is to simplify the code.I'll send him a message.
I was thinking of using it only for a candidate/test release, to ask Windows users for feedback.
But then again, I could see value in exposing the setting to the user. Rational:
If we keep the setting (and expose it to the user) than the following should be done:
- change the setting to a string: "image loader", with possible values "pil" or "gdk"
- when exposing it to the user in the preferences dialog: show the version of each library, and the corresponding list of supported formats
Another possibility, but it would make the code even more complicated. Does that mean the code should attempt to load an image first with PIL, and then with GDK if the setting is set to
["pil", "gdk"]
? I'm worried about the possible performance implications.Note: I think part of the performance differences I was seeing between PIL and GDK was due to the bug in the code to reap zombie process. GDK still seems to be a little faster (at least on Linux), but it's not as clear cut as with the bug screwing with Python scheduling. GTK3 seems faster than GTK2 on Windows (with Wine). I should make a benchmark...
All in all I'm okay with releasing with
"use pil"/USE_PIL
set to True on Windows.For the most part only, I think. The only-flip-pages-if-already-focused part is okay. However, the scroll-thumbnailer-back-to-the-current-image-while-gaining-focus part is not really nice.
Agreed, I pushed a fix for this.
Now that I have thought about it even more, I wonder whether it's better to postpone the "use pil" issue to a later release. Reasons:
Thanks to your huge code refactoring, it might be possible to improve image processing itself now. Maybe we should start from there, analyzing and benchmarking first, while keeping in mind the GTK3 transition, so we can tell what the overall architecture might look like in the future. This way, we might be able to see when or where we are forced to use certain libraries, and when or where we do actually have a choice.
Related
Feature Requests: #92
I just had a look at the other changes up to
9039372958366f59d566096223bbca56d55eb592
. Just as the changes made earlier here, BIG LIKE! :-)About https://github.com/benoit-pierre/mcomix/commit/64898e9:
The
supported_formats
line for BMP uses a tuple instead of a list. Should be made consistent with the other elements. Also, a small refactoring would be nice: Remove the earlyreturn
ifUSE_PIL
and join this path with the finalreturn
statement (i.e. addelse
).Is there a way to add separators to the file filter drop-down box in the "Open" dialog? With or without such separators, I think reordering them a bit might be helpful, like this:
About the transformation issue: You are right. Sometimes, there are actual double-page images (i.e. single images that show two pages of a book next to each other). To make the transformations consistent with these cases, treating the result of the "double page" mode as a whole might be actually necessary. (The Exif-related transformation, i.e. rotation, should be performed on the individual images first, of course.)
I am not sure about the order, though. The main drawback of "rotation first, mirroring last", in my opinion, is that the rotation seems to be performed the other way around from the user's perspective. That is, for example, if "flip vertically" is currently turned on and the user selects "rotate CW", the image seems to be rotated CCW instead. That's why I prefer "mirroring first, rotation last".
A third option might be performing a single transformation on what is currently being displayed to the user ("add transformation"). While this might be the most intuitive way for the user, however, it might need more changes to the code.
Note that all three descriptions, "rotation then mirroring", "mirroring then rotation" and "add transformation" are equally powerful, since the all describe the same set of eight possible final transformations. Therefore, the (from my point of view most intuitive) "add transformation" approach might be the way to go. I am afraid that modifying the code for this to happen might take quite a while. On the other hand, we should not change the behavior of MComix twice here since users usually want to get used to a software and don't want to learn the ropes of it anew all the time.
Which one of these approaches do you prefer? I really like the last one.
Not only concerning that "third option" as mentioned above: Maybe we should switch to matrices to represent linear maps in general, converting them to other representations only if necessary. The reason is that matrices are more compact, more general, and many libraries (including Pillow) support or even need them anyway.
I attached a couple of functions that might help here, including an example demonstrating how to use them. (I hope that they work. Depending on how the coordinate system in use is oriented and which rotation direction is preferred, the
seq_table
must be designed accordingly.)What do you think about it?
Note that the functions are only designed to work with those 8 maps. Purely academic note: Function composition and these 8 maps form the finite dihedral group of order 8: https://en.wikipedia.org/wiki/Examples_of_groups#dihedral_group_of_order_8
2010 is ancient; admittedly the last release for PyGtk is only from 2012.
Also, I looked at the code for MComix-1.01, and icons are not loaded by PIL:
image_tools.load_pixbuf_data
is used, and its implementation uses GDK.To be clear: this is not about replacing some library for the other; the code still expects a GDK pixbuf after loading, and still switches to PIL for some operations. This is only about which one is used for decoding.
It's not about image loading being slow, rather it's about the possibility of making it faster.
The GTK3 transition does not change the architecture: 90% of it was just renaming stuff.
I was thinking the same thing:
Except when applying a mirror tranformation when an automatic rotation is already active, then it's the other way round: "rotation first, mirroring last" is more intuitive.
I tend to agree, but I need to think about this more.
Sure, I'm all in favor of simplifying the implementation, but we need to figure the specification first.
In the mean time, I reordered the commits in my branch to move the more "controversial" stuff toward the end (you can ignore the last 9 changes), and made a few more changes.
Here is a list of the commits in the right order (since Github does not handle rebase very well: commits are reordered chronologically):
8e066b5
: minor simplification in double page handlingbd6e99c
: main: minor cleanup4e638be
: use super for base class(es) init598d589
: file handler: remove unnecessary scrolling callscfd2ea0
: file handler: remove _must_call_draw hacka0f5a7c
: properties dialog: handle possible os.stat exceptiondde9d4b
: message dialog: small cleanup90e8e1e
: dialogs: fix parenting issuefe35f75
: library: minor cleanupc9ce380
: lens: fix border handling287f76d
: osd: remove timer when clear is calledce11831
: lens: clear osd when starting to use the lensc04e047
: main: fix weird transition when flipping page48cdf04
: image handler: fix set_page documentation73edb76
: tools: simplify vector_add, vector_sub, and vector_opposite58fde8b
: constants: fix version compliance with PEP440d608cca
: move constants.SUPPORTED_IMAGE_REGEX to image_tools2f48364
: image tools: add get_supported_formats8fe0064
: archive tools: add pdf_available7ceb7da
: archive tools: add get_supported_formatscdb1630
: file chooser dialogs: factorize image filters codea213ef3
: file chooser dialogs: rework image filters code7429e7e
: file chooser dialogs: rework archive filters code7bfa995
: file chooser dialogs: tweak archive/image filtersace7641
: thumbnail tools: allow disabling archive support99d57ea
: image handler: improve get_thumbnail0621695
: edit dialog: improve thumbnail creationdbe3043
: event: minor simplificatione3df8f3
: run: fix logger init + add debug/info levelsa63e47d
: main: fix draw_image prototype74904ed
: main: fix scrolling position on page changed17a24e
: test/image tools: add implied rotation test29ed6fe
: image tools: tweak get_implied_rotation documentation8ca6549
: test/image tools: update rotation test7d04261
: image tools: fix get_implied_rotation for PNG files67842e6
: image tools: factorize fit_in_rectangle/fit_pixbuf_to_rectangle7184036
: image handler: improve virtual double page detectionb12fd70
: status bar: fix visibility after initializationbbc0655
: ui: remove reference to file_load_failed4c46eed
: file manager: get rid of file_load_failedb125ce8
: file handler: make sure file_opened is calledc7258ab
: fix toolbar buttons sensitivitiesfe51370
: thumbbar: don't hide on clearb0de089
: main: rework handling of "toggle" widgetsaf657ea
: file handler: move (most) UI code out to mainf0a06b8
: main: improve info panel231f737
: worker thread: change semantics for dealing with unique ordersf8624b2
: thumbnail view: rework APIc4b01d8
: thumbbar: update to new thumbnail view API7624cd6
: library: update book area to new thumbnail view APIe393e8d
: edit dialog: update to new thumbnail view API5d4feb9
: thumbbar: fix active page displayda99567
: thumbbar: simplify layout size handling65fe44a
: thumbbar: small cleanup921891d
: thumbbar: cleanup895938b
: thumbbar: align selection on change5344ab6
: fix "don't act on click to focus" handling72f1c49
: library: cleanup book area codeee467f5
: library: avoid annoying 'row resizing' effect in book area5a6a324
: library: use tighter layout for book area13e2b5e
: messages: update translationsd098c6c
: messages: update french translation49f5cf7
: image tools: re-enable loading images with PIL on Windowsec26137
: tools: simplify number_of_digitse7775c5
: main: fix rotation handling1ca0c89
: portability: remove py2exe workaround81d9a35
: add wine-helper.sh scriptac8683a
: rundown.py4cdf28d
: gettext.shad624d0
: archlinux: add directory8a260aa
: [wip] main: handle possible segfault on resizedfa5fc3
: [wip] archive: fix tar unicode supporta111d0d
: [wip] drop py2exe support685b1f6
: [wip] win/install.txt11cdc95
: [wip] thumbnail tools: _thumbnail_exists; PIL -> GDKa4f8c38
: [wip] comicthumb: archive.ask_for_passwordThis way I can push up until the point you're okay with.
The changes compared the previous state are:
file handler: remove _must_call_draw hack
Not needed, as main.set_page() handles the redraw if needed.
file chooser dialogs: tweak archive/image filters
Only enable archive/image filters when applicable.
thumbnail tools: disable archive support when not applicable
This fix the issue you mentioned with a "null" image file.
run: fix logger init + add debug/info levels
Initialize logger earlier, so debug/info levels can be used when
importing some modules.
event: minor simplification
fix scrolling position on page change
Fix this issue:
When flipping to the previous page, and it's not available, then the
scroll position will be set to the start when it's finally drawn,
instead of the end of the page.
rework the UI code for handling the "toggle" widgets
I renamed some stuff to make the code more comprehensible, and fixed the previously mentioned issue:
When opening an empty archive, the OSD warning message can be scrolled
horizontally.
image tools: re-enable loading images with PIL on Windows
load_pixbuf_size
alpha handling when PIL is usedfix number_of_digits as per your comments
Related
Feature Requests: #92
Sorry to keep you waiting.
I think I understand what do you want to achieve, but I think that faster decoding simply is not enough. If you want to improve the performance of the application, you need to consider the "rendering pipeline" as a whole, from loading a file up to rendering pixels on the screen, including all the features and environmental issues. It does not help much if decoding is done fast if the final rendering turns out to be terribly slow.
Of course, it might be the case that everything you do always improves performance, and I really like to use "optimized" software. However, I'm simply not yet convinced that it will turn out as expected. We need to address this issue, I am totally aware of that. But we should do so for a later release and not now. (If you don't know what to do else, create a ticket for it and make a table that lists all visible and invisible features of MComix involved in image processing and, for each of them, states which libraries can implement this feature and which library is currently used for this feature. By "features", I mean "render on a widget", "decode", "only decode header", "caching", "magnifying lens", "calculate histogram", "affine transforms", "sharpening", "dynamic background color", "thumbnail creation" and so on.)
I see.
If it turns out to be highly complicated, a more useful ordering should be enough here.
You have a point there.
What kind of specification are you talking about?
Good idea. I need some time to review the changes since there are a lot of them. (I'm sorry to keep you waiting again.)
Okay, here you are, some comments: I like how you reduce dependencies (especially circular ones) and simplify code.
Changes that might need some improvement:
a0f5a7cc6c6dc6c81675e9e84c62343337e7382b
: Please extract file size formatting to a function intools.py
that maps an integer value to an appropriate string, e.g.12899
→"12.6 KiB"
.ec261376ae9dc52e018dc4ed42f658d55f7a8c16
: Ifn == 0
, it should return 1. (Zero is the only number where you need leading zeroes.)Changes I don't understand what they are for or why they are necessary:
ace7641e94510c0654f5a8a14935dcaf1218d3ad
231f73794ec3f549652e60828c460a1476bbbd85
Some bugs I just ran into (tested at
a4f8c38921190903eb6c31dd7097257273ca52aa
):PgDown
) until the thumbnailer shows pages far away from the beginning. Select File → Refresh. Instead of moving the viewport to the currently selected image, the thumbnailer displays the beginning of the book. More often than not, the thumbnails of these images will not be rendered (which is actually fine in this case since they should not be visible in the thumbnailer in the first place). Hovering the mouse cursor over them makes them appear one after another. No exception is thrown. It seems that this happens every time the current image has not been reached by a direct click on the respective thumbnail. PressingPgDown
or evenRefresh
, for example, are not "direct" enough.mcomix/images/mcomix-large.png
.F
(i.e. your "toggle fullscreen" key) pressed, you might end up with widgets visible in fullscreen mode./tmp
and copy it so you get dirs liketest1
,test2
,test3
, etc. Open one of them in MComix so you can switch to the other dirs by pressingPgDown
andPgUp
. Note that if you only usePgDown
, everything works fine. However, if you usePgUp
, the last NUL file of the dir you wanted to switch to is actually identified as an archive, resulting in "No images in 'test_nul.png'". If you pressPgUp
again, the dir that contains this NUL file is skipped (since the dir had been identified as an archive) but the next dir works fine (i.e. you'll skip every second dir this way). Note: This bug is already present in the current SVN revision.How MComix should handle transformations.
Please create a bug to track this for later.
Damn...
This is for the fix to the thumbnail issue: no broken image for a file containing only NUL bytes. Plus there is really no reason for the thumbnailer to check if each file is an archive when we're only feeding it images.
Needed for the following thumbnail code rework. The thumbnail orders are
(uid, iter
) tuples, but only theuid
identify the order uniquely.I cannot reproduce this.
Already fixed. I'm in the process of adding more tests to
test/test_image_tools.py
.I can't reproduce this on a4f8c38921190903eb6c31dd7097257273ca52aa, or Subversion. I can reproduce it with MComix 1.01; including the fact that the page may not be correctly rendered (e.g. adjust to width not taking into account the new fullscreen width, and a variation: the widgets stay hidden when ending up in windowed mode).
Looks like the same thing as the thumbnail "missing broken image" issue: testing for an archive type is performed first. In this case
tarfile.is_tarfile
will returnTrue
, hence the problem.Let's create a bug to track this for later.
I see. (I wonder whether the table I mentioned above might help us making a decision, too.)
Understood.
I see. Minor improvement: Please make the
archive_support
flag immutable, i.e. removeset_archive_support
and force all callers to set this flag on object creation. This might prevent bugs in the future.I see.
I'll try to either fix this myself or find the reason for why you have trouble reproducing it.
Okay.
If you manage to fix it for MComix 1.01, please include the fix in your branch so I can test it with my set up.
I think this is related to a behavior of MComix I never understood: If you start at
somedirA/archive.7z
and go to the next book viaPgDown
but there is no other archive insomedirA
next to the current one, you'll be taken tosomedirB
which is next tosomedirA
and has not have anything to do with the previous "shelf". If you go back usingPgUp
, you will see the images insomedirA
(something that was not possible when you were walking over the archives in it!) but you will not get to the archives insomedirA
. That is, MComix changed the interpretation ofsomedirA
from being a shelf (containing archive books) to a book (containing plain images).In other words, I don't understand why MComix tries to identify archives there in the first place. The
test*
dirs should be treated as books and MComix should not apply recursion on them (since these books are dirs and not archives). At least that's what I think MComix should behave. What do you think? (I guess this needs another ticket as well.)Understood.
This would make it inconsistent with the way other flags work (like
force_recreation
, orstore_on_disk
). How about changing the default toFalse
instead? This way archive support has to be explicitely enabled.Maybe a different window manager? Is it worth investigating / fixing? I've never had any problem switching in/out of fullscreen, so if the problem only happen when hammering the 'F' key, then it's not a big issue IMHO. It may also be a Linux only issue; as fullscreen support is complicated on Linux (X11 + window mangager + widget library...). I don't know if it behaves the same way on a real Windows machine, but the fullscreen transition when using Wine (with a simulated desktop) is clean: no ugly intermediate state.
I know I find the current behaviour with directories vs. archives handling confusing and complicated. My fist instinct would have been to handle a directory like an archive. But then there is the recursive behaviour, which might not be ideal in this case, especially if the tree contains archives.
For the record: I created [bugs:#83] for the "directories vs. archives handling" issue.
Related
Bugs: #83
I think that changing the default does not improve much. I'd prefer it the other way around: Eliminate the setters you mentioned. It seems that both
set_force_recreation
andset_store_on_disk
are only called directly after object creation. Thus, it should be easy to move the flag setting to the constructor and remove the setters instead. Less state → more functional → fewer bugs.Well, yes and no. Fixing would be nice since it's not really "hammering" you need for this to happen. (4 keystrokes per second are sufficient in my case.) Also, it does not happen with MComix 1.01. On the other hand, it's not that problematic. I'm investigating.
Concerning this fullscreen issue:
git bisect
identifiedb0de0895b4d0d87150242b70c6e34ff9a1138426
as the culprit. Unfortunately, this commit is quite big. I just played around with it a little. Adding one or both of the following lines to the end ofchange_fullscreen
inmain.py
does not fix it, it only make it less likely to happen:Also, resizing the window forces the widgets to be re-laid out correctly, both if they are not visible when they should be (after switching to windowed mode) and if they are visible when they should not be (after switching to fullscreen).
I'm further investigating. If you have any ideas concerning this issue, I'd be glad to read them.
Another bug I just found: While in double page mode, the window title bar and all widgets except the main viewport always behave as if there are currently two images visible, even if there should be only one image opened. As already said, only the main viewport behaves correctly.
git bisect
identifiedaf657ea1266b8f0dfe9a3333a1fd8c402b509658
as the first bad commit in this case.Yes, not the right fix, as the GTK documentation states:
So I would leave this part of the code as is.
Ok, so I've pushed some more changes:
fixup! tools: simplify number_of_digits
fixup! file chooser dialogs: tweak archive/image filters
fixup! file handler: move (most) UI code out to main
This fix the virtual double page information in the status bar.
add more tests for the image tools module, and fix the associated bugs discovered
wine helper: simplify test command
Use new testsuite runner.
wine helper: install fixed mimetypes module on setup
wine helper: update distribution documentation
simplify thumbnail API
Remove the various setters that change the thumbnailer behaviour:
move the flags to the constructor.
main: fix horizontal/vertical flip handling on double pages
Flip the whole virtual page, instead of flipping individual pages.
I think the way transformations are handled at this point is good enough, the final behaviour is similiar to MComix-1.00 (rotations first, flipping last), with a few differences:
I think that having the horizontal/vertical flip being done last makes sense: horizontal flips the page left/righ, while vertical flips up/down. And again, this is the same behaviour as MComix 1.00, extended to support double page mode.
Sorry to keep you waiting. The current
bpierre
branch (up toe56439073feade9d606e33ae04a81e28d9b87d16
) looks promising. It seems to fix the fullscreen issue I mentioned earlier along with many issues discussed in other threads. Thank you very much.I have to admit that, though, that it's quite difficult to keep track of the changes thanks to history rewrites. But maybe I'm simply using the wrong tools. May I ask you which tool(s) you are using? Plain Git CLI or some more sophisticated wrapper/GUI/whatever?
About transformations: Okay, let us keep it this way. It still feels a bit strange for me if I seemingly rotate everything the other way around if there is some kind of flipping involved, but it does not look buggy anymore.
Some bugs that are still present: