imagetovideoai-tools 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.rdoc +57 -0
- data/bin/imagetovideoai-inspect +20 -0
- data/lib/imagetovideoai_tools.rb +14 -0
- metadata +62 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 18796271f96aff9cbb33a8fdb47db05742bf4ecd5cd8d704e71425e52cd7292e
|
|
4
|
+
data.tar.gz: 0dd1ad616fe66529795c8b31fcc7f064fa8eba838a6e887c5948711f92126fbe
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: bec5216e55a9e420bd732ba8ec3a3f38846ae60e7d7d0c43e1d305a6684e24026fd2d98fee61992d40e27e28536a442cc8f1decd4fc4bdc760bad72a7d459284
|
|
7
|
+
data.tar.gz: 4efd4113162ec12e7fdb2161f11e13b6cad1642088933e75fe212421adb3108c5d2cf4eedb50874f2490d85b097c6add34f6a214e41ea136ce2ac634962df485
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Image to Video AI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.rdoc
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
= Image to Video AI Tools for Ruby
|
|
2
|
+
|
|
3
|
+
A Ruby library and command-line tool for inspecting local images before an
|
|
4
|
+
image-to-video workflow. It reports image format, dimensions, simplified
|
|
5
|
+
aspect ratio and file size. The tool uses FastImage to inspect image headers.
|
|
6
|
+
|
|
7
|
+
Inspection is local. The gem does not upload files, validate model requirements
|
|
8
|
+
or generate videos. To create a video, visit {Image to Video AI}[https://imagetovideoai.tools/?utm_source=rubygems&utm_medium=referral&utm_campaign=ruby_gem]
|
|
9
|
+
in your browser.
|
|
10
|
+
|
|
11
|
+
== Installation
|
|
12
|
+
|
|
13
|
+
gem install imagetovideoai-tools
|
|
14
|
+
|
|
15
|
+
Ruby 2.6 or later is required. FastImage is installed as a dependency.
|
|
16
|
+
|
|
17
|
+
== Command-line use
|
|
18
|
+
|
|
19
|
+
imagetovideoai-inspect photo.jpg
|
|
20
|
+
imagetovideoai-inspect photo.jpg another.png
|
|
21
|
+
|
|
22
|
+
The command prints a JSON array with one report per readable image. When a file
|
|
23
|
+
cannot be inspected, it prints an error to standard error, continues with other
|
|
24
|
+
files, and exits with a nonzero status.
|
|
25
|
+
|
|
26
|
+
Example:
|
|
27
|
+
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
"path": "photo.jpg",
|
|
31
|
+
"format": "jpeg",
|
|
32
|
+
"width": 1920,
|
|
33
|
+
"height": 1080,
|
|
34
|
+
"aspect_ratio": "16:9",
|
|
35
|
+
"size_bytes": 245000
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
Actual format, dimensions and size depend on the file.
|
|
40
|
+
|
|
41
|
+
== Ruby use
|
|
42
|
+
|
|
43
|
+
require 'imagetovideoai_tools'
|
|
44
|
+
report = ImageToVideoAiTools.inspect_image('photo.jpg')
|
|
45
|
+
puts report[:aspect_ratio]
|
|
46
|
+
|
|
47
|
+
Errors for missing or unsupported files are raised to the caller.
|
|
48
|
+
|
|
49
|
+
== Limitations
|
|
50
|
+
|
|
51
|
+
Supported formats depend on FastImage. Header inspection does not guarantee
|
|
52
|
+
that an image is fully decodable or accepted by a particular model. Dimensions
|
|
53
|
+
are those reported by FastImage; check your chosen workflow's requirements.
|
|
54
|
+
|
|
55
|
+
== License
|
|
56
|
+
|
|
57
|
+
MIT License.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
require 'json'
|
|
4
|
+
require 'imagetovideoai_tools'
|
|
5
|
+
if ARGV.empty?
|
|
6
|
+
warn 'Usage: imagetovideoai-inspect IMAGE [IMAGE ...]'
|
|
7
|
+
exit 2
|
|
8
|
+
end
|
|
9
|
+
failed = false
|
|
10
|
+
reports = ARGV.map do |path|
|
|
11
|
+
begin
|
|
12
|
+
ImageToVideoAiTools.inspect_image(path)
|
|
13
|
+
rescue StandardError => e
|
|
14
|
+
warn "#{path}: #{e.message}"
|
|
15
|
+
failed = true
|
|
16
|
+
nil
|
|
17
|
+
end
|
|
18
|
+
end.compact
|
|
19
|
+
puts JSON.pretty_generate(reports)
|
|
20
|
+
exit(failed ? 1 : 0)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
require 'fastimage'
|
|
3
|
+
module ImageToVideoAiTools
|
|
4
|
+
VERSION = '0.1.0'
|
|
5
|
+
def self.inspect_image(path)
|
|
6
|
+
raise ArgumentError, 'Expected a local file' unless File.file?(path)
|
|
7
|
+
width, height = FastImage.size(path, raise_on_failure: true)
|
|
8
|
+
format = FastImage.type(path, raise_on_failure: true)
|
|
9
|
+
raise ArgumentError, 'Invalid dimensions' unless width && height && width.positive? && height.positive?
|
|
10
|
+
divisor = width.gcd(height)
|
|
11
|
+
{ path: path.to_s, format: format.to_s, width: width, height: height,
|
|
12
|
+
aspect_ratio: "#{width / divisor}:#{height / divisor}", size_bytes: File.size(path) }
|
|
13
|
+
end
|
|
14
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: imagetovideoai-tools
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Image to Video AI
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-11-19 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: fastimage
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '2.3'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '2.3'
|
|
27
|
+
description: A Ruby library and CLI for inspecting local image dimensions, format,
|
|
28
|
+
aspect ratio and file size before an image-to-video workflow.
|
|
29
|
+
email:
|
|
30
|
+
executables:
|
|
31
|
+
- imagetovideoai-inspect
|
|
32
|
+
extensions: []
|
|
33
|
+
extra_rdoc_files: []
|
|
34
|
+
files:
|
|
35
|
+
- LICENSE
|
|
36
|
+
- README.rdoc
|
|
37
|
+
- bin/imagetovideoai-inspect
|
|
38
|
+
- lib/imagetovideoai_tools.rb
|
|
39
|
+
homepage: https://imagetovideoai.tools/?utm_source=rubygems&utm_medium=referral&utm_campaign=ruby_gem
|
|
40
|
+
licenses:
|
|
41
|
+
- MIT
|
|
42
|
+
metadata: {}
|
|
43
|
+
post_install_message:
|
|
44
|
+
rdoc_options: []
|
|
45
|
+
require_paths:
|
|
46
|
+
- lib
|
|
47
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
48
|
+
requirements:
|
|
49
|
+
- - ">="
|
|
50
|
+
- !ruby/object:Gem::Version
|
|
51
|
+
version: '2.6'
|
|
52
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
|
+
requirements:
|
|
54
|
+
- - ">="
|
|
55
|
+
- !ruby/object:Gem::Version
|
|
56
|
+
version: '0'
|
|
57
|
+
requirements: []
|
|
58
|
+
rubygems_version: 3.0.3.1
|
|
59
|
+
signing_key:
|
|
60
|
+
specification_version: 4
|
|
61
|
+
summary: Inspect local image dimensions and aspect ratios
|
|
62
|
+
test_files: []
|