FicImageScript


NameFicImageScript JSON
Version 4.1.0 PyPI version JSON
download
home_pagehttps://github.com/Jemeni11/FicImage
SummaryFicImage is an application designed to enhance the reading experience of FicHub epubs.
upload_time2024-04-17 12:47:48
maintainerNone
docs_urlNone
authorEmmanuel C. Jemeni
requires_python>=3.6
licenseMIT License Copyright (c) 2023 Emmanuel C. Jemeni Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords fanfiction fichub ficimage image
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            FicImage (aka FicImageScript)
=============================

FicImage is an application designed to enhance the reading experience of
FicHub epubs. With FicImage, users can easily add missing images to
their FicHub epubs, bringing the stories to life with vibrant visuals.
This user-friendly tool allows readers to fully immerse themselves in
their favorite fan fiction stories and enjoy them in a whole new way.

How to Use
----------

Installation with PIP
~~~~~~~~~~~~~~~~~~~~~

1. Install FicImage using ``pip install FicImageScript``.
2. After installation, run the program using
   ``ficimage -p path/to/epub -c path/to/ficimage/json`` where
   ``path/to/epub`` is the path to the **FicHub epub** you want to add
   images to and ``path/to/ficimage/json`` is the path to a file called
   **ficimage.json** . ficimage.json lets you configure FicImage. See
   more `in the configuration section below <#configuration>`__.

.. code:: shell

   (virt) nonso@HPEnvy:~/Documents/Code$ ficimage -h
    usage: main.py [-h] [-p PATH_TO_EPUB] [-c CONFIG_FILE_PATH] [-d] [-v] [-r RECURSIVE]

    Update a FicHub epub file with images.

    options:
      -h, --help            show this help message and exit
      -p PATH_TO_EPUB, --path_to_epub PATH_TO_EPUB
                            The path to the FicHub epub file.
      -c CONFIG_FILE_PATH, --config_file_path CONFIG_FILE_PATH
                            The path to the ficimage.json file.
      -d, --debug           Enable debug mode.
      -v, --version         Prints out the current version and quits
      -r RECURSIVE, --recursive RECURSIVE
                            This will update all files in the directory path given and its subdirectories
..

Image Support
~~~~~~~~~~~~~

`FicHub <https://fichub.net/>`__ creates EPUB 3.3 files, which means
that FicImage only save images in the following file format:

- JPEG
- PNG
- GIF
- WEBP
- SVG

See the `Core Media Types Section of the EPUB Version 3.3
Specification <https://www.w3.org/TR/epub-33/#sec-core-media-types>`__
for more information.

While FicImage can save SVG images, it can not compress them because
SVGs are not supported by Pillow.

FicImage uses
`Pillow <https://pillow.readthedocs.io/en/stable/index.html>`__ for
image manipulation and conversion.

By default, FicImage will try and save all non-animated images as JPEGs.

The only animated images that FicImage will save are GIFs and WEBPs.

FicImage does little to no processing on GIFs and WEBPs images. This is
to avoid breaking the animation.

If FicImage can not download an image, it leaves the image url paragraph
the same way it met it.

To configure image support, you will need to create a file called
``ficimage.json``. See the section below for more information.

Configuration
~~~~~~~~~~~~~

FicImage comes with a configuration file that allows you to customize
the program to your liking.

The configuration file is in the `JSON file
format <https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON>`__
and contains the following options:

-  ``compress_images``: A boolean that tells FicImage whether to
   compress images. This is only supported for ``jpeg`` and ``png``
   images.
-  ``default_image_format``: A string that tells FicImage what default
   format to convert and save images in. This is only supported for
   ``jpeg`` and ``png`` images.
-  ``max_image_size``: An integer that tells FicImage the maximum size
   of an image in bytes. If an image is larger than this value, FicImage
   will compress it.

FicImage checks for a configuration file in the given directory path. If
no directory path is given, FicImage checks the current directory and
then the Operating System’s home directory.

If it does not find one, it uses the following defaults:

.. code:: json

   {
       "compress_images": true,
       "default_image_format": "JPEG",
       "max_image_size": 100000
   }

