After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 677025 - Some issues in get_file_content_as_base64()
Some issues in get_file_content_as_base64()
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
git master
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-05-29 12:39 UTC by Carlos Garcia Campos
Modified: 2012-06-14 11:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add ephy_file_create_data_uri_for_filename() (6.64 KB, patch)
2012-05-29 12:39 UTC, Carlos Garcia Campos
committed Details | Review

Description Carlos Garcia Campos 2012-05-29 12:39:51 UTC
Created attachment 215172 [details] [review]
Add ephy_file_create_data_uri_for_filename()

The image content type is a const string owned by GFileInfo, that is used after file_info is freed. 

The name of the function is a bit confusing, because it doesn't just encode the file contents as base64, it also builds and returns a data URI.

Name variables assume the file is an image, but the function could be used with any file.

The code is duplicated in aboput:applications handler, so I think we could move the function to ephy-file-helpers and use it from both error pages and applications handler.
Comment 1 Claudio Saavedra 2012-06-04 16:30:36 UTC
Since you are fixing several issues here, wouldn't it make sense to split the patch in several ones?
Comment 2 Carlos Garcia Campos 2012-06-05 06:53:15 UTC
I'm fixing several issues, but using a new method that fixes all of them, so I'm not sure.
Comment 3 Claudio Saavedra 2012-06-09 10:38:58 UTC
*** Bug 677736 has been marked as a duplicate of this bug. ***
Comment 4 Claudio Saavedra 2012-06-09 10:40:53 UTC
I'm inclined to let Dan's patch in 677736 in first and then we can apply your refactorings. What do you think?
Comment 5 Carlos Garcia Campos 2012-06-10 07:28:05 UTC
Ok.
Comment 6 Claudio Saavedra 2012-06-11 09:57:03 UTC
Ok, I pushed it!
Comment 7 Xan Lopez 2012-06-14 10:12:17 UTC
Review of attachment 215172 [details] [review]:

Cool stuff!