Skip to content

Commit 74d51fe

Browse files
committed
move original sized images to new folder, process accordingly
1 parent c48244a commit 74d51fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+9
-8
lines changed

blinka.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ <h1>Blinka</h1>
6161
{{ "/assets/images/boards/large/" | append: board.board_image | relative_url }} 700w"
6262
sizes="(max-width: 1024px) 700px,
6363
300px"
64-
src="{{ "/assets/images/boards/" | append: board.board_image | relative_url }}" alt="Image of Board">
64+
src="{{ "/assets/images/boards/original" | append: info.board_image | relative_url }}" alt="Image of Board">
6565
</div>
6666
<div class="details">
6767
<h3>{{ board.name }}</h3>

downloads.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ <h1>Downloads</h1>
7676
{{ "/assets/images/boards/large/" | append: info.board_image | relative_url }} 700w"
7777
sizes="(max-width: 1024px) 700px,
7878
300px"
79-
src="{{ "/assets/images/boards/" | append: info.board_image | relative_url }}" alt="Image of Board">
79+
src="{{ "/assets/images/boards/original" | append: info.board_image | relative_url }}" alt="Image of Board">
8080
</div>
8181
<div class="details">
8282
<h3>{{ info.name | default: board.id }}</h3>
@@ -106,7 +106,7 @@ <h3>{{ info.name | default: board.id }}</h3>
106106
{{ "/assets/images/boards/large/" | append: board.board_image | relative_url }} 700w"
107107
sizes="(max-width: 1024px) 700px,
108108
300px"
109-
src="{{ "/assets/images/boards/" | append: board.board_image | relative_url }}" alt="Image of Board">
109+
src="{{ "/assets/images/boards/original" | append: board.board_image | relative_url }}" alt="Image of Board">
110110
</div>
111111
<div class="details">
112112
<h3>{{ board.name }}</h3>

lib/tasks/images.rake

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@ namespace :images do
1212
Pathname.new(board_image_path).children.each do |path|
1313
next unless path.file?
1414
puts "processing #{path}"
15-
small_processed = ImageProcessing::MiniMagick.source(path)
15+
original_path = File.join(board_image_path, 'original', path.basename)
16+
large_path = File.join(board_image_path, 'large', path.basename)
17+
small_path = File.join(board_image_path, 'small', path.basename)
18+
19+
small_processed = ImageProcessing::MiniMagick.source(original_path)
1620
.resize_to_limit(300, 225)
1721
.call
1822

19-
large_processed = ImageProcessing::MiniMagick.source(path)
23+
large_processed = ImageProcessing::MiniMagick.source(original_path)
2024
.resize_to_limit(800, 600)
2125
.call
2226

23-
large_path = File.join(board_image_path, 'large', path.basename)
24-
small_path = File.join(board_image_path, 'small', path.basename)
25-
2627
`mozcjpeg -quality 80 -optimize -outfile #{large_path} #{large_processed.path}`
2728
`mozcjpeg -quality 80 -optimize -outfile #{small_path} #{small_processed.path}`
2829
end

0 commit comments

Comments
 (0)