Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pleroma
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mfc
pleroma
Commits
e240784f
Commit
e240784f
authored
5 years ago
by
feld
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Merge branch 'to-jpeg' into 'mfc-develop'"
This reverts merge request !1
parent
db045c20
Branches
revert-db045c20
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/pleroma/uploaders/mfc/image.ex
+1
-6
1 addition, 6 deletions
lib/pleroma/uploaders/mfc/image.ex
test/mfc/uploaders/mfc_image_test.exs
+0
-21
0 additions, 21 deletions
test/mfc/uploaders/mfc_image_test.exs
with
1 addition
and
27 deletions
lib/pleroma/uploaders/mfc/image.ex
+
1
−
6
View file @
e240784f
...
...
@@ -49,7 +49,7 @@ def convert(client, path) do
"source_key"
=>
MFC
.
rename_original_path
(
path
),
"versions"
=>
%{
"original"
=>
%{
"dest_key"
=>
change_to_jpg
(
path
)
,
"dest_key"
=>
path
,
"resolution"
=>
@resolution
,
"method"
=>
@convert_method
,
"auto_orient"
=>
@auto_orient
,
...
...
@@ -93,9 +93,4 @@ def build_preview_url(path) do
%
URI
{
uri
|
path:
uri
.
path
<>
postfix_preview_name
}
|>
to_string
end
@spec
change_to_jpg
(
String
.
t
())
::
String
.
t
()
def
change_to_jpg
(
path
)
do
Regex
.
replace
(
~r/\.(.*?)$/
,
path
,
".jpg"
)
end
end
This diff is collapsed.
Click to expand it.
test/mfc/uploaders/mfc_image_test.exs
deleted
100644 → 0
+
0
−
21
View file @
db045c20
defmodule
Pleroma
.
Uploaders
.
MFCImageTest
do
use
Pleroma
.
DataCase
describe
"change_to_jpg"
do
test
"image extenstion is converted to jpg"
do
assert
"some/image/path.jpg"
==
Pleroma
.
Uploaders
.
MFC
.
Image
.
change_to_jpg
(
"some/image/path.png"
)
assert
"some/image/path.jpg"
==
Pleroma
.
Uploaders
.
MFC
.
Image
.
change_to_jpg
(
"some/image/path.tiff"
)
assert
"some/image/path.jpg"
==
Pleroma
.
Uploaders
.
MFC
.
Image
.
change_to_jpg
(
"some/image/path.png_original"
)
end
test
"image extenstion for jpg is preserved"
do
assert
"some/image/path.jpg"
==
Pleroma
.
Uploaders
.
MFC
.
Image
.
change_to_jpg
(
"some/image/path.jpg"
)
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment