summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/drawing/pic.rb
AgeCommit message (Collapse)Author
2023-06-10Fix safe Style/ColonMethodCall offensesGeremia Taglialatela
Caxlsx is using both `.` and `::`, 220 occurrences vs 280 to invoke methods on `Axlsx` module. This commit standardizes the approach towards `.`, which will also allow shorter lines. Performance is not affected ``` Comparison: Axlsx.validate: 8515252.3 i/s Axlsx::validate: 8512863.7 i/s - same-ish: difference falls within error ```
2023-06-05Fix Style/RedundantInterpolation offensesGeremia Taglialatela
`%` is an operation on `String` that will return a new `String`, so the interpolation is redundant Also adds a missing spec on PivotTable#rels_pn ``` IPS: uninterpolated: 4045715.7 i/s interpolated: 2359775.6 i/s - 1.71x (± 0.00) slower Memory: uninterpolated: 160 allocated interpolated: 232 allocated - 1.45x more ```
2023-06-05Fix Style/FormatString offensesGeremia Taglialatela
`Kernel#format` is faster and will avoid to allocate an array compared to `String#%`. ``` IPS: kernel_format: 3877614.2 i/s string_percent: 3531475.0 i/s - 1.10x (± 0.00) slower Memory: kernel_format: 160 allocated string_percent: 200 allocated - 1.25x more ```
2023-05-31Use Ruby 1.9 hash syntaxGeremia Taglialatela
2023-05-31Fix Style/MutableConstant offensesGeremia Taglialatela
2023-05-15Fix Performance/StringIdentifierArgument offenseGeremia Taglialatela
2023-05-05Pipe output directly to str and avoid additional memory allocationsPaul Kmiec
Currently, there are lots of examples of code like this, ``` str << ('<tag ' << foo << ' ' << bar << '/>') ``` which create the string for the tag in memory before piping to str. We can avoid creating all of these intermediate strings by dropping the paranthesis and piping directly to str. This relies on the `str` passed around to handle lots of small appends. This is a problem when using RubyZip, but that is solved in the next commit.
2023-05-04Fix tests / code to work with frozen string literalsPaul Kmiec
2023-05-04Enable Style/FrozenStringLiteralComment and autocorrectPaul Kmiec
2023-04-12Rubocop fixesKoza
2023-04-12refactored code on Pic classSebastiano
2023-04-12clean codeSebastiano
2023-04-12improve validationSebastiano
add test cases
2023-04-12feat: add support for remote imagesSebastiano
2023-04-10Fix Layout/LeadingCommentSpace offensesGeremia Taglialatela
``` rubocop --only Layout/LeadingCommentSpace -a ```
2023-04-08Fix Layout/EmptyLineAfterGuardClause offensesGeremia Taglialatela
``` rubocop --only Layout/EmptyLineAfterGuardClause -a ```
2023-04-08Fix space-related offensesGeremia Taglialatela
- Layout/SpaceAfterComma - Layout/SpaceAroundEqualsInParameterDefault - Layout/SpaceAroundOperators - Layout/SpaceBeforeBlockBraces - Layout/SpaceInsideBlockBraces - Layout/SpaceInsideHashLiteralBraces - Layout/SpaceInsideParens
2023-04-08Fix EmptyLines related offensesGeremia Taglialatela
2023-04-06Fix Style/Encoding offensesGeremia Taglialatela
``` rubocop --only Style/Encoding -a ```
2017-04-01chore(doc): document some membersrandym
2016-11-12fix warning: constant ::Fixnum is deprecatedtakkanm
fix Fixnum deprecated warning on Ruby2.4-preview3. Fixnum was unify into Integer. https://bugs.ruby-lang.org/issues/12005
2015-07-04Add a little bit of doc, remove warning by using attr_readerJonathan Tron
2015-07-04Merge branch 'master' of https://github.com/alankessler/axlsx into ↵Jonathan Tron
alankessler-master
2015-07-03Extract mime type detection to an utility classmarc
2015-07-03Validates whether an image is acceptable through mime typemarc
image/jpeg, image/png & image/gif are considered the allowed mime types for an image. mimemagic gem is added as dependency in order to do the checking. Added tests to check against three supported mime types. A fake jpg fixture (created with 'touch' command) has been added to test that extension is no longer used.
2015-03-14opacity needs to be an integerAlan Kessler
2015-03-14Change option name to 'opacity' and allow value between 0 and 1.Alan Kessler
2015-01-28Make alpha option accessible for pictures 0 = transparent ... 100000 = opaqueAlan Kessler
2014-02-26Huge refactoringJurriaan Pruis
Do not create huge strings Let Row inherit from SimpleTypedList Optimized sanitizing Optimized validation And more..
2013-09-13Fixes for anchor swapping when adding images. - Two -> One swap still pending.Randy Morgan
2013-08-17updated image source validation to use lower case comparison of accepted ↵Randy Morgan
file extensions
2013-07-08Make relationship ids more reliable.Stefan Daschek
Relationship instances now keep track of their own id – this should be much more reliable than the old way of more or less “guessing” the relationship id based on the position of some object in some array. Fixes https://github.com/randym/axlsx/issues/212, especially. Each relationship now has its own, unique id – except for the cases when it doesn’t: Some relationships need to share the same id, see `Relation#should_use_same_id_as?` for the gory details. All tests pass, and the full example.xlsx is generated without errors and looks fine in Excel for Mac 2011. The pivot table example still has the problems mentioned in https://github.com/randym/axlsx/issues/168 – but as far as I can tell I didn’t make it worse (Excel is still be able to “repair” the file, and the repaired file then contains the pivot table).
2013-01-15Refactored relationship management for drawingsRandy Morgan
This should fix #160
2012-10-14Refactored to use use options parser.Randy Morgan
2012-05-30pop not allowed on simple typed list. Randy Morgan
Using delete instead.
2012-05-30enable anchor swapping between one and two cell anchors for drawingsRandy Morgan
2012-05-26add in two cell anchors for images.Randy Morgan
2012-04-03pre-release cleanupRandy Morgan
2012-04-01rebuild all serialization to use string concatenation instead of nokogiri.Randy Morgan
2012-04-01part way through changing all serialization to use string concatenation ↵Randy Morgan
prior to dropping Nokogiri dep in production.
2012-02-14Stomp out all warnings.Randy Morgan
"Method calls with expanded arrays require parentheses" Thanks rspec - I didn't know that.
2012-02-12Adding in support for optionally using the shared strings table. This will ↵Randy Morgan
allow us to inter-op properly with Numbers
2012-02-02Adding in hyperlinking for images as per issue #22Randy Morgan
2011-12-08cleaning up xml namespace usage in drawings and improving looks for charts ↵Randy Morgan
in excel 2011
2011-12-02Added locking attributes for pictures and some stubs for parsingRandy Morgan
2011-11-26adding in support for ruby 1.9.3Randy Morgan
release version 1.0.9
2011-11-23Adding image support and some document clean up for .8 releaseRandy Morgan