FicImage


NameFicImage JSON
Version 1.0.3 PyPI version JSON
download
home_pagehttps://github.com/Jemeni11/FicImage
SummaryFicImage is an application designed to enhance the reading experience of FicHub epubs.
upload_time2023-05-08 22:29:10
maintainer
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

## Introduction
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
1. Download FicImage by cloning this repo.
2. Install the dependencies using `pip install -r requirements.txt`.
3. Run the program using `python3 ficimage.py path/to/epub 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 [below](#configuration).
4. Enjoy your new and improved epub!

### 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:
    
```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
- [ ] Conversion to other FicHub supported formats from ePub.
- [ ] More testing 
- [ ] Improve logs


## Contributing
Fork the repo and get started!


## Links

- Me
  
    [LinkedIn](https://www.linkedin.com/in/emmanuel-jemeni) • [GitHub](https://github.com/Jemeni11) • [Twitter](https://twitter.com/Jemeni11_)

- FicHub

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

  [Website](https://fichub.net/) • [GitHub](https://github.com/FicHub/fichub.net) • [Discord](https://discord.gg/sByBAhX)

  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": "FicImage",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "fanfiction,fichub,ficimage,image",
    "author": "Emmanuel C. Jemeni",
    "author_email": "\"Emmanuel C. Jemeni\" <jemenichinonso11@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/0b/cb/6d62497a5e2cad2b0690f11cdf7b9179f46386db9b1b4190789411c46886/FicImage-1.0.3.tar.gz",
    "platform": null,
    "description": "# FicImage\n\n## Introduction\nFicImage 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.\n\n## How to Use\n\n### Installation\n1. Download FicImage by cloning this repo.\n2. Install the dependencies using `pip install -r requirements.txt`.\n3. Run the program using `python3 ficimage.py path/to/epub path/to/ficimage/json` where `path/to/epub` is the\npath to the **FicHub epub** you want to add images to and `path/to/ficimage/json` is the path to a file called\n**ficimage.json** . ficimage.json lets you configure FicImage. See more [below](#configuration).\n4. Enjoy your new and improved epub!\n\n### Image Support\n\n[FicHub](https://fichub.net/) creates EPUB 3.3 files, which means that FicImage only save images \nin the following file format:\n- JPEG\n- PNG\n- GIF\n- WEBP\n- SVG\n\nSee 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.\n\nWhile FicImage can save SVG images, it can not compress them because SVGs are not supported by Pillow.\n\nFicImage uses [Pillow](https://pillow.readthedocs.io/en/stable/index.html) for image manipulation and conversion. \n\nBy default, FicImage will try and save all non-animated images as JPEGs.\n\nThe only animated images that FicImage will save are GIFs and WEBPs.\n\nFicImage does little to no processing on GIFs and WEBPs images. \nThis is to avoid breaking the animation.\n\nIf FicImage can not download an image, it leaves the image url \nparagraph the same way it met it.\n\nTo configure image support, you will need to create a file called `ficimage.json`. \nSee the section below for more information.\n\n\n### Configuration\nFicImage comes with a configuration file that allows you to customize the program to your liking.\n\nThe configuration file is in the [JSON file format](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON) \nand contains the following options:\n\n\n- `compress_images`: A boolean that tells FicImage whether to compress images. \n    This is only supported for `jpeg` and `png` images.\n- `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.\n- `max_image_size`: An integer that tells FicImage the maximum size of an image in bytes. \n    If an image is larger than this value, FicImage will compress it.\n\n\nFicImage checks for a configuration file in the given directory path. If no directory \npath is given, FicImage checks the current directory and then the Operating System's \nhome directory.\n\nIf it does not find one, it uses the following defaults:\n    \n```json\n{\n    \"compress_images\": true,\n    \"default_image_format\": \"JPEG\",\n    \"max_image_size\": 100000\n}\n```\n\n> Note: The `compress_images` key is a boolean and can only be `true` or `false`. \n> Booleans in JSON are written in lowercase.\n\n> Note: If the `default_image_format` key does not exist, FicImage will default to `jpeg`.\n> The two image formats are `jpeg` and `png`. \n> The `default_image_format` key is case-insensitive.\n\n> Note: The `compress_images` key tells FicImage to compress images. \n> This is only supported for `jpeg` and `png` images.\n> This also goes hand-in-hand with the `max_image_size` key. \n> If the `compress_images` key is `true` but there's no `max_image_size` key,\n> FicImage will compress the image to a size less than 1MB (1000000 bytes). \n> If the `max_image_size` key is present, FicImage will compress the image\n> to a size less than the value of the `max_image_size` key. \n> The `max_image_size` key is in bytes.\n\n> If `compress_images` is `false`, FicImage will ignore the `max_image_size` key.\n\n> Warning: Compressing images might make the image quality worse.\n\n> Warning: `max_image_size` is not a hard limit. FicImage will try to compress the\n> image to the size of the `max_image_size` key, but it might\n> not be able to compress the image to the exact size of the `max_image_size` key.\n\n> Warning: `max_image_size` should not be too small. \n> For instance, if you set `max_image_size` to 1 000, FicImage will \n> probably not be able to compress the image to 1 000 bytes (1 KB). \n> If you set `max_image_size` to 1 000 000, FicImage will probably be able to\n> compress the image to 1 000 000 bytes (1 MB).\n\n> Warning: FicImage will not compress GIFs or WEBPs, that might damage the animation.\n\n\n## TODO\n- [ ] Conversion to other FicHub supported formats from ePub.\n- [ ] More testing \n- [ ] Improve logs\n\n\n## Contributing\nFork the repo and get started!\n\n\n## Links\n\n- Me\n  \n    [LinkedIn](https://www.linkedin.com/in/emmanuel-jemeni) \u2022 [GitHub](https://github.com/Jemeni11) \u2022 [Twitter](https://twitter.com/Jemeni11_)\n\n- FicHub\n\n  Without FicHub, this project would (obviously lol) not exist.\n\n  [Website](https://fichub.net/) \u2022 [GitHub](https://github.com/FicHub/fichub.net) \u2022 [Discord](https://discord.gg/sByBAhX)\n\n  Thanks to [iris](https://github.com/iridescent-beacon) for helping me with this project as well.\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": "1.0.3",
    "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": "46b72e5bc2e295b6b7591720a89c388e2417ed8a3b8fb4774a47106250e0f333",
                "md5": "f4f27e667dab37affccb06176b6c9ff4",
                "sha256": "d8b5d652f8b7875c9ba12d4ff31d3845b82388e0245d4eee3590adc57e0c0c82"
            },
            "downloads": -1,
            "filename": "FicImage-1.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f4f27e667dab37affccb06176b6c9ff4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 10092,
            "upload_time": "2023-05-08T22:29:08",
            "upload_time_iso_8601": "2023-05-08T22:29:08.314221Z",
            "url": "https://files.pythonhosted.org/packages/46/b7/2e5bc2e295b6b7591720a89c388e2417ed8a3b8fb4774a47106250e0f333/FicImage-1.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0bcb6d62497a5e2cad2b0690f11cdf7b9179f46386db9b1b4190789411c46886",
                "md5": "6bfb1c139344a695ac59d54c8ac460d8",
                "sha256": "da2efd2d146c5a77adba3c7801a9cea455e32365fdaa9453ec25d65ad2547778"
            },
            "downloads": -1,
            "filename": "FicImage-1.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "6bfb1c139344a695ac59d54c8ac460d8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 8893,
            "upload_time": "2023-05-08T22:29:10",
            "upload_time_iso_8601": "2023-05-08T22:29:10.647373Z",
            "url": "https://files.pythonhosted.org/packages/0b/cb/6d62497a5e2cad2b0690f11cdf7b9179f46386db9b1b4190789411c46886/FicImage-1.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-08 22:29:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Jemeni11",
    "github_project": "FicImage",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "ficimage"
}
        
Elapsed time: 0.06531s