..

   Note: The ``compress_images`` key is a boolean and can only be
   ``true`` or ``false``. Booleans in JSON are written in lowercase.

   Note: If the ``default_image_format`` key does not exist, FicImage
   will default to ``jpeg``. The two image formats are ``jpeg`` and
   ``png``. The ``default_image_format`` key is case-insensitive.

..

   Note: The ``compress_images`` key tells FicImage to compress images.
   This is only supported for ``jpeg`` and ``png`` images. This also
   goes hand-in-hand with the ``max_image_size`` key. If the
   ``compress_images`` key is ``true`` but there’s no ``max_image_size``
   key, FicImage will compress the image to a size less than 1MB
   (1000000 bytes). If the ``max_image_size`` key is present, FicImage
   will compress the image to a size less than the value of the
   ``max_image_size`` key. The ``max_image_size`` key is in bytes.

   If ``compress_images`` is ``false``, FicImage will ignore the
   ``max_image_size`` key.

..

   Warning: Compressing images might make the image quality worse.

   Warning: ``max_image_size`` is not a hard limit. FicImage will try to
   compress the image to the size of the ``max_image_size`` key, but it
   might not be able to compress the image to the exact size of the
   ``max_image_size`` key.

..

   Warning: ``max_image_size`` should not be too small. For instance, if
   you set ``max_image_size`` to 1 000, FicImage will probably not be
   able to compress the image to 1 000 bytes (1 KB). If you set
   ``max_image_size`` to 1 000 000, FicImage will probably be able to
   compress the image to 1 000 000 bytes (1 MB).

   Warning: FicImage will not compress GIFs or WEBPs, that might damage
   the animation.

TODO
----

-  ☒ Improve logs
-  ☐ Conversion to other FicHub supported formats from ePub.
-  ☐ More testing

Contributing
------------

Fork `this repo <https://github.com/Jemeni11/FicImage>`__ and get
started!

Links
-----

-  Me

   `LinkedIn <https://www.linkedin.com/in/emmanuel-jemeni>`__ •
   `GitHub <https://github.com/Jemeni11>`__ •
   `Twitter <https://twitter.com/Jemeni11_>`__

