Skip to content

Commit 14dc6d9

Browse files
committed
so far
1 parent 6b76d56 commit 14dc6d9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/imagekit/helpers/helper.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def build_transformation_string(transformations)
143143
parsed_transform_step = []
144144

145145
current_transform.each do |key, value|
146-
next if value.nil?
146+
next if value.nil? || value.to_s.empty?
147147

148148
# Handle overlay separately
149149
if key.to_s == "overlay" && (value.is_a?(Hash) || value.respond_to?(:to_h))
@@ -309,8 +309,9 @@ def path_join(parts, separator = "/")
309309

310310
return "" if cleaned_parts.empty?
311311

312-
# Join with separator and add leading slash
313-
separator + cleaned_parts.join(separator)
312+
# URL encode each part and join with separator, add leading slash
313+
encoded_parts = cleaned_parts.map { |part| CGI.escape(part) }
314+
separator + encoded_parts.join(separator)
314315
end
315316

316317
# Process overlay transformation (full implementation)

lib/imagekit/helpers/transformation_utils.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ module TransformationUtils
3232
"x_center" => "xc",
3333
"xCenter" => "xc",
3434
"y" => "y",
35+
"y_" => "y",
3536
"y_center" => "yc",
3637
"yCenter" => "yc",
3738
"format" => "f",
39+
"format_" => "f",
3840
"video_codec" => "vc",
3941
"videoCodec" => "vc",
4042
"audio_codec" => "ac",

0 commit comments

Comments
 (0)