-  FicHub

   `Website <https://fichub.net/>`__ •
   `GitHub <https://github.com/FicHub/fichub.net>`__ •
   `Discord <https://discord.gg/sByBAhX>`__

   Without FicHub, this project would (obviously lol) not exist.

   Thanks to `iris <https://github.com/iridescent-beacon>`__ for helping
   me with this project as well.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Jemeni11/FicImage",
    "name": "FicImageScript",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "fanfiction, fichub, ficimage, image",
    "author": "Emmanuel C. Jemeni",
    "author_email": "\"Emmanuel C. Jemeni\" <jemenichinonso11@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/f2/b6/1b6e734e5167d3345872101ef9099231095938e6efb77f25ee472bde9acf/ficimagescript-4.1.0.tar.gz",
    "platform": null,
    "description": "FicImage (aka FicImageScript)\r\n=============================\r\n\r\nFicImage is an application designed to enhance the reading experience of\r\nFicHub epubs. With FicImage, users can easily add missing images to\r\ntheir FicHub epubs, bringing the stories to life with vibrant visuals.\r\nThis user-friendly tool allows readers to fully immerse themselves in\r\ntheir favorite fan fiction stories and enjoy them in a whole new way.\r\n\r\nHow to Use\r\n----------\r\n\r\nInstallation with PIP\r\n~~~~~~~~~~~~~~~~~~~~~\r\n\r\n1. Install FicImage using ``pip install FicImageScript``.\r\n2. After installation, run the program using\r\n   ``ficimage -p path/to/epub -c path/to/ficimage/json`` where\r\n   ``path/to/epub`` is the path to the **FicHub epub** you want to add\r\n   images to and ``path/to/ficimage/json`` is the path to a file called\r\n   **ficimage.json** . ficimage.json lets you configure FicImage. See\r\n   more `in the configuration section below <#configuration>`__.\r\n\r\n.. code:: shell\r\n\r\n   (virt) nonso@HPEnvy:~/Documents/Code$ ficimage -h\r\n    usage: main.py [-h] [-p PATH_TO_EPUB] [-c CONFIG_FILE_PATH] [-d] [-v] [-r RECURSIVE]\r\n\r\n    Update a FicHub epub file with images.\r\n\r\n    options:\r\n      -h, --help            show this help message and exit\r\n      -p PATH_TO_EPUB, --path_to_epub PATH_TO_EPUB\r\n                            The path to the FicHub epub file.\r\n      -c CONFIG_FILE_PATH, --config_file_path CONFIG_FILE_PATH\r\n                            The path to the ficimage.json file.\r\n      -d, --debug           Enable debug mode.\r\n      -v, --version         Prints out the current version and quits\r\n      -r RECURSIVE, --recursive RECURSIVE\r\n                            This will update all files in the directory path given and its subdirectories\r\n..\r\n\r\nImage Support\r\n~~~~~~~~~~~~~\r\n\r\n`FicHub <https://fichub.net/>`__ creates EPUB 3.3 files, which means\r\nthat FicImage only save images in the following file format:\r\n\r\n- JPEG\r\n- PNG\r\n- GIF\r\n- WEBP\r\n- SVG\r\n\r\nSee the `Core Media Types Section of the EPUB Version 3.3\r\nSpecification <https://www.w3.org/TR/epub-33/#sec-core-media-types>`__\r\nfor more information.\r\n\r\nWhile FicImage can save SVG images, it can not compress them because\r\nSVGs are not supported by Pillow.\r\n\r\nFicImage uses\r\n`Pillow <https://pillow.readthedocs.io/en/stable/index.html>`__ for\r\nimage manipulation and conversion.\r\n\r\nBy default, FicImage will try and save all non-animated images as JPEGs.\r\n\r\nThe only animated images that FicImage will save are GIFs and WEBPs.\r\n\r\nFicImage does little to no processing on GIFs and WEBPs images. This is\r\nto avoid breaking the animation.\r\n\r\nIf FicImage can not download an image, it leaves the image url paragraph\r\nthe same way it met it.\r\n\r\nTo configure image support, you will need to create a file called\r\n``ficimage.json``. See the section below for more information.\r\n\r\nConfiguration\r\n~~~~~~~~~~~~~\r\n\r\nFicImage comes with a configuration file that allows you to customize\r\nthe program to your liking.\r\n\r\nThe configuration file is in the `JSON file\r\nformat <https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON>`__\r\nand contains the following options:\r\n\r\n-  ``compress_images``: A boolean that tells FicImage whether to\r\n   compress images. This is only supported for ``jpeg`` and ``png``\r\n   images.\r\n-  ``default_image_format``: A string that tells FicImage what default\r\n   format to convert and save images in. This is only supported for\r\n   ``jpeg`` and ``png`` images.\r\n-  ``max_image_size``: An integer that tells FicImage the maximum size\r\n   of an image in bytes. If an image is larger than this value, FicImage\r\n   will compress it.\r\n\r\nFicImage checks for a configuration file in the given directory path. If\r\nno directory path is given, FicImage checks the current directory and\r\nthen the Operating System\u2019s home directory.\r\n\r\nIf it does not find one, it uses the following defaults:\r\n\r\n.. code:: json\r\n\r\n   {\r\n       \"compress_images\": true,\r\n       \"default_image_format\": \"JPEG\",\r\n       \"max_image_size\": 100000\r\n   }\r\n\r\n..\r\n\r\n   Note: The ``compress_images`` key is a boolean and can only be\r\n   ``true`` or ``false``. Booleans in JSON are written in lowercase.\r\n\r\n   Note: If the ``default_image_format`` key does not exist, FicImage\r\n   will default to ``jpeg``. The two image formats are ``jpeg`` and\r\n   ``png``. The ``default_image_format`` key is case-insensitive.\r\n\r\n..\r\n\r\n   Note: The ``compress_images`` key tells FicImage to compress images.\r\n   This is only supported for ``jpeg`` and ``png`` images. This also\r\n   goes hand-in-hand with the ``max_image_size`` key. If the\r\n   ``compress_images`` key is ``true`` but there\u2019s no ``max_image_size``\r\n   key, FicImage will compress the image to a size less than 1MB\r\n   (1000000 bytes). If the ``max_image_size`` key is present, FicImage\r\n   will compress the image to a size less than the value of the\r\n   ``max_image_size`` key. The ``max_image_size`` key is in bytes.\r\n\r\n   If ``compress_images`` is ``false``, FicImage will ignore the\r\n   ``max_image_size`` key.\r\n\r\n..\r\n\r\n   Warning: Compressing images might make the image quality worse.\r\n\r\n   Warning: ``max_image_size`` is not a hard limit. FicImage will try to\r\n   compress the image to the size of the ``max_image_size`` key, but it\r\n   might not be able to compress the image to the exact size of the\r\n   ``max_image_size`` key.\r\n\r\n..\r\n\r\n   Warning: ``max_image_size`` should not be too small. For instance, if\r\n   you set ``max_image_size`` to 1 000, FicImage will probably not be\r\n   able to compress the image to 1 000 bytes (1 KB). If you set\r\n   ``max_image_size`` to 1 000 000, FicImage will probably be able to\r\n   compress the image to 1 000 000 bytes (1 MB).\r\n\r\n   Warning: FicImage will not compress GIFs or WEBPs, that might damage\r\n   the animation.\r\n\r\nTODO\r\n----\r\n\r\n-  \u2612 Improve logs\r\n-  \u2610 Conversion to other FicHub supported formats from ePub.\r\n-  \u2610 More testing\r\n\r\nContributing\r\n------------\r\n\r\nFork `this repo <https://github.com/Jemeni11/FicImage>`__ and get\r\nstarted!\r\n\r\nLinks\r\n-----\r\n\r\n-  Me\r\n\r\n   `LinkedIn <https://www.linkedin.com/in/emmanuel-jemeni>`__ \u2022\r\n   `GitHub <https://github.com/Jemeni11>`__ \u2022\r\n   `Twitter <https://twitter.com/Jemeni11_>`__\r\n\r\n-  FicHub\r\n\r\n   `Website <https://fichub.net/>`__ \u2022\r\n   `GitHub <https://github.com/FicHub/fichub.net>`__ \u2022\r\n   `Discord <https://discord.gg/sByBAhX>`__\r\n\r\n   Without FicHub, this project would (obviously lol) not exist.\r\n\r\n   Thanks to `iris <https://github.com/iridescent-beacon>`__ for helping\r\n   me with this project as well.\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Emmanuel C. Jemeni  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "FicImage is an application designed to enhance the reading experience of FicHub epubs.",
    "version": "4.1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/Jemeni11/FicImage/issues",
        "Homepage": "https://github.com/Jemeni11/FicImage"
    },
    "split_keywords": [
        "fanfiction",
        " fichub",
        " ficimage",
        " image"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "622252e7ac9ee6c1d4793b4646379d4443531562f0c7dd8a6eb0f3481f1ce136",
                "md5": "b21ba27357aaa5041e5b50087b261f36",
                "sha256": "c36bb2a98a9556247a987279cc72cc3fd0b3396779d415ef05ff1f95002e7c00"
            },
            "downloads": -1,
            "filename": "FicImageScript-4.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b21ba27357aaa5041e5b50087b261f36",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 11799,
            "upload_time": "2024-04-17T12:47:46",
            "upload_time_iso_8601": "2024-04-17T12:47:46.274856Z",
            "url": "https://files.pythonhosted.org/packages/62/22/52e7ac9ee6c1d4793b4646379d4443531562f0c7dd8a6eb0f3481f1ce136/FicImageScript-4.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f2b61b6e734e5167d3345872101ef9099231095938e6efb77f25ee472bde9acf",
                "md5": "37778a6230ad37cb9dac67a5b029dff0",
                "sha256": "fbde2b7ff2ea1001c2ecc3b9309860de88123a17c8ae2cc24573b86efaf448b1"
            },
            "downloads": -1,
            "filename": "ficimagescript-4.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "37778a6230ad37cb9dac67a5b029dff0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 11623,
            "upload_time": "2024-04-17T12:47:48",
            "upload_time_iso_8601": "2024-04-17T12:47:48.001915Z",
            "url": "https://files.pythonhosted.org/packages/f2/b6/1b6e734e5167d3345872101ef9099231095938e6efb77f25ee472bde9acf/ficimagescript-4.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-17 12:47:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Jemeni11",
    "github_project": "FicImage",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "ficimagescript"
}
        
Elapsed time: 0.21347s